24 #include "common_priv.h"
36 :
PseudoNode(attr.GetName(), attr.GetKey(), ker.GetContext()),
38 type(attr.GetTypeName()),
39 params(attr.GetParams())
48 std::map<std::string, std::string>::const_iterator entry =
50 if (entry ==
params.end()) {
51 throw std::invalid_argument(
"Required parameter \"" + key +
"\" missing"
52 " for node \"" +
GetName() +
"\"");
58 std::map<std::string, std::string>::const_iterator entry =
60 return entry !=
params.end();
99 logger.
Error(
"Thread id: %llu, %s", (
unsigned long long)((pthread_t)(*
thread.get())),
100 (
thread->Done() ?
"done" :
"running"));
Logger object that is used for forwarding log messages.
shared_ptr< Context > GetContext() const
The base definition of all nodes.
void LogState()
For debugging ONLY!
Definition for the kernel object.
virtual void LogState()
For debugging ONLY!
The Context abstract data type.
The exception thrown when true deadlock is detected.
void Error(const char *fmt,...)
An exception indicating that the node tried to write to a shutdown queue.
virtual void Shutdown()
Perform actions (like joining a thread) before destruction.
The exceptions specified for the CPN network.
void Info(const char *fmt,...)
bool SwallowBrokenQueueExceptions()
Whether the node should by default swallow the broken queue exceptions or let them propigate as an er...
const std::string & Name() const
PthreadFunctional * CreatePthreadFunctional(T *obj, void *(T::*meth)(void))
void NodeTerminated(Key_t key)
Called by the node in the cleanup routine. TO BE CALLED ONLY BY THE CPN INTERNALS.
const std::string & GetName() const
void Start()
For use by the CPN::Kernel to start the node.
An exception indicating that the Kernel has shut down.
void Shutdown()
Perform actions (like joining a thread) before destruction.
std::map< std::string, std::string > params
virtual void Process()=0
Override this method to implement a node.
std::string GetParam(const std::string &key) const
An exception thrown when a true deadlock is detected.
auto_ptr< Pthread > thread
NodeBase(Kernel &ker, const NodeAttr &attr)
bool HasParam(const std::string &key) const