CPN
Computational Process Networks
Public Member Functions | Private Attributes | List of all members
CPN::QueueAttr Class Reference

The attributes for a queue. More...

#include <QueueAttr.h>

+ Collaboration diagram for CPN::QueueAttr:

Public Member Functions

 QueueAttr ()
 
 QueueAttr (const unsigned queueLength_, const unsigned maxThreshold_)
 
QueueAttrSetAlpha (double a)
 alpha is used by the remote queue to decide how much of the queue should go on the read side and how much should go on the write side. More...
 
QueueAttrSetMaxWriteThreshold (unsigned mwt)
 
QueueAttrSetName (const std::string &qname)
 
QueueAttrSetEndpoints (const std::string &readernode, const std::string &readerport, const std::string &writernode, const std::string &writerport)
 
QueueAttrSetExternalReader (const std::string &readername)
 
QueueAttrSetExternalWriter (const std::string &writername)
 
QueueAttrSetReader (const std::string &nodename, const std::string &portname)
 
QueueAttrSetReader (Key_t nodekey, const std::string &portname)
 
QueueAttrSetWriter (const std::string &nodename, const std::string &portname)
 
QueueAttrSetWriter (Key_t nodekey, const std::string &portname)
 
QueueAttrSetHint (std::string hint)
 
QueueAttrSetDatatype (const std::string &type)
 
template<typename type >
QueueAttrSetDatatype ()
 
QueueAttrSetLength (unsigned length)
 
QueueAttrSetMaxThreshold (unsigned maxthresh)
 
QueueAttrSetNumChannels (unsigned channels)
 
QueueAttrSetReaderNodeKey (Key_t k)
 
QueueAttrSetWriterNodeKey (Key_t k)
 
QueueAttrSetReaderKey (Key_t k)
 
QueueAttrSetWriterKey (Key_t k)
 
const std::string & GetWriterNode () const
 
const std::string & GetWriterPort () const
 
const std::string & GetReaderNode () const
 
const std::string & GetReaderPort () const
 
Key_t GetWriterNodeKey () const
 
Key_t GetReaderNodeKey () const
 
Key_t GetWriterKey () const
 
Key_t GetReaderKey () const
 
unsigned GetLength () const
 
unsigned GetMaxThreshold () const
 
unsigned GetNumChannels () const
 
std::string GetHint () const
 
const std::string & GetDatatype () const
 
double GetAlpha () const
 
const std::string & GetName () const
 
unsigned GetMaxWriteThreshold () const
 

Private Attributes

std::string queuehint
 
std::string datatype
 
std::string queuename
 
unsigned queueLength
 
unsigned maxThreshold
 
unsigned numChannels
 
double alpha
 
std::string readernodename
 
std::string readerportname
 
std::string writernodename
 
std::string writerportname
 
Key_t readerkey
 
Key_t writerkey
 
Key_t readernodekey
 
Key_t writernodekey
 
unsigned maxwritethreshold
 

Detailed Description

The attributes for a queue.

The QueueAttr is used to encapsulate the information needed by the Kernel to create a new connection between endpoints.

The QueueAttr must have a writer and reader endpoint defined or an exception will be thrown by the Kernel when attempting to create the queue.

There are three ways to set the reader and writer endpoints. The first is to ask the context for the key for the endpoints and set them directly. The second is if you know the node keys then you can set the node keys and endpoint names. The third is to set the endpoints using both the node name and the endpoint names. The keys are always used over the name, but the name is used if the key is not set.

The default queue length and max threshold is zero.

The default number of channels is one.

The default queue hint is to not use the ThresholdQueue see SetHint

Definition at line 55 of file QueueAttr.h.

Constructor & Destructor Documentation

CPN::QueueAttr::QueueAttr ( )
inline

Definition at line 57 of file QueueAttr.h.

58  : queuehint(), datatype(TypeName<void>()),
60  numChannels(1), alpha(0.5),
63  {}
unsigned queueLength
Definition: QueueAttr.h:218
unsigned numChannels
Definition: QueueAttr.h:220
unsigned maxThreshold
Definition: QueueAttr.h:219
std::string queuehint
Definition: QueueAttr.h:215
Key_t readerkey
Definition: QueueAttr.h:226
double alpha
Definition: QueueAttr.h:221
Key_t writernodekey
Definition: QueueAttr.h:229
std::string datatype
Definition: QueueAttr.h:216
Key_t writerkey
Definition: QueueAttr.h:227
Key_t readernodekey
Definition: QueueAttr.h:228
unsigned maxwritethreshold
Definition: QueueAttr.h:230
CPN::QueueAttr::QueueAttr ( const unsigned  queueLength_,
const unsigned  maxThreshold_ 
)
inline

Definition at line 65 of file QueueAttr.h.

