InstantIO::Root Class Reference

The root namespace. More...

#include <InstantIO/Root.h>

Inheritance diagram for InstantIO::Root:
InstantIO::Namespace

List of all members.

Classes

class  ReadLock
 Helper class for exception-safe read-locking. More...
class  WriteLock
 Helper class for exception-safe write-locking. More...

Public Member Functions

virtual ~Root ()
 Destroys the Root object.
void readLock ()
 Locks the whole InstantIO system for read access.
void writeLock ()
 Locks the whole InstantIO system for write access.
void unlock ()
 Unlocks the whole InstantIO system.
NamespacegetNamespaceFromPath (const std::string &ns)
 Tries to find a Namespace in a subtree of Namespaces.

Static Public Member Functions

static Rootthe ()
 Returns the single instance of the Root class.

Protected Member Functions

 Root ()
 Creates a new Root object.

Friends

class NodeType

Detailed Description

The root namespace.

InSlots and OutSlots have to be added to Namespaces to connect them to each other. But there is one major problem: How do two software components that do not know anything about each other add their InSlots and OutSlots to the same Namespace?

The Root class is the answer to this question. It serves as a root namespace for all namespaces used by the software system. Root is a singleton, i.e. there exists exactly one instance of the root. Therefore, it is not possible to create new instances of the Root class (the constructor is private). Instead, software components that need to access the single instance have to call the static method the, as demonstrated in the following example:

 Root &root = Root::the();
 

Author:
Patrick Dähne
See also:
Namespace Namespace

Constructor & Destructor Documentation

InstantIO::Root::Root (  )  [protected]

Creates a new Root object.


Member Function Documentation

static Root& InstantIO::Root::the (  )  [inline, static]

Returns the single instance of the Root class.

Returns:
The single instance.
Namespace* InstantIO::Root::getNamespaceFromPath ( const std::string &  ns  ) 

Tries to find a Namespace in a subtree of Namespaces.

Parameters:
ns The path to the Namespace. The path consists of the names of the Namespaces, starting from the root, down to the searched Namespace, divided by slashes ("/").
Returns:
The Namespace object
Exceptions:
InvalidNamespaceException when the method cannot find the Namespace in the subtree.

The documentation for this class was generated from the following file:
Generated on Thu Jul 31 17:17:32 2014 by  doxygen 1.6.3