|
CPN
Computational Process Networks
|
#include <D4RNode.h>
Collaboration diagram for D4R::Node:Public Member Functions | |
| Node (uint64_t key) | |
| ~Node () | |
| Tag | GetPublicTag () const |
| void | SetPublicTag (const Tag &t) |
| Tag | GetPrivateTag () const |
| void | SetPrivateTag (const Tag &t) |
| void | AddReader (weak_ptr< QueueBase > q) |
| void | AddWriter (weak_ptr< QueueBase > q) |
| void | Block (const Tag &t, unsigned qsize) |
| bool | Transmit (const Tag &t) |
Protected Member Functions | |
| void | SignalTagChanged () |
Protected Attributes | |
| Tag | publicTag |
| Tag | privateTag |
| PthreadMutex | taglock |
| std::list< weak_ptr< QueueBase > > | readerlist |
| std::list< weak_ptr< QueueBase > > | writerlist |
Private Member Functions | |
| Node (const Node &) | |
| Node & | operator= (const Node &) |
The node for the D4R algorithm.
Each node has a list of readers and writers. When an action that changes the Tag happens these readers and writers are notified. Note that SetPrivateTag and SetPublicTag do not notify the readers and writers.
| D4R::Node::Node | ( | uint64_t | key | ) |
Definition at line 38 of file D4RNode.cc.
| D4R::Node::~Node | ( | ) |
Definition at line 44 of file D4RNode.cc.
|
private |
| void D4R::Node::AddReader | ( | weak_ptr< QueueBase > | q | ) |
| q | add the q to the readers. |
Definition at line 107 of file D4RNode.cc.
References readerlist, and taglock.
| void D4R::Node::AddWriter | ( | weak_ptr< QueueBase > | q | ) |
| q | Add the q to the writers. |
Definition at line 111 of file D4RNode.cc.
References taglock, and writerlist.
| void D4R::Node::Block | ( | const Tag & | t, |
| unsigned | qsize | ||
| ) |
Perform the block operation. Note the caller cannot be holding any queue locks.
| t | The tag of the node we are blocking on |
| qsize | The size of the queue if we are blocking on write or -1 if we are blocking on read. |
Definition at line 66 of file D4RNode.cc.
References D4R::Tag::Count(), DEBUG, D4R::Tag::Key(), privateTag, publicTag, D4R::Tag::QueueSize(), SignalTagChanged(), taglock, and AutoLock< Lockable >::Unlock().
Here is the call graph for this function:| Tag D4R::Node::GetPrivateTag | ( | ) | const |
Definition at line 56 of file D4RNode.cc.
References privateTag, and taglock.
| Tag D4R::Node::GetPublicTag | ( | ) | const |
Definition at line 46 of file D4RNode.cc.
References publicTag, and taglock.
| void D4R::Node::SetPrivateTag | ( | const Tag & | t | ) |
Definition at line 61 of file D4RNode.cc.
References privateTag, and taglock.
| void D4R::Node::SetPublicTag | ( | const Tag & | t | ) |
Definition at line 51 of file D4RNode.cc.
References publicTag, and taglock.
|
protected |
Definition at line 140 of file D4RNode.cc.
References D4R::GetQueues(), readerlist, D4R::SignalReader(), D4R::SignalWriter(), taglock, and writerlist.
Referenced by Block(), and Transmit().
Here is the call graph for this function:
Here is the caller graph for this function:Called by the queue when the Tag on the node we are blocked on changes. Note the caller cannot be holding any queue locks.
| t | The new tag. |
Definition at line 76 of file D4RNode.cc.
References D4R::Tag::Count(), DEBUG, D4R::Tag::Key(), D4R::Tag::Priority(), privateTag, publicTag, D4R::Tag::QueueKey(), D4R::Tag::QueueSize(), SignalTagChanged(), taglock, and AutoLock< Lockable >::Unlock().
Here is the call graph for this function:
|
protected |
Definition at line 127 of file D4RNode.h.
Referenced by Block(), GetPrivateTag(), SetPrivateTag(), and Transmit().
|
protected |
Definition at line 126 of file D4RNode.h.
Referenced by Block(), GetPublicTag(), SetPublicTag(), and Transmit().
|
protected |
Definition at line 129 of file D4RNode.h.
Referenced by AddReader(), and SignalTagChanged().
|
mutableprotected |
Definition at line 128 of file D4RNode.h.
Referenced by AddReader(), AddWriter(), Block(), GetPrivateTag(), GetPublicTag(), SetPrivateTag(), SetPublicTag(), SignalTagChanged(), and Transmit().
|
protected |
Definition at line 130 of file D4RNode.h.
Referenced by AddWriter(), and SignalTagChanged().
1.8.5