|
CPN
Computational Process Networks
|
#include <RemoteQueueHolder.h>
Collaboration diagram for CPN::RemoteQueueHolder:Public Types | |
| typedef std::map< Key_t, shared_ptr< RemoteQueueBase > > | QueueMap |
| typedef std::vector < shared_ptr< RemoteQueueBase > > | QueueList |
Public Member Functions | |
| void | AddQueue (shared_ptr< RemoteQueueBase > queue) |
| void | CleanupQueue (Key_t key) |
| void | Cleanup () |
| void | Shutdown () |
| WakeupHandle * | GetWakeup () |
Private Member Functions | |
| void | PrintState () |
Private Attributes | |
| QueueMap | queuemap |
| QueueList | queuelist |
| PthreadMutex | lock |
| PthreadCondition | cond |
| WakeupHandle | wakeup |
RemoteQueueHolder takes responsibility of holding references to the remote queues so that they can exist after the node has terminated. This is required because a node can terminate and the RemoteQueue has not finished sending all its data to the other side. This class also allows us to signal to the remote queues to shut down. Note that because closing a socket while selecting on that socket is a race condition and the only other good way of breaking out of the select is to also select on some other file, this holder provides a FileHandle that will cause select to return when shutting down.
Definition at line 47 of file RemoteQueueHolder.h.
| typedef std::vector<shared_ptr<RemoteQueueBase> > CPN::RemoteQueueHolder::QueueList |
Definition at line 50 of file RemoteQueueHolder.h.
| typedef std::map<Key_t, shared_ptr<RemoteQueueBase> > CPN::RemoteQueueHolder::QueueMap |
Definition at line 49 of file RemoteQueueHolder.h.
| void CPN::RemoteQueueHolder::AddQueue | ( | shared_ptr< RemoteQueueBase > | queue | ) |
Add a queue.
| queue | the queue to add |
Definition at line 29 of file RemoteQueueHolder.cc.
References lock, and queuemap.
| void CPN::RemoteQueueHolder::Cleanup | ( | ) |
Called by the kernel periodically to clean up queues that are done.
Definition at line 44 of file RemoteQueueHolder.cc.
References lock, queuelist, and AutoLock< Lockable >::Unlock().
Here is the call graph for this function:| void CPN::RemoteQueueHolder::CleanupQueue | ( | Key_t | key | ) |
Called by the RemoteQueue it self to say it has completed.
| key | the endpoint key for the queue |
Definition at line 34 of file RemoteQueueHolder.cc.
References cond, lock, queuelist, queuemap, and PthreadCondition::Signal().
Referenced by CPN::RemoteQueue::FileThreadEntryPoint().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
The WakeupHandle is used by all the RemoteQueues to break out of select when shutting down.
Definition at line 76 of file RemoteQueueHolder.h.
References wakeup.
Referenced by CPN::RemoteQueue::FileThreadEntryPoint().
Here is the caller graph for this function:
|
private |
| void CPN::RemoteQueueHolder::Shutdown | ( | ) |
Call shutdown on each queue and cause the WakeupHandle to make select return.
Definition at line 52 of file RemoteQueueHolder.cc.
References cond, lock, queuelist, queuemap, WakeupHandle::SendWakeup(), PthreadCondition::Wait(), and wakeup.
Here is the call graph for this function:
|
private |
Definition at line 82 of file RemoteQueueHolder.h.
Referenced by CleanupQueue(), and Shutdown().
|
private |
Definition at line 81 of file RemoteQueueHolder.h.
Referenced by AddQueue(), Cleanup(), CleanupQueue(), and Shutdown().
|
private |
Definition at line 80 of file RemoteQueueHolder.h.
Referenced by Cleanup(), CleanupQueue(), PrintState(), and Shutdown().
|
private |
Definition at line 79 of file RemoteQueueHolder.h.
Referenced by AddQueue(), CleanupQueue(), PrintState(), and Shutdown().
|
private |
Definition at line 83 of file RemoteQueueHolder.h.
Referenced by GetWakeup(), and Shutdown().
1.8.5