25 #ifndef CPN_QUEUEATTR_H
26 #define CPN_QUEUEATTR_H
58 : queuehint(), datatype(
TypeName<void>()),
59 queueLength(0), maxThreshold(0),
60 numChannels(1), alpha(0.5),
61 readerkey(0), writerkey(0), readernodekey(0), writernodekey(0),
66 const unsigned maxThreshold_)
67 : queuehint(), datatype(
TypeName<void>()),
68 queueLength(queueLength_), maxThreshold(maxThreshold_),
69 numChannels(1), alpha(0.5),
70 readerkey(0), writerkey(0), readernodekey(0), writernodekey(0),
82 else if (a > 1) { a = 1; }
88 maxwritethreshold = mwt;
98 const std::string &writernode,
const std::string &writerport) {
99 SetReader(readernode, readerport);
100 SetWriter(writernode, writerport);
105 return SetReader(readername, readername);
109 return SetWriter(writername, writername);
113 const std::string &portname) {
114 readernodename = nodename;
115 readerportname = portname;
120 const std::string &portname) {
121 readernodekey = nodekey;
122 readerportname = portname;
127 const std::string &portname) {
128 writernodename = nodename;
129 writerportname = portname;
134 const std::string &portname) {
135 writernodekey = nodekey;
136 writerportname = portname;
156 template<
typename type>
158 datatype = TypeName<type>();
163 queueLength = length;
168 maxThreshold = maxthresh;
173 numChannels = channels;
208 std::string
GetHint()
const {
return queuehint; }
211 const std::string &
GetName()
const {
return queuename; }
279 template<
typename type>
unsigned GetLength() const
QueueAttr & SetDatatype()
SimpleQueueAttr & SetHint(std::string hint)
QueueAttr & SetLength(unsigned length)
QueueAttr & SetExternalReader(const std::string &readername)
QueueAttr & SetNumChannels(unsigned channels)
unsigned GetNumChannels() const
Key_t GetWriterKey() const
SimpleQueueAttr & SetDatatype()
Key_t GetWriterKey() const
SimpleQueueAttr & SetReaderNodeKey(Key_t k)
SimpleQueueAttr & SetMaxWriteThreshold(unsigned mwt)
const std::string & GetDatatype() const
std::string GetHint() const
QueueAttr(const unsigned queueLength_, const unsigned maxThreshold_)
std::string readernodename
unsigned GetMaxThreshold() const
QueueAttr & SetMaxWriteThreshold(unsigned mwt)
QueueAttr & SetWriter(Key_t nodekey, const std::string &portname)
QueueAttr & SetAlpha(double a)
alpha is used by the remote queue to decide how much of the queue should go on the read side and how ...
const std::string & GetReaderPort() const
SimpleQueueAttr & SetNumChannels(unsigned numchans)
unsigned GetNumChannels() const
SimpleQueueAttr & SetLength(unsigned length)
QueueAttr & SetReader(Key_t nodekey, const std::string &portname)
unsigned GetLength() const
SimpleQueueAttr & SetAlpha(double a)
QueueAttr & SetDatatype(const std::string &type)
std::string writerportname
const std::string & GetWriterNode() const
unsigned GetMaxThreshold() const
QueueAttr & SetExternalWriter(const std::string &writername)
std::string readerportname
QueueAttr & SetReaderKey(Key_t k)
unsigned GetMaxWriteThreshold() const
QueueAttr & SetEndpoints(const std::string &readernode, const std::string &readerport, const std::string &writernode, const std::string &writerport)
const std::string & GetName() const
QueueAttr & SetReader(const std::string &nodename, const std::string &portname)
Key_t GetReaderKey() const
SimpleQueueAttr(const QueueAttr &attr)
std::string writernodename
QueueAttr & SetWriterKey(Key_t k)
QueueAttr & SetMaxThreshold(unsigned maxthresh)
QueueAttr & SetWriter(const std::string &nodename, const std::string &portname)
const std::string & GetWriterPort() const
Key_t GetReaderKey() const
SimpleQueueAttr & SetWriterNodeKey(Key_t k)
Key_t GetWriterNodeKey() const
QueueAttr & SetReaderNodeKey(Key_t k)
unsigned maxwritethreshold
QueueAttr & SetHint(std::string hint)
const std::string & GetDatatype() const
const std::string & GetReaderNode() const
The attributes for a queue.
SimpleQueueAttr & SetWriterKey(Key_t k)
unsigned GetMaxWriteThreshold() const
SimpleQueueAttr & SetDatatype(const std::string &type)
Key_t GetReaderNodeKey() const
std::string GetHint() const
SimpleQueueAttr & SetMaxThreshold(unsigned maxthresh)
This is a simplified internal representation of the queue attributes needed to create a queue...
QueueAttr & SetName(const std::string &qname)
unsigned maxwritethreshold
QueueAttr & SetWriterNodeKey(Key_t k)
Key_t GetWriterNodeKey() const
Key_t GetReaderNodeKey() const
SimpleQueueAttr & SetReaderKey(Key_t k)
Defintions of and helper functions for queue datatypes.