67  : queuehint(), datatype(TypeName<void>()),
68  queueLength(queueLength_), maxThreshold(maxThreshold_),
69  numChannels(1), alpha(0.5),
72  {}
unsigned queueLength
Definition: QueueAttr.h:218
unsigned numChannels
Definition: QueueAttr.h:220
unsigned maxThreshold
Definition: QueueAttr.h:219
std::string queuehint
Definition: QueueAttr.h:215
Key_t readerkey
Definition: QueueAttr.h:226
double alpha
Definition: QueueAttr.h:221
Key_t writernodekey
Definition: QueueAttr.h:229
std::string datatype
Definition: QueueAttr.h:216
Key_t writerkey
Definition: QueueAttr.h:227
Key_t readernodekey
Definition: QueueAttr.h:228
unsigned maxwritethreshold
Definition: QueueAttr.h:230

Member Function Documentation

double CPN::QueueAttr::GetAlpha ( ) const
inline

Definition at line 210 of file QueueAttr.h.

210 { return alpha; }
double alpha
Definition: QueueAttr.h:221
const std::string& CPN::QueueAttr::GetDatatype ( ) const
inline

Definition at line 209 of file QueueAttr.h.

209 { return datatype; }
std::string datatype
Definition: QueueAttr.h:216
std::string CPN::QueueAttr::GetHint ( ) const
inline

Definition at line 208 of file QueueAttr.h.

208 { return queuehint; }
std::string queuehint
Definition: QueueAttr.h:215
unsigned CPN::QueueAttr::GetLength ( ) const
inline

Definition at line 205 of file QueueAttr.h.

205 { return queueLength; }
unsigned queueLength
Definition: QueueAttr.h:218
unsigned CPN::QueueAttr::GetMaxThreshold ( ) const
inline

Definition at line 206 of file QueueAttr.h.

206 { return maxThreshold; }
unsigned maxThreshold
Definition: QueueAttr.h:219
unsigned CPN::QueueAttr::GetMaxWriteThreshold ( ) const
inline

Definition at line 212 of file QueueAttr.h.

212 { return maxwritethreshold; }
unsigned maxwritethreshold
Definition: QueueAttr.h:230
const std::string& CPN::QueueAttr::GetName ( void  ) const
inline

Definition at line 211 of file QueueAttr.h.

Referenced by CPN::Kernel::CreateQueue().

211 { return queuename; }
std::string queuename
Definition: QueueAttr.h:217

+ Here is the caller graph for this function:

unsigned CPN::QueueAttr::GetNumChannels ( ) const
inline

Definition at line 207 of file QueueAttr.h.

207 { return numChannels; }
unsigned numChannels
Definition: QueueAttr.h:220
Key_t CPN::QueueAttr::GetReaderKey ( ) const
inline

Definition at line 204 of file QueueAttr.h.

204 { return readerkey; }
Key_t readerkey
Definition: QueueAttr.h:226
const std::string& CPN::QueueAttr::GetReaderNode ( ) const
inline

Definition at line 199 of file QueueAttr.h.

Referenced by CPN::Kernel::CreateQueue().

199 { return readernodename; }
std::string readernodename
Definition: QueueAttr.h:222

+ Here is the caller graph for this function:

Key_t CPN::QueueAttr::GetReaderNodeKey ( ) const
inline

Definition at line 202 of file QueueAttr.h.

202 { return readernodekey; }
Key_t readernodekey
Definition: QueueAttr.h:228
const std::string& CPN::QueueAttr::GetReaderPort ( ) const
inline

Definition at line 200 of file QueueAttr.h.

Referenced by CPN::Kernel::CreateQueue().

200 { return readerportname; }
std::string readerportname
Definition: QueueAttr.h:223

+ Here is the caller graph for this function:

Key_t CPN::QueueAttr::GetWriterKey ( ) const
inline

Definition at line 203 of file QueueAttr.h.

203 { return writerkey; }
Key_t writerkey
Definition: QueueAttr.h:227
const std::string& CPN::QueueAttr::GetWriterNode ( ) const
inline

Definition at line 197 of file QueueAttr.h.

Referenced by CPN::Kernel::CreateQueue().

197 { return writernodename; }
std::string writernodename
Definition: QueueAttr.h:224

+ Here is the caller graph for this function:

Key_t CPN::QueueAttr::GetWriterNodeKey ( ) const
inline

Definition at line 201 of file QueueAttr.h.

201 { return writernodekey; }
Key_t writernodekey
Definition: QueueAttr.h:229
const std::string& CPN::QueueAttr::GetWriterPort ( ) const
inline

Definition at line 198 of file QueueAttr.h.

Referenced by CPN::Kernel::CreateQueue().

