Public Types | Public Member Functions | Static Public Attributes | Static Private Member Functions | Private Attributes
vgui_parent_child_link_impl Struct Reference

Smart-pointer implementation of vgui_parent_child_link. More...

List of all members.

Public Types

typedef vcl_set< void * > all_t

Public Member Functions

 vgui_parent_child_link_impl (vgui_tableau *p_, vgui_tableau *c_)
 ~vgui_parent_child_link_impl ()
void assign (vgui_tableau *t)
vgui_tableauparent () const
vgui_tableauchild () const
void acquire ()
void release ()

Static Public Attributes

static all_tall = 0
static int all_refs = -1

Static Private Member Functions

static void link (vgui_tableau *p, vgui_tableau *c)
static void unlink (vgui_tableau *p, vgui_tableau *c)

Private Attributes

vgui_tableaup
vgui_tableauc
int use_count

Detailed Description

Smart-pointer implementation of vgui_parent_child_link.

This container holds a single pointer for every impl object. The pointers are cast to and from void* to avoid (a) exposing the implementation class and (b) instantiating an extra class template.

Implementation notes:

[1] Since tableaux will hold parent_child_links and use them to refer to children, each parent_child_link must ref()erence its child.

[2] A parent_child_link should not ref()erence its parent as that would lead to cyclic dependencies and hence core leaks. Thus, we use a raw pointer to hold the parent.

[3] A vgui_tableau_sptr could be used to hold the child, but there is no real advantage in that.

[4] A parent_child_link's parent pointer must never be zero because a parent_child_link which does not have a parent is a useless parent_child_link (and so is most likely an error). Thus 'p' is a private data member of vgui_parent_child_link_impl and the constructor will cause assertion failure if given a null parent pointer.

[5] A parent_child_link's parent pointer cannot be changed because there is no legitimate use for that.

Definition at line 56 of file vgui_parent_child_link.cxx.


Member Typedef Documentation

typedef vcl_set<void *> vgui_parent_child_link_impl::all_t

Definition at line 60 of file vgui_parent_child_link.cxx.


Constructor & Destructor Documentation

vgui_parent_child_link_impl::vgui_parent_child_link_impl ( vgui_tableau p_,
vgui_tableau c_ 
) [inline]

Definition at line 132 of file vgui_parent_child_link.cxx.

vgui_parent_child_link_impl::~vgui_parent_child_link_impl ( ) [inline]

Definition at line 165 of file vgui_parent_child_link.cxx.


Member Function Documentation

void vgui_parent_child_link_impl::acquire ( ) [inline]

Definition at line 96 of file vgui_parent_child_link.cxx.

void vgui_parent_child_link_impl::assign ( vgui_tableau t) [inline]

Definition at line 185 of file vgui_parent_child_link.cxx.

vgui_tableau* vgui_parent_child_link_impl::child ( ) const [inline]

Definition at line 72 of file vgui_parent_child_link.cxx.

void vgui_parent_child_link_impl::link ( vgui_tableau p,
vgui_tableau c 
) [inline, static, private]

Definition at line 124 of file vgui_parent_child_link.cxx.

vgui_tableau* vgui_parent_child_link_impl::parent ( ) const [inline]

Definition at line 71 of file vgui_parent_child_link.cxx.

void vgui_parent_child_link_impl::release ( ) [inline]

Definition at line 101 of file vgui_parent_child_link.cxx.

void vgui_parent_child_link_impl::unlink ( vgui_tableau p,
vgui_tableau c 
) [inline, static, private]

Definition at line 109 of file vgui_parent_child_link.cxx.


Member Data Documentation

vcl_set< void * > * vgui_parent_child_link_impl::all = 0 [static]

Definition at line 61 of file vgui_parent_child_link.cxx.

Definition at line 62 of file vgui_parent_child_link.cxx.

Definition at line 81 of file vgui_parent_child_link.cxx.

Definition at line 80 of file vgui_parent_child_link.cxx.

Definition at line 82 of file vgui_parent_child_link.cxx.


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