User Manual, Developers Guide and API Documentation

wns::node::Node Class Reference

Contains various Components to form a network element in a simulation. More...

#include <node/Node.hpp>

Inheritance diagram for wns::node::Node:

Inheritance graph
[legend]
Collaboration diagram for wns::node::Node:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void addService (const std::string &name, service::Service *si)
 Component will be stored under the name ci->getName().
virtual
probe::bus::ContextProviderCollection
getContextProviderCollection ()
std::string getName () const
 Name of the Node (also used in the registry).
unsigned int getNodeID () const
 NodeID of the Node.
 Node (Registry *registry, const pyconfig::View &pyco)
virtual void onShutdown ()
 Called before simulation will finally shutdown.
virtual void onWorldCreated ()
 Inform all components that world has been created.
virtual void startup ()
 Called immedeatly after constructor.
virtual ~Node ()

Protected Types

typedef std::list
< component::Interface * > 
ComponentContainer
 Container for Components.
typedef
wns::container::Registry
< std::string,
service::Service * > 
ServiceContainer
 Container with name of and reference to the Service.

Protected Member Functions

virtual wns::service::ServicegetAnyService (const component::FQSN &name) const
 Retrieve a Service by its FQSN.

Protected Attributes

wns::pyconfig::View config
 The Python configuration of this node.
probe::bus::ContextProviderCollection contextProviderRegistry
 Container to hold the node-wide.
RegistryglobalNodes
 pointer to the node registry
ComponentContainer localComponents
 Components are kept in a list in order to able to destroy them when finished.
ServiceContainer localServices
 Components are stored in this container.
logger::Logger log
 Logger instance.
std::string name
 The name of this Node.
unsigned int nodeID
 The NodeID of this Node.

Static Protected Attributes

static std::list< unsigned
long int
ids
 List of allocated ids.

Friends

class wns::node::tests::NodeTest


Detailed Description

Author:
Marc Schinnenburg <msg@comnets.rwth-aachen.de>

Daniel Bltmann <dbn@comnets.rwth-aachen.de>

For an overview please see wns::node

Definition at line 68 of file Node.hpp.


Member Typedef Documentation

Definition at line 85 of file Node.hpp.

Definition at line 80 of file Node.hpp.


Constructor & Destructor Documentation

Node::Node ( Registry registry,
const pyconfig::View pyco 
) [explicit]

Parameters:
[in] registry A node will register itself at this registry with the name provided in pyco
[in] pyco contains the Node configuration as well as all Component configurations
The Node will create all necessary Components and ask them to connect to each other.

Definition at line 42 of file Node.cpp.

Node::~Node (  )  [virtual]

Definition at line 110 of file Node.cpp.


Member Function Documentation

void Node::addService ( const std::string &  name,
service::Service si 
) [virtual]

Note:
Complexity: O(log(N)), N = number of Services

Assures: Name of Service is unique across all nodes in a simulation.

Implements wns::node::Interface.

Definition at line 126 of file Node.cpp.

wns::service::Service * Node::getAnyService ( const component::FQSN name  )  const [protected, virtual]

Usage:

00001 
00002 // retrieve TCP instance from Node
00003 component::tests::TCPInterface* tcp =
00004     node->getService<component::tests::TCPInterface*>("TCP");

Implements wns::node::Interface.

Definition at line 170 of file Node.cpp.

wns::probe::bus::ContextProviderCollection & Node::getContextProviderCollection (  )  [virtual]

Returns:
ContextProviderCollection for Probes

Implements wns::node::Interface.

Definition at line 149 of file Node.cpp.

std::string Node::getName (  )  const [virtual]

Returns:
Name of this node

Implements wns::node::Interface.

Definition at line 155 of file Node.cpp.

unsigned int Node::getNodeID (  )  const [virtual]

Returns:
NodeID of this node

Implements wns::node::Interface.

Definition at line 162 of file Node.cpp.

void Node::onShutdown (  )  [virtual]

Note:
All "now" events are processed will be processed event after this method is called.

Destructor of Node will be called after all events are processed.

Implements wns::node::Interface.

Definition at line 141 of file Node.cpp.

void Node::onWorldCreated (  )  [virtual]

Implements wns::node::Interface.

Definition at line 133 of file Node.cpp.

void Node::startup (  )  [virtual]

This will be called after the constructor has been called. The Node can call virtual methods of itself which is forbidden in the constructor. The probing system is available at this point

Implements wns::node::Interface.

Definition at line 80 of file Node.cpp.


Friends And Related Function Documentation

friend class wns::node::tests::NodeTest [friend]

Definition at line 74 of file Node.hpp.


Member Data Documentation

Definition at line 199 of file Node.hpp.

Definition at line 184 of file Node.hpp.

Definition at line 209 of file Node.hpp.

std::list< unsigned long int > Node::ids [static, protected]

NodeIds created within the configuration. This is fine, but we need to double check. If an ID is configured that is already recorded here, we throw.

Definition at line 224 of file Node.hpp.

Definition at line 215 of file Node.hpp.

Definition at line 179 of file Node.hpp.

Definition at line 204 of file Node.hpp.

std::string wns::node::Node::name [protected]

Definition at line 189 of file Node.hpp.

unsigned int wns::node::Node::nodeID [protected]

Definition at line 194 of file Node.hpp.


The documentation for this class was generated from the following files:

Generated on Sun May 27 03:33:01 2012 for openWNS by  doxygen 1.5.5