CPN
Computational Process Networks
Namespaces | Classes | Typedefs | Enumerations | Functions
CPN Namespace Reference

Namespaces

 NodeBasePrivate
 

Classes

class  KernelBase
 
class  NodeLoader
 
class  PseudoNode
 
class  QueueReader
 Definition of the reader portion of the CPN queue class. More...
 
class  QueueReleaser
 
class  QueueWriter
 Definition of the writer portion of the CPN queue class. More...
 
class  Context
 The CPN::Context abstraction that holds all the global state for the process network. More...
 
class  ShutdownException
 An exception indicating that the Kernel has shut down. More...
 
class  TypeMismatchException
 An exception indicating that there is a type mismatch in the queue. More...
 
class  BrokenQueueException
 An exception indicating that the node tried to write to a shutdown queue. More...
 
class  IQueue
 Template class to do type conversion for reader end of the queue. More...
 
class  Kernel
 The Kernel declaration. More...
 
class  KernelAttr
 The attribute for the Kernel. More...
 
class  NodeAttr
 Attributes for a node. More...
 
class  NodeBase
 The definition common to all nodes in the process network. More...
 
class  NodeFactory
 The node factory provides a method for the kernel to create arbitrary user defined Nodes. More...
 
class  OQueue
 A template class to do type conversion for the writer end of the queue. More...
 
class  QueueAttr
 The attributes for a queue. More...
 
class  SimpleQueueAttr
 This is a simplified internal representation of the queue attributes needed to create a queue. This is for internal use only. More...
 
class  RemoteContext
 
class  RemoteContextClient
 This abstract class is the remote context client. More...
 
class  RemoteContextDaemon
 
class  RemoteContextServer
 the server for the remote context. More...
 
class  VariantCPNLoader
 
class  ConnectionServer
 
class  ThresholdQueue
 A version of the ThresholdQueue that provides the CPN Queue interface This queue implementation creates a memory mapped object which has as a minimum size the machine page size. So there is an effective minimum queue size. Any queue size less than the page size will be expanded to the page size. More...
 
class  ExternalEndpoint
 
class  LocalContext
 A local implementation of the Context interface. More...
 
class  PacketDecoder
 
class  PacketEncoder
 
struct  PacketHeader
 
class  Packet
 
class  PacketHandler
 
class  QueueBase
 The base class for all queues in the CPN library. More...
 
class  RemoteQueue
 
class  RemoteQueueBase
 
class  RemoteQueueHolder
 

Typedefs

typedef shared_ptr< NodeFactory >(* CPNInitPrototype )(void)
 This is the prototype of the function that is called by the dynamic library loading facility. More...
 
typedef uint64_t Key_t
 
typedef AutoLock< PthreadMutexAutoPLock
 

Enumerations

enum  RCTXMT_t {
  RCTXMT_SETUP_KERNEL, RCTXMT_GET_KERNEL_INFO, RCTXMT_SIGNAL_KERNEL_START, RCTXMT_SIGNAL_KERNEL_END,
  RCTXMT_CREATE_WRITER, RCTXMT_CREATE_READER, RCTXMT_CREATE_QUEUE, RCTXMT_CREATE_NODE,
  RCTXMT_CREATE_NODE_KEY, RCTXMT_SIGNAL_NODE_START, RCTXMT_SIGNAL_NODE_END, RCTXMT_GET_NODE_INFO,
  RCTXMT_GET_NUM_NODE_LIVE, RCTXMT_GET_CREATE_READER_KEY, RCTXMT_GET_READER_INFO, RCTXMT_GET_CREATE_WRITER_KEY,
  RCTXMT_GET_WRITER_INFO, RCTXMT_CONNECT_ENDPOINTS, RCTXMT_GET_READERS_WRITER, RCTXMT_GET_WRITERS_READER,
  RCTXMT_TERMINATE, RCTXMT_LOG
}
 RCTXMT Remote Context Message Type These are the message types that the remote context uses to send information back and forth. More...
 
enum  QueueHintStatus { QUEUEHINT_DEFAULT = 0, QUEUEHINT_THRESHOLD, QUEUEHINT_RDMA }
 
enum  { PACKET_SYNCWORD = 0xF1F0C0DE, PACKET_REVERSE_SYNCWORD = 0xDEC0F0F1, PACKET_HEADERLENGTH = 64 }
 some packet header constants. More...
 
enum  PacketType_t {
  PACKET_ENQUEUE, PACKET_DEQUEUE, PACKET_READBLOCK, PACKET_WRITEBLOCK,
  PACKET_ENDOFWRITE, PACKET_ENDOFREAD, PACKET_GROW, PACKET_D4RTAG,
  PACKET_FLUSH, PACKET_RESET, PACKET_ID_READER, PACKET_ID_WRITER
}
 

