The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Public Attributes | Private Member Functions | List of all members
utils::smart_list< Data >::node_t Struct Reference

Nodes in the smart list. More...

Public Member Functions

 node_t ()
 Default constructor. This is for creating the root of a list. More...
 
 node_t (const Data &d)
 Initialized constructor. This is for creating a node in a list. More...
 
 ~node_t ()
 Destructor. More...
 

Public Attributes

Data *const dat_ptr
 The data of the node. This is nullptr for a list's root. More...
 
size_t ref_count
 ref_count counts 1 for the list and 2 for each iterator pointing to this node. More...
 
node_tnext
 
node_tprev
 

Private Member Functions

node_toperator= (const node_t &)
 No assignments. More...
 
 node_t (const node_t &that)
 No copying. More...
 

Detailed Description

template<class Data>
struct utils::smart_list< Data >::node_t

Nodes in the smart list.

Definition at line 51 of file smart_list.hpp.

Constructor & Destructor Documentation

template<class Data>
utils::smart_list< Data >::node_t::node_t ( )
inline

Default constructor. This is for creating the root of a list.

Definition at line 54 of file smart_list.hpp.

template<class Data>
utils::smart_list< Data >::node_t::node_t ( const Data &  d)
inlineexplicit

Initialized constructor. This is for creating a node in a list.

Definition at line 57 of file smart_list.hpp.

template<class Data >
utils::smart_list< Data >::node_t::~node_t ( )
inline
template<class Data>
utils::smart_list< Data >::node_t::node_t ( const node_t that)
private

No copying.

Member Function Documentation

template<class Data>
node_t& utils::smart_list< Data >::node_t::operator= ( const node_t )
private

No assignments.

Member Data Documentation

template<class Data>
Data* const utils::smart_list< Data >::node_t::dat_ptr
template<class Data>
node_t* utils::smart_list< Data >::node_t::next
template<class Data>
node_t* utils::smart_list< Data >::node_t::prev
template<class Data>
size_t utils::smart_list< Data >::node_t::ref_count
mutable

ref_count counts 1 for the list and 2 for each iterator pointing to this node.

(So nodes are flagged for deletion when ref_count is even.)

Definition at line 66 of file smart_list.hpp.

Referenced by utils::smart_list< Data >::check_erase(), utils::smart_list< Data >::iterator_base< Value, Reversed >::unref(), and utils::smart_list< Data >::node_t::~node_t().


The documentation for this struct was generated from the following file: