|
CPN
Computational Process Networks
|
The definition common to all nodes in the process network. More...
#include <NodeBase.h>
Inheritance diagram for CPN::NodeBase:
Collaboration diagram for CPN::NodeBase:Public Member Functions | |
| NodeBase (Kernel &ker, const NodeAttr &attr) | |
| virtual | ~NodeBase () |
| const std::string & | GetTypeName () const |
| Kernel * | GetKernel () |
| Return a pointer to the kernel that his node is running under. More... | |
| std::string | GetParam (const std::string &key) const |
| bool | HasParam (const std::string &key) const |
| template<typename T > | |
| T | GetParam (const std::string &key) const |
| template<typename T > | |
| T | GetParam (const std::string &key, T def) const |
| void | Start () |
| For use by the CPN::Kernel to start the node. More... | |
| void | Shutdown () |
| Perform actions (like joining a thread) before destruction. More... | |
| bool | IsPurePseudo () |
| void | LogState () |
| For debugging ONLY! More... | |
| const std::string & | GetName () const |
| Key_t | GetKey () const |
| shared_ptr< QueueReader > | GetIQueue (const std::string &portname) |
| This method is for use by the user to aquire a reader endpoint. This function blocks until the CPN::Kernel hands this node the queue associated with the endpoint. More... | |
| shared_ptr< QueueWriter > | GetOQueue (const std::string &portname) |
| This method is for use by the user to aquire a writer endpoint. This function blocks until the CPN::Kernel hands this node the queue associated with the endpoint. More... | |
| void | CreateReader (shared_ptr< QueueBase > q) |
| for use by the CPN::Kernel to create a new read endpoint. More... | |
| void | CreateWriter (shared_ptr< QueueBase > q) |
| for use by the CPN::Kernel to create a new writer endpoint. More... | |
| void | NotifyTerminate () |
| Called by the kernel when it is shutting down. More... | |
Protected Member Functions | |
| virtual void | Process ()=0 |
| Override this method to implement a node. More... | |
Protected Attributes | |
| Kernel & | kernel |
| Logger | logger |
Private Member Functions | |
| void * | EntryPoint () |
Private Attributes | |
| const std::string | type |
| auto_ptr< Pthread > | thread |
| std::map< std::string, std::string > | params |
The definition common to all nodes in the process network.
A node is a thread of execution which lasts the lifetime of the node object.
Definition at line 69 of file NodeBase.h.
Definition at line 35 of file NodeBase.cc.
References CreatePthreadFunctional(), EntryPoint(), and thread.
Here is the call graph for this function:
|
virtual |
Definition at line 44 of file NodeBase.cc.
|
inherited |
for use by the CPN::Kernel to create a new read endpoint.
Definition at line 55 of file PseudoNode.cc.
References ASSERT, CPN::PseudoNode::cond, CPN::PseudoNode::d4rnode, CPN::PseudoNode::lock, CPN::PseudoNode::readermap, and Sync::ReentrantCondition::Signal().
Here is the call graph for this function:
|
inherited |
for use by the CPN::Kernel to create a new writer endpoint.
Definition at line 68 of file PseudoNode.cc.
References ASSERT, CPN::PseudoNode::cond, CPN::PseudoNode::d4rnode, CPN::PseudoNode::lock, Sync::ReentrantCondition::Signal(), and CPN::PseudoNode::writermap.
Here is the call graph for this function:
|
private |
Definition at line 72 of file NodeBase.cc.
References Logger::ERROR, CPN::Kernel::GetContext(), CPN::PseudoNode::GetKey(), CPN::PseudoNode::GetName(), Logger::Info(), kernel, CPN::PseudoNode::logger, Logger::Name(), CPN::Kernel::NodeTerminated(), Process(), and CPN::Kernel::SwallowBrokenQueueExceptions().
Referenced by NodeBase().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inherited |
This method is for use by the user to aquire a reader endpoint. This function blocks until the CPN::Kernel hands this node the queue associated with the endpoint.
| portname | the port name of the reader to get. |
Definition at line 43 of file PseudoNode.cc.
References CPN::PseudoNode::context, CPN::PseudoNode::GetReader(), and CPN::PseudoNode::nodekey.
Here is the call graph for this function:
|
inline |
Return a pointer to the kernel that his node is running under.
Definition at line 82 of file NodeBase.h.
|
inlineinherited |
Definition at line 43 of file PseudoNode.h.
Referenced by EntryPoint().
Here is the caller graph for this function:
|
inlineinherited |
Definition at line 40 of file PseudoNode.h.
Referenced by EntryPoint(), and GetParam().
Here is the caller graph for this function:
|
inherited |
This method is for use by the user to aquire a writer endpoint. This function blocks until the CPN::Kernel hands this node the queue associated with the endpoint.
| portname | the port name fo the writer to get. |
Definition at line 49 of file PseudoNode.cc.
References CPN::PseudoNode::context, CPN::PseudoNode::GetWriter(), and CPN::PseudoNode::nodekey.
Here is the call graph for this function:| std::string CPN::NodeBase::GetParam | ( | const std::string & | key | ) | const |
Definition at line 47 of file NodeBase.cc.
References CPN::PseudoNode::GetName(), and params.
Here is the call graph for this function:
|
inline |
Definition at line 89 of file NodeBase.h.
References CPN::NodeBasePrivate::CoerceParam< T >::Coerce().
Here is the call graph for this function:
|
inline |
Definition at line 94 of file NodeBase.h.
|
inline |
| bool CPN::NodeBase::HasParam | ( | const std::string & | key | ) | const |
|
virtual |
Reimplemented from CPN::PseudoNode.
Definition at line 93 of file NodeBase.cc.
|
virtual |
For debugging ONLY!
Reimplemented from CPN::PseudoNode.
Definition at line 97 of file NodeBase.cc.
References Logger::Error(), CPN::PseudoNode::logger, CPN::PseudoNode::LogState(), and thread.
Here is the call graph for this function:
|
inherited |
Called by the kernel when it is shutting down.
Definition at line 123 of file PseudoNode.cc.
References CPN::PseudoNode::cond, CPN::PseudoNode::lock, CPN::PseudoNode::readermap, Sync::ReentrantCondition::Signal(), and CPN::PseudoNode::writermap.
Here is the call graph for this function:
|
protectedpure virtual |
Override this method to implement a node.
Referenced by EntryPoint().
Here is the caller graph for this function:
|
virtual |
Perform actions (like joining a thread) before destruction.
Reimplemented from CPN::PseudoNode.
Definition at line 67 of file NodeBase.cc.
References CPN::PseudoNode::Shutdown(), and thread.
Here is the call graph for this function:| void CPN::NodeBase::Start | ( | ) |
For use by the CPN::Kernel to start the node.
Definition at line 63 of file NodeBase.cc.
References thread.
|
protected |
Definition at line 117 of file NodeBase.h.
Referenced by EntryPoint().
|
protectedinherited |
Definition at line 76 of file PseudoNode.h.
Referenced by EntryPoint(), CPN::PseudoNode::LogState(), and LogState().
|
private |
Definition at line 123 of file NodeBase.h.
Referenced by GetParam(), and HasParam().
|
private |
Definition at line 122 of file NodeBase.h.
Referenced by LogState(), NodeBase(), Shutdown(), and Start().
|
private |
Definition at line 121 of file NodeBase.h.
1.8.5