35 lines
886 B
C++
35 lines
886 B
C++
// vi:set ft=cpp: -*- Mode: C++ -*-
|
|
/**
|
|
* \file
|
|
* Implementation of a list of ref-ptr-managed objects.
|
|
*/
|
|
/*
|
|
* Copyright (C) 2018, 2022, 2024 Kernkonzept GmbH.
|
|
* Author(s): Sarah Hoffmann <sarah.hoffmann@kernkonzept.com>
|
|
*
|
|
* License: see LICENSE.spdx (in this directory or the directories above)
|
|
*/
|
|
#pragma once
|
|
|
|
#include <l4/cxx/ref_ptr>
|
|
|
|
#include "bits/smart_ptr_list.h"
|
|
|
|
namespace cxx {
|
|
|
|
/// Item for list linked with cxx::Ref_ptr.
|
|
template <typename T>
|
|
using Ref_ptr_list_item = Bits::Smart_ptr_list_item<T, cxx::Ref_ptr<T> >;
|
|
|
|
/// Item for list linked via cxx::Ref_ptr with default refence counting.
|
|
template <typename T>
|
|
struct Ref_obj_list_item : public Ref_ptr_list_item<T>, public cxx::Ref_obj {};
|
|
|
|
/**
|
|
* Single-linked list where elements are connected via a cxx::Ref_ptr.
|
|
*/
|
|
template <typename T>
|
|
using Ref_ptr_list = Bits::Smart_ptr_list<Ref_ptr_list_item<T> >;
|
|
|
|
}
|