CMS 3D CMS Logo

VisG4Path::Node Class Reference

List of all members.

Public Member Functions

short daughter (void) const
Nodeget (short daughter, short replica)
 Node (Node *parent, short daughter, short replica)
 Node (void)
Nodeparent (void) const
void ref (void)
short replica (void) const
void unref (void)
 ~Node (void)

Static Public Member Functions

static Noderoot (void)

Private Attributes

Nodem_children
short m_daughter
Nodem_parent
unsigned m_refs
short m_replica
Nodem_sibling

Static Private Attributes

static Nodes_root = new Node


Detailed Description

Definition at line 30 of file VisG4Path.h.


Constructor & Destructor Documentation

VisG4Path::Node::Node ( void   )  [inline]

Definition at line 88 of file VisG4Path.h.

Referenced by get().

00089     : m_parent (this),
00090       m_sibling (0),
00091       m_children (0),
00092       m_refs (1),
00093       m_daughter (-1),
00094       m_replica (-1)
00095 {}

VisG4Path::Node::Node ( Node parent,
short  daughter,
short  replica 
) [inline]

Definition at line 98 of file VisG4Path.h.

References m_children, m_parent, and m_refs.

00099     : m_parent (parent),
00100       m_sibling (parent->m_children),
00101       m_children (0),
00102       m_refs (0),
00103       m_daughter (daughter),
00104       m_replica (replica)
00105 { m_parent->m_refs++; m_parent->m_children = this; }

VisG4Path::Node::~Node ( void   )  [inline]

Definition at line 108 of file VisG4Path.h.

References m_children, m_parent, m_refs, and m_sibling.

00109 {
00110     if (m_parent->m_children == this)
00111         m_parent->m_children = m_sibling;
00112     else
00113     {
00114         Node *prev = m_parent->m_children;
00115         while (prev->m_sibling != this)
00116             prev = prev->m_sibling;
00117 
00118         prev->m_sibling = m_sibling;
00119     }
00120 
00121     if (--m_parent->m_refs == 0)
00122         delete m_parent;
00123 }


Member Function Documentation

short VisG4Path::Node::daughter ( void   )  const [inline]

Definition at line 137 of file VisG4Path.h.

References m_daughter.

Referenced by VisG4Path::daughter().

00138 { return m_daughter; }

VisG4Path::Node * VisG4Path::Node::get ( short  daughter,
short  replica 
) [inline]

Definition at line 149 of file VisG4Path.h.

References m_children, m_daughter, m_replica, m_sibling, n, and Node().

00150 {
00151     Node *n = m_children;
00152     while (n && ! (n->m_daughter == daughter && n->m_replica == replica))
00153         n = n->m_sibling;
00154 
00155     if (! n)
00156         n = new Node (this, daughter, replica);
00157 
00158     return n;
00159 }

VisG4Path::Node * VisG4Path::Node::parent ( void   )  const [inline]

Definition at line 145 of file VisG4Path.h.

References m_parent.

Referenced by VisG4Path::prefix().

00146 { return m_parent; }

void VisG4Path::Node::ref ( void   )  [inline]

Definition at line 126 of file VisG4Path.h.

References m_refs.

Referenced by VisG4Path::operator=(), and VisG4Path::VisG4Path().

00127 { m_refs++; }

short VisG4Path::Node::replica ( void   )  const [inline]

Definition at line 141 of file VisG4Path.h.

References m_replica.

Referenced by VisG4Path::replica().

00142 { return m_replica; }

VisG4Path::Node * VisG4Path::Node::root ( void   )  [inline, static]

Definition at line 162 of file VisG4Path.h.

References s_root.

00163 { return s_root; }

void VisG4Path::Node::unref ( void   )  [inline]

Definition at line 130 of file VisG4Path.h.

References m_refs.

Referenced by VisG4Path::operator=(), and VisG4Path::~VisG4Path().

00131 {
00132     if (--m_refs == 0)
00133         delete this;
00134 }


Member Data Documentation

Node* VisG4Path::Node::m_children [private]

Definition at line 50 of file VisG4Path.h.

Referenced by get(), Node(), and ~Node().

short VisG4Path::Node::m_daughter [private]

Definition at line 52 of file VisG4Path.h.

Referenced by daughter(), and get().

Node* VisG4Path::Node::m_parent [private]

Definition at line 48 of file VisG4Path.h.

Referenced by Node(), parent(), and ~Node().

unsigned VisG4Path::Node::m_refs [private]

Definition at line 51 of file VisG4Path.h.

Referenced by Node(), ref(), unref(), and ~Node().

short VisG4Path::Node::m_replica [private]

Definition at line 53 of file VisG4Path.h.

Referenced by get(), and replica().

Node* VisG4Path::Node::m_sibling [private]

Definition at line 49 of file VisG4Path.h.

Referenced by get(), and ~Node().

VisG4Path::Node * VisG4Path::Node::s_root = new Node [static, private]

Definition at line 55 of file VisG4Path.h.

Referenced by root().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:35:24 2009 for CMSSW by  doxygen 1.5.4