CPN
Computational Process Networks
Public Member Functions | Private Attributes | List of all members
CPN::NodeAttr Class Reference

Attributes for a node. More...

#include <NodeAttr.h>

+ Collaboration diagram for CPN::NodeAttr:

Public Member Functions

 NodeAttr (const std::string &name_, const std::string &nodetype_)
 
NodeAttrSetName (const std::string &name_)
 
NodeAttrSetTypeName (const std::string &nodetype_)
 
NodeAttrSetKernel (const std::string &kname)
 
NodeAttrSetKernelKey (Key_t k)
 
NodeAttrSetParam (const std::string &key, const std::string value)
 
template<typename T >
NodeAttrSetParam (const std::string &key, T value)
 
NodeAttrSetKey (Key_t key_)
 
const std::string & GetKernel () const
 
Key_t GetKernelKey () const
 
const std::string & GetName () const
 
const std::string & GetTypeName () const
 
const std::map< std::string,
std::string > & 
GetParams () const
 
Key_t GetKey () const
 

Private Attributes

std::string kernelname
 
Key_t kernelkey
 
std::string name
 
std::string nodetype
 
std::map< std::string,
std::string > 
params
 
Key_t key
 

Detailed Description

Attributes for a node.

This structure contains all the attributes and parameters a node needs to start up. Note that this structure is used to pass to the Kernel to create a node and that fields like key are set by the Kernel.

The only required parameters are the name and node type.

The other parameters that the user may set are:

The kernel for the node can be set as either the kernel name or the kernel key. If the kernel key is set kernel name is ignored. See SetKernel and SetKernelKey.

The parameters sent to the node. See SetParam and GetParam

Note that the key attribute are set by the kernel when the node is to be created and such are overwritten.

Definition at line 58 of file NodeAttr.h.

Constructor & Destructor Documentation

CPN::NodeAttr::NodeAttr ( const std::string &  name_,
const std::string &  nodetype_ 
)
inline

Definition at line 60 of file NodeAttr.h.

62  : kernelname(),
63  kernelkey(0),
64  name(name_),
65  nodetype(nodetype_),
66  key(0)
67  {}
std::string kernelname
Definition: NodeAttr.h:119
std::string name
Definition: NodeAttr.h:121
Key_t kernelkey
Definition: NodeAttr.h:120
std::string nodetype
Definition: NodeAttr.h:122

Member Function Documentation

const std::string& CPN::NodeAttr::GetKernel ( ) const
inline

Definition at line 107 of file NodeAttr.h.

Referenced by CPN::Kernel::CreateNode(), and CPN::RemoteContextClient::SendCreateNode().

107 { return kernelname; }
std::string kernelname
Definition: NodeAttr.h:119

+ Here is the caller graph for this function:

Key_t CPN::NodeAttr::GetKernelKey ( ) const
inline

Definition at line 108 of file NodeAttr.h.

Referenced by CPN::Kernel::CreateNode().

108 { return kernelkey; }
Key_t kernelkey
Definition: NodeAttr.h:120

+ Here is the caller graph for this function:

Key_t CPN::NodeAttr::GetKey ( ) const
inline

Definition at line 116 of file NodeAttr.h.

Referenced by CPN::Kernel::InternalCreateNode(), and CPN::RemoteContextClient::SendCreateNode().

116 { return key; }

+ Here is the caller graph for this function:

const std::string& CPN::NodeAttr::GetName ( ) const
inline

Definition at line 110 of file NodeAttr.h.

Referenced by CPN::Kernel::CreateNode(), CPN::VariantCPNLoader::LoadNode(), and CPN::RemoteContextClient::SendCreateNode().

110 { return name; }
std::string name
Definition: NodeAttr.h:121

+ Here is the caller graph for this function:

const std::map<std::string, std::string>& CPN::NodeAttr::GetParams ( ) const
inline

Definition at line 114 of file NodeAttr.h.

Referenced by CPN::RemoteContextClient::SendCreateNode().

114 { return params; }
std::map< std::string, std::string > params
Definition: NodeAttr.h:123

+ Here is the caller graph for this function:

const std::string& CPN::NodeAttr::GetTypeName ( ) const
inline

Definition at line 112 of file NodeAttr.h.

Referenced by CPN::Kernel::InternalCreateNode(), and CPN::RemoteContextClient::SendCreateNode().

112 { return nodetype; }
std::string nodetype
Definition: NodeAttr.h:122

+ Here is the caller graph for this function:

NodeAttr& CPN::NodeAttr::SetKernel ( const std::string &  kname)
inline

Definition at line 79 of file NodeAttr.h.

Referenced by CPN::VariantCPNLoader::LoadNode(), and CPN::MsgToNodeAttr().

79  {
80  kernelname = kname;
81  return *this;
82  }
std::string kernelname
Definition: NodeAttr.h:119

+ Here is the caller graph for this function:

NodeAttr& CPN::NodeAttr::SetKernelKey ( Key_t  k)
inline

Definition at line 84 of file NodeAttr.h.

Referenced by CPN::Kernel::CreateNode().

84  {
85  kernelkey = k;
86  return *this;
87  }
Key_t kernelkey
Definition: NodeAttr.h:120

+ Here is the caller graph for this function:

NodeAttr& CPN::NodeAttr::SetKey ( Key_t  key_)
inline

Definition at line 102 of file NodeAttr.h.

Referenced by CPN::Kernel::CreateNode(), and CPN::MsgToNodeAttr().

102  {
103  key = key_;
104  return *this;
105  }

+ Here is the caller graph for this function:

NodeAttr& CPN::NodeAttr::SetName ( const std::string &  name_)
inline

Definition at line 69 of file NodeAttr.h.

69  {
70  name = name_;
71  return *this;
72  }
std::string name
Definition: NodeAttr.h:121
NodeAttr& CPN::NodeAttr::SetParam ( const std::string &  key,
const std::string  value 
)
inline

Definition at line 89 of file NodeAttr.h.

Referenced by CPN::VariantCPNLoader::LoadNode(), and CPN::MsgToNodeAttr().

89  {
90  params[key] = value;
91  return *this;
92  }
std::map< std::string, std::string > params
Definition: NodeAttr.h:123

+ Here is the caller graph for this function:

template<typename T >
NodeAttr& CPN::NodeAttr::SetParam ( const std::string &  key,
value 
)
inline

Definition at line 95 of file NodeAttr.h.

95  {
96  std::ostringstream oss;
97  oss << value;
98  params[key] = oss.str();
99  return *this;
100  }
std::map< std::string, std::string > params
Definition: NodeAttr.h:123
NodeAttr& CPN::NodeAttr::SetTypeName ( const std::string &  nodetype_)
inline

Definition at line 74 of file NodeAttr.h.

74  {
75  nodetype = nodetype_;
76  return *this;
77  }
std::string nodetype
Definition: NodeAttr.h:122

Member Data Documentation

Key_t CPN::NodeAttr::kernelkey
private

Definition at line 120 of file NodeAttr.h.

std::string CPN::NodeAttr::kernelname
private

Definition at line 119 of file NodeAttr.h.

Key_t CPN::NodeAttr::key
private

Definition at line 124 of file NodeAttr.h.

std::string CPN::NodeAttr::name
private

Definition at line 121 of file NodeAttr.h.

std::string CPN::NodeAttr::nodetype
private

Definition at line 122 of file NodeAttr.h.

std::map<std::string, std::string> CPN::NodeAttr::params
private

Definition at line 123 of file NodeAttr.h.


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