Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

L1394::internal::NodeContainer Class Reference
[Internal]

This class stores and manages the Node objects. More...

#include <l1394_nodecontainer.h>

List of all members.

Public Member Functions

 ~NodeContainer ()
 destructor
NodegetNode (u_int64_t guid)
 This method returns the Node object with guid, NULL if this node not exist.
NodefindNode (u_int64_t guid)
 This method returns the Node object with guid, NULL if this node not exist.
bool nodeExist (u_int64_t guid)
 This method checks, if a Node object with a specific guid exist.
void release (Node *node)
 This method releases Node objects.
void insert (Node *node)
 This method inserts a new Node object into the node_list.
void removeNode (const Node *n)

Static Public Member Functions

static NodeContainergetNodeContainer ()

Protected Member Functions

 NodeContainer ()
 Constructor.


Detailed Description

This class stores and manages the Node objects.

A NodeContainer object stores the Node objects, created by the Card objects
To store the objects two (STL)single associated container are used.The Node objects are stored as key/value pairs, for fast access to them. The key is the GUID, the value the object pointer.
The first container stores the active Node objects, that are connected to FireWire bus The second one stores the inactive Node objects. An inactive node object is a Node object, that was disconnected from FireWire bus, but was not deleted. After a defined timeout, node objects for disconnected nodes are deleted.

Author:
Michael Repplinger

Definition at line 48 of file l1394_nodecontainer.h.


Constructor & Destructor Documentation

L1394::internal::NodeContainer::~NodeContainer  ) 
 

destructor

Definition at line 40 of file l1394_nodecontainer.cpp.

References L1394::internal::Message::debugStream(), L1394::ThreadMutex::lock(), and L1394::ThreadMutex::unlock().

L1394::internal::NodeContainer::NodeContainer  )  [protected]
 

Constructor.

Definition at line 27 of file l1394_nodecontainer.cpp.

References L1394::Singleton< T, CreationPolicy, LifetimePolicy, ThreadingModel >::getInstance().

Referenced by getNodeContainer().


Member Function Documentation

L1394::internal::NodeContainer::findNode u_int64_t  guid  ) 
 

This method returns the Node object with guid, NULL if this node not exist.

The difference between getNode(u_int64_t guid) is, that the reference counter is not be increased. This method is for internal use only.

Parameters:
guid : u_int64_t value with the guid
Returns:
Node* : pointer to the Node object with guid value, NULL if the Node object not exist

Definition at line 99 of file l1394_nodecontainer.cpp.

References L1394::internal::Message::debugStream(), L1394::ThreadMutex::lock(), and L1394::ThreadMutex::unlock().

L1394::internal::NodeContainer::getNode u_int64_t  guid  ) 
 

This method returns the Node object with guid, NULL if this node not exist.

If you use this function, the internal reference counter is increased.

Parameters:
guid : u_int64_t value with the guid
Returns:
Node* : pointer to the Node object with guid value, NULL if the Node object not exist

Definition at line 69 of file l1394_nodecontainer.cpp.

References L1394::internal::Message::debugStream(), insert(), L1394::ThreadMutex::lock(), and L1394::ThreadMutex::unlock().

Referenced by L1394::Card::makeNodeList().

NodeContainer * L1394::internal::NodeContainer::getNodeContainer  )  [static]
 

Definition at line 31 of file l1394_nodecontainer.cpp.

References L1394::ThreadMutex::lock(), NodeContainer(), and L1394::ThreadMutex::unlock().

Referenced by L1394::Card::Card(), and L1394::Session::getNode().

L1394::internal::NodeContainer::insert Node node  ) 
 

This method inserts a new Node object into the node_list.

?

Definition at line 128 of file l1394_nodecontainer.cpp.

References L1394::internal::Message::debugStream(), L1394::internal::Message::errorStream(), L1394::ThreadMutex::lock(), nodeExist(), and L1394::ThreadMutex::unlock().

Referenced by L1394::Card::Card(), getNode(), and L1394::Card::makeNodeList().

L1394::internal::NodeContainer::nodeExist u_int64_t  guid  ) 
 

This method checks, if a Node object with a specific guid exist.

Parameters:
u_int64_t value for the guid
Returns:
bool : This method return true, if a Node object with guid exist, else false.

Definition at line 144 of file l1394_nodecontainer.cpp.

Referenced by insert(), and L1394::Card::nodeExist().

L1394::internal::NodeContainer::release Node node  ) 
 

This method releases Node objects.

You must use this function, if you get a Node object with getNode(u_int64_t guid). This method decrease the reference counter and if the reference counter is less than 1, the Node object is inserted in the inactive_node_list.

Parameters:
node : pointer to the Node object.

Definition at line 110 of file l1394_nodecontainer.cpp.

References L1394::_Card, and L1394::internal::Message::debugStream().

Referenced by L1394::Card::makeNodeList(), and L1394::Card::~Card().

void L1394::internal::NodeContainer::removeNode const Node n  ) 
 

Definition at line 153 of file l1394_nodecontainer.cpp.

References L1394::ThreadMutex::lock(), L1394::ThreadMutex::unlock(), and L1394::internal::Message::warningStream().

Referenced by L1394::Card::~Card().


The documentation for this class was generated from the following files:
Generated on Wed Aug 24 00:36:45 2005 for L1394 by doxygen 1.4.2
L1394 library (NMM) grahics.cs.uni-sb.de/~repplix/l1394_home/