|
Open Model Railroad Network (OpenMRN)
|
A single service class that is shared between all interconnected DirectHub instances. More...
Public Types | |
| typedef Q | QueueType |
Public Member Functions | |
| DirectHubService (ExecutorBase *e) | |
| Atomic * | lock () |
| void | enqueue_caller (Executable *caller) |
| Adds a caller to the waiting list of who wants to send traffic to the hub. | |
| void | on_done () |
| This function must be called at the end of the enqueued functions in order to properly clear the busy flag or take out the next enqueued executable. | |
Public Member Functions inherited from Service | |
| Service (ExecutorBase *e) | |
| Constructor. | |
| ~Service () | |
| Destructor. | |
| ExecutorBase * | executor () |
Public Attributes | |
| unsigned | busy_: 1 |
| 1 if there is any message being processed right now. | |
| QueueType | pendingSend_ |
| List of callers that are waiting for the busy_ lock. | |
A single service class that is shared between all interconnected DirectHub instances.
It is the responsibility of this Service to perform the locking of the individual flows.
Definition at line 66 of file DirectHub.cxx.
| typedef Q DirectHubService::QueueType |
Definition at line 69 of file DirectHub.cxx.
|
inline |
Definition at line 71 of file DirectHub.cxx.
|
inline |
Adds a caller to the waiting list of who wants to send traffic to the hub.
If there is no waiting list, the caller will be executed inline.
| caller | represents an entry point to the hub. It is required that caller finishes its run() by invoking on_done(). |
Definition at line 87 of file DirectHub.cxx.
|
inline |
Definition at line 78 of file DirectHub.cxx.
|
inline |
This function must be called at the end of the enqueued functions in order to properly clear the busy flag or take out the next enqueued executable.
Definition at line 118 of file DirectHub.cxx.
| unsigned DirectHubService::busy_ |
1 if there is any message being processed right now.
Definition at line 136 of file DirectHub.cxx.
| QueueType DirectHubService::pendingSend_ |
List of callers that are waiting for the busy_ lock.
Definition at line 138 of file DirectHub.cxx.