198 { return writerportname; }
std::string writerportname
Definition: QueueAttr.h:225

+ Here is the caller graph for this function:

QueueAttr& CPN::QueueAttr::SetAlpha ( double  a)
inline

alpha is used by the remote queue to decide how much of the queue should go on the read side and how much should go on the write side.

Parameters
a0 means all on read 1 means all on write
Returns
this

Definition at line 80 of file QueueAttr.h.

Referenced by CPN::VariantCPNLoader::LoadQueue().

80  {
81  if (a < 0) { a = 0; }
82  else if (a > 1) { a = 1; }
83  alpha = a;
84  return *this;
85  }
double alpha
Definition: QueueAttr.h:221

+ Here is the caller graph for this function:

QueueAttr& CPN::QueueAttr::SetDatatype ( const std::string &  type)
inline

Definition at line 151 of file QueueAttr.h.

Referenced by CPN::VariantCPNLoader::LoadQueue().

151  {
152  datatype = type;
153  return *this;
154  }
std::string datatype
Definition: QueueAttr.h:216

+ Here is the caller graph for this function:

template<typename type >
QueueAttr& CPN::QueueAttr::SetDatatype ( )
inline

Definition at line 157 of file QueueAttr.h.

157  {
158  datatype = TypeName<type>();
159  return *this;
160  }
std::string datatype
Definition: QueueAttr.h:216
QueueAttr& CPN::QueueAttr::SetEndpoints ( const std::string &  readernode,
const std::string &  readerport,
const std::string &  writernode,
const std::string &  writerport 
)
inline

Definition at line 97 of file QueueAttr.h.

98  {
99  SetReader(readernode, readerport);
100  SetWriter(writernode, writerport);
101  return *this;
102  }
QueueAttr & SetReader(const std::string &nodename, const std::string &portname)
Definition: QueueAttr.h:112
QueueAttr & SetWriter(const std::string &nodename, const std::string &portname)
Definition: QueueAttr.h:126
QueueAttr& CPN::QueueAttr::SetExternalReader ( const std::string &  readername)
inline

Definition at line 104 of file QueueAttr.h.

104  {
105  return SetReader(readername, readername);
106  }
QueueAttr & SetReader(const std::string &nodename, const std::string &portname)
Definition: QueueAttr.h:112
QueueAttr& CPN::QueueAttr::SetExternalWriter ( const std::string &  writername)
inline

Definition at line 108 of file QueueAttr.h.

108  {
109  return SetWriter(writername, writername);
110  }
QueueAttr & SetWriter(const std::string &nodename, const std::string &portname)
Definition: QueueAttr.h:126
QueueAttr& CPN::QueueAttr::SetHint ( std::string  hint)
inline
Parameters
hintthe hint to give to the kernel for what kind of queue to create. Empty string or "default" will create a non threshold queue. "threshold will create a threshold queue. "rdma*" will create an rdma queue if it is available.

Definition at line 146 of file QueueAttr.h.

Referenced by CPN::VariantCPNLoader::LoadQueue().

146  {
147  queuehint = hint;
148  return *this;
149  }
std::string queuehint
Definition: QueueAttr.h:215

+ Here is the caller graph for this function:

QueueAttr& CPN::QueueAttr::SetLength ( unsigned  length)
inline

Definition at line 162 of file QueueAttr.h.

162  {
163  queueLength = length;
164  return *this;
165  }
unsigned queueLength
Definition: QueueAttr.h:218
QueueAttr& CPN::QueueAttr::SetMaxThreshold ( unsigned  maxthresh)
inline

Definition at line 167 of file QueueAttr.h.

167  {
168  maxThreshold = maxthresh;
169  return *this;
170  }
unsigned maxThreshold
Definition: QueueAttr.h:219
QueueAttr& CPN::QueueAttr::SetMaxWriteThreshold ( unsigned  mwt)
inline

Definition at line 87 of file QueueAttr.h.

Referenced by CPN::VariantCPNLoader::LoadQueue().

87  {
88  maxwritethreshold = mwt;
89  return *this;
90  }
unsigned maxwritethreshold
Definition: QueueAttr.h:230

+ Here is the caller graph for this function:

QueueAttr& CPN::QueueAttr::SetName ( const std::string &  qname)
inline

Definition at line 92 of file QueueAttr.h.

Referenced by CPN::VariantCPNLoader::LoadQueue().

92  {
93  queuename = qname;
94  return *this;
95  }
std::string queuename
Definition: QueueAttr.h:217

+ Here is the caller graph for this function:

QueueAttr& CPN::QueueAttr::SetNumChannels ( unsigned  channels)
inline

Definition at line 172 of file QueueAttr.h.

Referenced by CPN::VariantCPNLoader::LoadQueue().