Functions

bool TypeCompatable (const std::string &type1, const std::string &type2)
 
template<class type >
std::string TypeName ()
 
template<class type >
unsigned GetTypeSize ()
 
template<>
unsigned GetTypeSize< void > ()
 
 REGISTER_TYPE_NAME (void)
 
 REGISTER_TYPE_NAME (int8_t)
 
 REGISTER_TYPE_NAME (uint8_t)
 
 REGISTER_TYPE_NAME (int16_t)
 
 REGISTER_TYPE_NAME (uint16_t)
 
 REGISTER_TYPE_NAME (int32_t)
 
 REGISTER_TYPE_NAME (uint32_t)
 
 REGISTER_TYPE_NAME (int64_t)
 
 REGISTER_TYPE_NAME (uint64_t)
 
 REGISTER_TYPE_NAME (float)
 
 REGISTER_TYPE_NAME (double)
 
 REGISTER_TYPE_NAME (long double)
 
 REGISTER_TYPE (std::complex< int8_t >,"complex<int8_t>")
 
 REGISTER_TYPE (std::complex< uint8_t >,"complex<uint8_t>")
 
 REGISTER_TYPE (std::complex< int16_t >,"complex<int16_t>")
 
 REGISTER_TYPE (std::complex< uint16_t >,"complex<uint16_t>")
 
 REGISTER_TYPE (std::complex< int32_t >,"complex<int32_t>")
 
 REGISTER_TYPE (std::complex< uint32_t >,"complex<uint32_t>")
 
 REGISTER_TYPE (std::complex< int64_t >,"complex<int64_t>")
 
 REGISTER_TYPE (std::complex< uint64_t >,"complex<uint64_t>")
 
 REGISTER_TYPE (std::complex< float >,"complex<float>")
 
 REGISTER_TYPE (std::complex< double >,"complex<double>")
 
 REGISTER_TYPE (std::complex< long double >,"complex<long double>")
 
static QueueHintStatus ParseQueueHintForMBS (std::string hint)
 
bool ValidPacket (const PacketHeader *ph) CPN_LOCAL
 
void InitPacket (PacketHeader *ph, uint32_t datalen, PacketType_t type) CPN_LOCAL
 
NodeAttr MsgToNodeAttr (const Variant &msg)
 
SimpleQueueAttr MsgToQueueAttr (const Variant &msg)
 
const char * BoolString (bool tf)
 

Detailed Description

Namespace that seperates all the CPN specific names from the global namespace.

Author
John Bridgman

Typedef Documentation

Definition at line 35 of file ConnectionServer.cc.

typedef shared_ptr<NodeFactory>(* CPN::CPNInitPrototype)(void)

This is the prototype of the function that is called by the dynamic library loading facility.

Definition at line 39 of file NodeLoader.h.

typedef uint64_t CPN::Key_t

Key_t is used for all the keys for each of the objects.

Definition at line 79 of file common.h.

Enumeration Type Documentation

anonymous enum

some packet header constants.

Enumerator
PACKET_SYNCWORD 
PACKET_REVERSE_SYNCWORD 
PACKET_HEADERLENGTH 

Definition at line 44 of file PacketHeader.h.

The packet types.

Enumerator
PACKET_ENQUEUE 
PACKET_DEQUEUE 
PACKET_READBLOCK 
PACKET_WRITEBLOCK 
PACKET_ENDOFWRITE 
PACKET_ENDOFREAD 
PACKET_GROW 
PACKET_D4RTAG 
PACKET_FLUSH 
PACKET_RESET 
PACKET_ID_READER 
PACKET_ID_WRITER 

Definition at line 53 of file PacketHeader.h.

Enumerator
QUEUEHINT_DEFAULT 
QUEUEHINT_THRESHOLD 
QUEUEHINT_RDMA 

Definition at line 328 of file Kernel.cc.

RCTXMT Remote Context Message Type These are the message types that the remote context uses to send information back and forth.

Enumerator
RCTXMT_SETUP_KERNEL 

Commands for dealing with kernels.

RCTXMT_GET_KERNEL_INFO 
RCTXMT_SIGNAL_KERNEL_START 
RCTXMT_SIGNAL_KERNEL_END 
RCTXMT_CREATE_WRITER 

Commands to tell other kernels to create objects.

RCTXMT_CREATE_READER 
RCTXMT_CREATE_QUEUE 
RCTXMT_CREATE_NODE 
RCTXMT_CREATE_NODE_KEY 
RCTXMT_SIGNAL_NODE_START 
RCTXMT_SIGNAL_NODE_END 
RCTXMT_GET_NODE_INFO 
RCTXMT_GET_NUM_NODE_LIVE 
RCTXMT_GET_CREATE_READER_KEY 
RCTXMT_GET_READER_INFO 
RCTXMT_GET_CREATE_WRITER_KEY 
RCTXMT_GET_WRITER_INFO 
RCTXMT_CONNECT_ENDPOINTS 
RCTXMT_GET_READERS_WRITER 
RCTXMT_GET_WRITERS_READER 
RCTXMT_TERMINATE 

Context commands.

RCTXMT_LOG 

Definition at line 33 of file RCTXMT.h.

33  {
87  };

Function Documentation

const char* CPN::BoolString ( bool  tf)

Definition at line 859 of file RemoteQueue.cc.

Referenced by CPN::RemoteQueue::LogState().

859  {
860  if (tf) {
861  return "t";
862  } else {
863  return "f";
864  }
865  }

+ Here is the caller graph for this function:

template<class type >
unsigned CPN::GetTypeSize ( )

Definition at line 46 of file QueueDatatypes.h.

46  {
47  return sizeof(type);
48  }
template<>
unsigned CPN::GetTypeSize< void > ( )
inline

Definition at line 52 of file QueueDatatypes.h.

52 { return 1; }
void CPN::InitPacket ( PacketHeader *  ph,
uint32_t  datalen,
PacketType_t  type 
)
inline

Definition at line 102 of file PacketHeader.h.

References PACKET_SYNCWORD.

Referenced by CPN::Packet::Init().

102  {
103  memset(ph, 0, sizeof(PacketHeader));
104  ph->syncWord = PACKET_SYNCWORD;
105  ph->dataLength = datalen;
106  ph->dataType = type;
107  }

+ Here is the caller graph for this function:

NodeAttr CPN::MsgToNodeAttr ( const Variant &  msg)

Definition at line 215 of file RemoteContextClient.cc.

References CPN::NodeAttr::SetKernel(), CPN::NodeAttr::SetKey(), and CPN::NodeAttr::SetParam().

Referenced by CPN::RemoteContextClient::DispatchMessage().

215  {
216  NodeAttr attr(msg["name"].AsString(), msg["nodetype"].AsString());
217  attr.SetKernel(msg["kernel"].AsString());
218  attr.SetKey(msg["key"].AsNumber<Key_t>());
219  if (msg.Contains("param")) {
220  for (Variant::ConstMapIterator i = msg["param"].MapBegin(), e = msg["param"].MapEnd();
221  i != e; ++i)
222  {
223  attr.SetParam(i->first, i->second.AsString());
224  }
225  }
226  return attr;
227  }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

SimpleQueueAttr CPN::MsgToQueueAttr ( const Variant &  msg)

Definition at line 250 of file RemoteContextClient.cc.

References CPN::SimpleQueueAttr::SetAlpha(), CPN::SimpleQueueAttr::SetDatatype(), CPN::SimpleQueueAttr::SetHint(), CPN::SimpleQueueAttr::SetLength(), CPN::SimpleQueueAttr::SetMaxThreshold(), CPN::SimpleQueueAttr::SetMaxWriteThreshold(), CPN::SimpleQueueAttr::SetNumChannels(), CPN::SimpleQueueAttr::SetReaderKey(), CPN::SimpleQueueAttr::SetReaderNodeKey(), CPN::SimpleQueueAttr::SetWriterKey(), and CPN::SimpleQueueAttr::SetWriterNodeKey().

Referenced by CPN::RemoteContextClient::DispatchMessage().

250  {
251  SimpleQueueAttr attr;
252  attr.SetHint(msg["queuehint"].AsString());
253  attr.SetDatatype(msg["datatype"].AsString());
254  attr.SetLength(msg["queueLength"].AsUnsigned());
255  attr.SetMaxThreshold(msg["maxThreshold"].AsUnsigned());
256  attr.SetNumChannels(msg["numChannels"].AsUnsigned());
257  attr.SetReaderKey(msg["readerkey"].AsNumber<Key_t>());
258  attr.SetWriterKey(msg["writerkey"].AsNumber<Key_t>());
259  attr.SetReaderNodeKey(msg["readernodekey"].AsNumber<Key_t>());
260  attr.SetWriterNodeKey(msg["writernodekey"].AsNumber<Key_t>());
261  attr.SetAlpha(msg["alpha"].AsDouble());
262  attr.SetMaxWriteThreshold(msg["maxwritethreshold"].AsUnsigned());
263  return attr;
264  }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static QueueHintStatus CPN::ParseQueueHintForMBS ( std::string  hint)
static

Definition at line 334 of file Kernel.cc.

References QUEUEHINT_DEFAULT, QUEUEHINT_RDMA, and QUEUEHINT_THRESHOLD.

Referenced by CPN::Kernel::CreateLocalQueue(), CPN::Kernel::CreateReaderEndpoint(), and CPN::Kernel::CreateWriterEndpoint().

334  {
335  static const char threshold_str[] = "threshold";
336  static const char *threshold_end = threshold_str + sizeof(threshold_str) - 1;
337  static const char rdma_str[] = "rdma";
338  static const char *rdma_end = rdma_str + sizeof(rdma_str) - 1;
339  bool match = true;
340  std::string::iterator h_cur = hint.begin();
341  std::string::iterator h_end = hint.end();
342  for (const char *cur = &threshold_str[0]; cur != threshold_end; ++cur) {
343  if (h_cur == h_end || *h_cur != *cur) {
344  match = false;
345  break;
346  }
347  ++h_cur;
348  }
349  if (match) { return QUEUEHINT_THRESHOLD; }
350  match = true;
351  h_cur = hint.begin();
352  for (const char *cur = &rdma_str[0]; cur != rdma_end; ++cur) {
353  if (h_cur == h_end || *h_cur != *cur) {
354  match = false;
355  break;
356  }
357  ++h_cur;
358  }
359  if (match) { return QUEUEHINT_RDMA; }
360  return QUEUEHINT_DEFAULT;
361  }

+ Here is the caller graph for this function:

CPN::REGISTER_TYPE ( std::complex< int8_t >  ,
"complex<int8_t>"   
)
CPN::REGISTER_TYPE ( std::complex< uint8_t >  ,
"complex<uint8_t>"   
)
CPN::REGISTER_TYPE ( std::complex< int16_t >  ,
"complex<int16_t>"   
)
CPN::REGISTER_TYPE ( std::complex< uint16_t >  ,
"complex<uint16_t>"   
)
CPN::REGISTER_TYPE ( std::complex< int32_t >  ,
"complex<int32_t>"   
)
CPN::REGISTER_TYPE ( std::complex< uint32_t >  ,
"complex<uint32_t>"   
)
CPN::REGISTER_TYPE ( std::complex< int64_t >  ,
"complex<int64_t>"   
)
CPN::REGISTER_TYPE ( std::complex< uint64_t >  ,
"complex<uint64_t>"   
)
CPN::REGISTER_TYPE ( std::complex< float >  ,
"complex<float>"   
)
CPN::REGISTER_TYPE ( std::complex< double >  ,
"complex<double>"   
)
CPN::REGISTER_TYPE ( std::complex< long double >  ,
"complex<long double>"   
)
CPN::REGISTER_TYPE_NAME ( void  )
CPN::REGISTER_TYPE_NAME ( int8_t  )
CPN::REGISTER_TYPE_NAME ( uint8_t  )
CPN::REGISTER_TYPE_NAME ( int16_t  )
CPN::REGISTER_TYPE_NAME ( uint16_t  )
CPN::REGISTER_TYPE_NAME ( int32_t  )
CPN::REGISTER_TYPE_NAME ( uint32_t  )
CPN::REGISTER_TYPE_NAME ( int64_t  )
CPN::REGISTER_TYPE_NAME ( uint64_t  )
CPN::REGISTER_TYPE_NAME ( float  )
CPN::REGISTER_TYPE_NAME ( double  )
CPN::REGISTER_TYPE_NAME ( long  double)
bool CPN::TypeCompatable ( const std::string &  type1,
const std::string &  type2 
)

Definition at line 28 of file QueueDatatypes.cc.

Referenced by CPN::IQueue< T >::IQueue(), and CPN::OQueue< T >::OQueue().

28  {
29  if (type1 == "void") {
30  return true;
31  }
32  if (type2 == "void") {
33  return true;
34  }
35  return type1 == type2;
36  }

+ Here is the caller graph for this function:

template<class type >
std::string CPN::TypeName ( )

Definition at line 40 of file QueueDatatypes.h.

40  {
41  return typeid(type).name();
42  }
bool CPN::ValidPacket ( const PacketHeader *  ph)
inline

Definition at line 98 of file PacketHeader.h.

References PACKET_SYNCWORD.

Referenced by CPN::Packet::Valid().

98  {
99  return ph->syncWord == PACKET_SYNCWORD;
100  }

+ Here is the caller graph for this function: