|
CPN
Computational Process Networks
|
the server for the remote context. More...
#include <RemoteContextServer.h>
Inheritance diagram for CPN::RemoteContextServer:
Collaboration diagram for CPN::RemoteContextServer:Public Member Functions | |
| RemoteContextServer () | |
| virtual | ~RemoteContextServer () |
| virtual void | Terminate () |
| bool | IsTerminated () const |
| int | DebugLevel () const |
| int | DebugLevel (int level) |
Protected Member Functions | |
| void | DispatchMessage (const std::string &sender, const Variant &msg) |
| Process the given message. More... | |
| virtual void | SendMessage (const std::string &recipient, const Variant &msg)=0 |
| Send the given message to the given client. More... | |
| virtual void | BroadcastMessage (const Variant &msg)=0 |
| Broadcast a message to all clients. More... | |
| virtual void | LogMessage (const std::string &msg)=0 |
| Log a message. More... | |
| void | dbprintf (int level, const char *fmt,...) |
Private Types | |
| typedef std::map< Key_t, Variant > | DataMap |
| typedef std::map< std::string, Key_t > | NameKeyMap |
Private Member Functions | |
| void | SetupKernel (const std::string &sender, const Variant &msg) |
| void | SignalKernelStart (const Variant &msg) |
| void | SignalKernelEnd (const Variant &msg) |
| void | GetKernelInfo (const std::string &sender, const Variant &msg) |
| void | CreateNodeKey (const std::string &sender, const Variant &msg) |
| void | SignalNodeStart (const Variant &msg) |
| void | SignalNodeEnd (const Variant &msg) |
| void | GetNodeInfo (const std::string &sender, const Variant &msg) |
| void | GetNumNodeLive (const std::string &sender, const Variant &msg) |
| void | GetCreateEndpointKey (const std::string &sender, const Variant &msg) |
| void | GetEndpointInfo (const std::string &sender, const Variant &msg) |
| void | ConnectEndpoints (const Variant &msg) |
| Key_t | NewKey () |
| void | RouteKernelMessage (const Variant &msg) |
| Variant | NewBroadcastMessage () |
Private Attributes | |
| DataMap | datamap |
| NameKeyMap | kernelmap |
| NameKeyMap | nodemap |
| int | debuglevel |
| bool | shutdown |
| unsigned | numlivenodes |
| Key_t | keycount |
the server for the remote context.
Implementors only need to override SendMessage, BroadcastMessage, and LogMessage. then call DispatchMessage for all messages from the clients.
Definition at line 114 of file RemoteContextServer.h.
|
private |
Definition at line 170 of file RemoteContextServer.h.
|
private |
Definition at line 172 of file RemoteContextServer.h.
| CPN::RemoteContextServer::RemoteContextServer | ( | ) |
Definition at line 32 of file RemoteContextServer.cc.
|
virtual |
Definition at line 37 of file RemoteContextServer.cc.
|
protectedpure virtual |
Broadcast a message to all clients.
| msg | the message to send to all clients |
Implemented in CPN::RemoteContextDaemon.
Referenced by SignalKernelEnd(), SignalKernelStart(), SignalNodeEnd(), SignalNodeStart(), and Terminate().
Here is the caller graph for this function:
|
private |
Definition at line 331 of file RemoteContextServer.cc.
References datamap.
Referenced by DispatchMessage().
Here is the caller graph for this function:
|
private |
Definition at line 197 of file RemoteContextServer.cc.
References datamap, dbprintf(), NewKey(), nodemap, and SendMessage().
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protected |
Definition at line 40 of file RemoteContextServer.cc.
References debuglevel.
Referenced by CPN::RemoteContextDaemon::BroadcastMessage(), CPN::RemoteContextDaemon::Client::Client(), CreateNodeKey(), DispatchMessage(), CPN::RemoteContextDaemon::LogMessage(), CPN::RemoteContextDaemon::Run(), CPN::RemoteContextDaemon::SendMessage(), SetupKernel(), SignalKernelEnd(), SignalKernelStart(), SignalNodeEnd(), SignalNodeStart(), and CPN::RemoteContextDaemon::Terminate().
Here is the caller graph for this function:
|
inline |
|
protected |
Process the given message.
| sender | a string id for the client |
| msg | the message that the client sent |
Definition at line 49 of file RemoteContextServer.cc.
References ASSERT, ConnectEndpoints(), CreateNodeKey(), dbprintf(), GetCreateEndpointKey(), GetEndpointInfo(), GetKernelInfo(), GetNodeInfo(), GetNumNodeLive(), IsTerminated(), LogMessage(), CPN::RCTXMT_CONNECT_ENDPOINTS, CPN::RCTXMT_CREATE_NODE, CPN::RCTXMT_CREATE_NODE_KEY, CPN::RCTXMT_CREATE_QUEUE, CPN::RCTXMT_CREATE_READER, CPN::RCTXMT_CREATE_WRITER, CPN::RCTXMT_GET_CREATE_READER_KEY, CPN::RCTXMT_GET_CREATE_WRITER_KEY, CPN::RCTXMT_GET_KERNEL_INFO, CPN::RCTXMT_GET_NODE_INFO, CPN::RCTXMT_GET_NUM_NODE_LIVE, CPN::RCTXMT_GET_READER_INFO, CPN::RCTXMT_GET_WRITER_INFO, CPN::RCTXMT_LOG, CPN::RCTXMT_SETUP_KERNEL, CPN::RCTXMT_SIGNAL_KERNEL_END, CPN::RCTXMT_SIGNAL_KERNEL_START, CPN::RCTXMT_SIGNAL_NODE_END, CPN::RCTXMT_SIGNAL_NODE_START, CPN::RCTXMT_TERMINATE, RouteKernelMessage(), SetupKernel(), SignalKernelEnd(), SignalKernelStart(), SignalNodeEnd(), SignalNodeStart(), and Terminate().
Here is the call graph for this function:
|
private |
Definition at line 281 of file RemoteContextServer.cc.
References ASSERT, datamap, NewKey(), and SendMessage().
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 315 of file RemoteContextServer.cc.
References ASSERT, datamap, and SendMessage().
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 172 of file RemoteContextServer.cc.
References ASSERT, datamap, kernelmap, and SendMessage().
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 247 of file RemoteContextServer.cc.
References ASSERT, datamap, nodemap, and SendMessage().
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 272 of file RemoteContextServer.cc.
References numlivenodes, and SendMessage().
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 125 of file RemoteContextServer.h.
References shutdown.
Referenced by CPN::RemoteContextDaemon::BroadcastMessage(), DispatchMessage(), CPN::RemoteContextDaemon::Run(), CPN::RemoteContextDaemon::SendMessage(), and CPN::RemoteContextDaemon::Terminate().
Here is the caller graph for this function:
|
protectedpure virtual |
Log a message.
| msg | the message to be logged |
Implemented in CPN::RemoteContextDaemon.
Referenced by DispatchMessage().
Here is the caller graph for this function:
|
private |
Definition at line 352 of file RemoteContextServer.cc.
References numlivenodes.
Referenced by SignalKernelEnd(), SignalKernelStart(), SignalNodeEnd(), and SignalNodeStart().
Here is the caller graph for this function:
|
private |
Definition at line 341 of file RemoteContextServer.cc.
References keycount.
Referenced by CreateNodeKey(), GetCreateEndpointKey(), and SetupKernel().
Here is the caller graph for this function:
|
private |
Definition at line 346 of file RemoteContextServer.cc.
References datamap, and SendMessage().
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
protectedpure virtual |
Send the given message to the given client.
| recipient | the id (previously used in DispatchMessage sender) |
| msg | the message to be sent to the client |
Implemented in CPN::RemoteContextDaemon.
Referenced by CreateNodeKey(), GetCreateEndpointKey(), GetEndpointInfo(), GetKernelInfo(), GetNodeInfo(), GetNumNodeLive(), RouteKernelMessage(), and SetupKernel().
Here is the caller graph for this function:
|
private |
Definition at line 123 of file RemoteContextServer.cc.
References datamap, dbprintf(), kernelmap, NewKey(), and SendMessage().
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 161 of file RemoteContextServer.cc.
References ASSERT, BroadcastMessage(), datamap, dbprintf(), and NewBroadcastMessage().
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 150 of file RemoteContextServer.cc.
References ASSERT, BroadcastMessage(), datamap, dbprintf(), and NewBroadcastMessage().
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 235 of file RemoteContextServer.cc.
References ASSERT, BroadcastMessage(), datamap, dbprintf(), NewBroadcastMessage(), and numlivenodes.
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 223 of file RemoteContextServer.cc.
References ASSERT, BroadcastMessage(), datamap, dbprintf(), NewBroadcastMessage(), and numlivenodes.
Referenced by DispatchMessage().
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Cause the context to go into the shutdown state.
Reimplemented in CPN::RemoteContextDaemon.
Definition at line 116 of file RemoteContextServer.cc.
References BroadcastMessage(), CPN::RCTXMT_TERMINATE, and shutdown.
Referenced by DispatchMessage(), and CPN::RemoteContextDaemon::Terminate().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 171 of file RemoteContextServer.h.
Referenced by ConnectEndpoints(), CreateNodeKey(), GetCreateEndpointKey(), GetEndpointInfo(), GetKernelInfo(), GetNodeInfo(), RouteKernelMessage(), SetupKernel(), SignalKernelEnd(), SignalKernelStart(), SignalNodeEnd(), and SignalNodeStart().
|
private |
Definition at line 176 of file RemoteContextServer.h.
Referenced by dbprintf(), and DebugLevel().
|
private |
Definition at line 173 of file RemoteContextServer.h.
Referenced by GetKernelInfo(), and SetupKernel().
|
private |
Definition at line 180 of file RemoteContextServer.h.
Referenced by NewKey().
|
private |
Definition at line 174 of file RemoteContextServer.h.
Referenced by CreateNodeKey(), and GetNodeInfo().
|
private |
Definition at line 178 of file RemoteContextServer.h.
Referenced by GetNumNodeLive(), NewBroadcastMessage(), SignalNodeEnd(), and SignalNodeStart().
|
private |
Definition at line 177 of file RemoteContextServer.h.
Referenced by IsTerminated(), and Terminate().
1.8.5