172  {
173  numChannels = channels;
174  return *this;
175  }
unsigned numChannels
Definition: QueueAttr.h:220

+ Here is the caller graph for this function:

QueueAttr& CPN::QueueAttr::SetReader ( const std::string &  nodename,
const std::string &  portname 
)
inline

Definition at line 112 of file QueueAttr.h.

Referenced by CPN::VariantCPNLoader::LoadQueue().

113  {
114  readernodename = nodename;
115  readerportname = portname;
116  return *this;
117  }
std::string readernodename
Definition: QueueAttr.h:222
std::string readerportname
Definition: QueueAttr.h:223

+ Here is the caller graph for this function:

QueueAttr& CPN::QueueAttr::SetReader ( Key_t  nodekey,
const std::string &  portname 
)
inline

Definition at line 119 of file QueueAttr.h.

120  {
121  readernodekey = nodekey;
122  readerportname = portname;
123  return *this;
124  }
std::string readerportname
Definition: QueueAttr.h:223
Key_t readernodekey
Definition: QueueAttr.h:228
QueueAttr& CPN::QueueAttr::SetReaderKey ( Key_t  k)
inline

Definition at line 187 of file QueueAttr.h.

187  {
188  readerkey = k;
189  return *this;
190  }
Key_t readerkey
Definition: QueueAttr.h:226
QueueAttr& CPN::QueueAttr::SetReaderNodeKey ( Key_t  k)
inline

Definition at line 177 of file QueueAttr.h.

177  {
178  readernodekey = k;
179  return *this;
180  }
Key_t readernodekey
Definition: QueueAttr.h:228
QueueAttr& CPN::QueueAttr::SetWriter ( const std::string &  nodename,
const std::string &  portname 
)
inline

Definition at line 126 of file QueueAttr.h.

Referenced by CPN::VariantCPNLoader::LoadQueue().

127  {
128  writernodename = nodename;
129  writerportname = portname;
130  return *this;
131  }
std::string writerportname
Definition: QueueAttr.h:225
std::string writernodename
Definition: QueueAttr.h:224

+ Here is the caller graph for this function:

QueueAttr& CPN::QueueAttr::SetWriter ( Key_t  nodekey,
const std::string &  portname 
)
inline

Definition at line 133 of file QueueAttr.h.

134  {
135  writernodekey = nodekey;
136  writerportname = portname;
137  return *this;
138  }
std::string writerportname
Definition: QueueAttr.h:225
Key_t writernodekey
Definition: QueueAttr.h:229
QueueAttr& CPN::QueueAttr::SetWriterKey ( Key_t  k)
inline

Definition at line 192 of file QueueAttr.h.

192  {
193  writerkey = k;
194  return *this;
195  }
Key_t writerkey
Definition: QueueAttr.h:227
QueueAttr& CPN::QueueAttr::SetWriterNodeKey ( Key_t  k)
inline

Definition at line 182 of file QueueAttr.h.

182  {
183  writernodekey = k;
184  return *this;
185  }
Key_t writernodekey
Definition: QueueAttr.h:229

Member Data Documentation

double CPN::QueueAttr::alpha
private

Definition at line 221 of file QueueAttr.h.

std::string CPN::QueueAttr::datatype
private

Definition at line 216 of file QueueAttr.h.

unsigned CPN::QueueAttr::maxThreshold
private

Definition at line 219 of file QueueAttr.h.

unsigned CPN::QueueAttr::maxwritethreshold
private

Definition at line 230 of file QueueAttr.h.

unsigned CPN::QueueAttr::numChannels
private

Definition at line 220 of file QueueAttr.h.

std::string CPN::QueueAttr::queuehint
private

Definition at line 215 of file QueueAttr.h.

unsigned CPN::QueueAttr::queueLength
private

Definition at line 218 of file QueueAttr.h.

std::string CPN::QueueAttr::queuename
private

Definition at line 217 of file QueueAttr.h.

Key_t CPN::QueueAttr::readerkey
private

Definition at line 226 of file QueueAttr.h.

Key_t CPN::QueueAttr::readernodekey
private

Definition at line 228 of file QueueAttr.h.

std::string CPN::QueueAttr::readernodename
private

Definition at line 222 of file QueueAttr.h.

std::string CPN::QueueAttr::readerportname
private

Definition at line 223 of file QueueAttr.h.

Key_t CPN::QueueAttr::writerkey
private

Definition at line 227 of file QueueAttr.h.

Key_t CPN::QueueAttr::writernodekey
private

Definition at line 229 of file QueueAttr.h.

std::string CPN::QueueAttr::writernodename
private

Definition at line 224 of file QueueAttr.h.

std::string CPN::QueueAttr::writerportname
private

Definition at line 225 of file QueueAttr.h.


The documentation for this class was generated from the following file: