replicode
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
mBrane::Node Class Reference

#include <node.h>

Inheritance diagram for mBrane::Node:
Inheritance graph
Collaboration diagram for mBrane::Node:
Collaboration graph

Classes

class  NoStream
 

Public Member Functions

const char * name ()
 
 ~Node ()
 
void run ()
 
void ready ()
 
void shutdown ()
 
void send (const _Module *sender, _Payload *message, module::Node::Network network=module::Node::PRIMARY)
 
void send (const _Module *sender, _Payload *message, uint8_t nodeID, Network network=module::Node::PRIMARY)
 
void send (const _Module *sender, _Payload *message, Array< uint8_t, 128 > *nodeIDs, Network network)
 
uint64_t time () const
 
void newSpace (const _Module *sender, Network network=PRIMARY)
 
void newModule (const _Module *sender, uint16_t CID, Network network=PRIMARY, const char *hostName="local")
 
void deleteSpace (uint16_t ID, Network network=PRIMARY)
 
void deleteModule (uint16_t CID, uint16_t ID, Network network=PRIMARY)
 
void activateModule (const _Module *sender, uint16_t module_cid, uint16_t module_id, uint16_t space_id, float activationLevel, Network network=PRIMARY)
 
void activateSpace (const _Module *sender, uint16_t space_id, uint16_t target_sid, float activationLevel, Network network=PRIMARY)
 
void setSpaceThreshold (const _Module *sender, uint16_t space_id, float threshold, Network network=PRIMARY)
 
void subscribeMessage (const _Module *sender, uint16_t module_cid, uint16_t module_id, uint16_t space_id, uint16_t message_cid, Network network=PRIMARY)
 
void unsubscribeMessage (const _Module *sender, uint16_t module_cid, uint16_t module_id, uint16_t space_id, uint16_t message_cid, Network network=PRIMARY)
 
void subscribeStream (const _Module *sender, uint16_t module_cid, uint16_t module_id, uint16_t space_id, uint16_t stream_id, Network network=PRIMARY)
 
void unsubscribeStream (const _Module *sender, uint16_t module_cid, uint16_t module_id, uint16_t space_id, uint16_t stream_id, Network network=PRIMARY)
 
const char * getSpaceName (uint16_t hostID, uint16_t ID)
 
const char * getModuleName (uint16_t CID)
 
void markUnused (_Payload *p)
 
void addConstantObject (_Payload *c, const std::string &name)
 
_PayloadgetConstantObject (uint32_t OID)
 
_PayloadgetConstantObject (const std::string &name)
 
void addLookup (uint8_t sourceNID, uint32_t OID)
 
bool hasLookup (uint8_t destinationNID, uint32_t OID)
 
void addSharedObject (_Payload *o)
 
_PayloadgetSharedObject (uint32_t OID)
 
void consolidate (_Payload *p)
 
void dump (const char *fileName)
 
void load (const char *fileName)
 
void migrate (uint16_t CID, uint16_t ID, uint8_t NID)
 
_ModulegetModule (uint8_t hostID, uint16_t CID, uint16_t ID)
 
- Public Member Functions inherited from mBrane::sdk::mdaemon::Node
bool isRunning ()
 
- Public Member Functions inherited from mBrane::sdk::module::Node
uint8_t id () const
 

Static Public Member Functions

static NodeNew (const char *configFileName, SharedLibrary &userLibrary, uint8_t traceLevels)
 
static NodeNewXML (const char *configXML, SharedLibrary &userLibrary, uint8_t traceLevels)
 
- Static Public Member Functions inherited from mBrane::sdk::module::Node
static NodeGet ()
 
static std::ostream & trace (TraceLevel l)
 

Private Member Functions

NodeloadConfigXML (const char *configXML)
 
NodeloadConfigFile (const char *configFileName)
 
void start (uint8_t assignedNID, NetworkID *networkID, bool isTimeReference)
 
void notifyNodeJoined (uint8_t NID, NetworkID *networkID)
 
void notifyNodeLeft (uint8_t NID)
 
void startReceivingThreads (uint8_t NID)
 
 Node (uint8_t traceLevels)
 
bool loadApplication (const char *fileName)
 

Private Attributes

SharedLibraryuserLibrary
 

Additional Inherited Members

- Public Types inherited from mBrane::sdk::module::Node
enum  Network {
  PRIMARY = 0, SECONDARY = 1, BOTH = 2, LOCAL = 3,
  EITHER = 4
}
 
enum  TraceLevel { EXECUTION = 0, NETWORK = 1, APPLICATION = 2 }
 
- Static Public Attributes inherited from mBrane::sdk::module::Node
static const uint8_t NoID = 0xFF
 
- Protected Types inherited from mBrane::Networking
typedef void(* BootCallback) ()
 
- Protected Member Functions inherited from mBrane::Networking
bool startInterfaces ()
 
void stopInterfaces ()
 
void setNewReference ()
 
bool checkSyncProbe (uint8_t syncNodeID)
 
void systemReady ()
 
bool addNodeName (const char *name, bool myself=false)
 
uint8_t getNodeID (const char *name)
 
bool allNodesJoined ()
 
bool allNodesReady ()
 
uint16_t sendID (CommChannel *c, NetworkID *networkID)
 
uint16_t recvID (CommChannel *c, NetworkID *&networkID, bool expectToken=true)
 
uint16_t sendMap (CommChannel *c)
 
uint16_t recvMap (CommChannel *c, NetworkID *fromNetworkID)
 
uint16_t connect (NetworkID *networkID)
 
uint16_t connect (Network network, NetworkID *networkID)
 
void _broadcastControlMessage (_Payload *p, Network network)
 
void broadcastControlMessage (_Payload *p, Network network)
 
void _sendControlMessage (_Payload *p, uint8_t destinationNID, Network network)
 
void sendControlMessage (_Payload *p, uint8_t destinationNID, Network network)
 
void sendData (uint8_t NID, _Payload *p, Network network)
 
void sendStreamData (uint8_t NID, _Payload *p, Network network)
 
void processError (uint8_t NID)
 
uint8_t addNodeEntry ()
 
bool init ()
 
bool startSync ()
 
 Networking ()
 
 ~Networking ()
 
bool loadInterface (XMLNode &interfaces, XMLNode &config, const char *name, InterfaceType type)
 
bool loadConfig (XMLNode &n)
 
- Protected Member Functions inherited from mBrane::sdk::mdaemon::Node
 Node (uint8_t ID=NoID)
 
bool loadConfig (XMLNode &n)
 
void start ()
 
 ~Node ()
 
- Protected Member Functions inherited from mBrane::sdk::module::Node
 Node (uint8_t ID)
 
 ~Node ()
 
- Protected Member Functions inherited from mBrane::Messaging
 Messaging ()
 
 ~Messaging ()
 
bool loadConfig (XMLNode &n)
 
void start ()
 
void shutdown ()
 
void send (_Payload *message, module::Node::Network network)
 
void send (_Payload *message, uint8_t nodeID, module::Node::Network network)
 
void pushJobs (_Payload *p, NodeEntry &e)
 
void pushJobs (_Payload *p)
 
void processControlMessage (_Payload *p)
 
- Protected Member Functions inherited from mBrane::Executing
 Executing ()
 
 ~Executing ()
 
bool loadConfig (XMLNode &n)
 
void start ()
 
void shutdown ()
 
- Static Protected Member Functions inherited from mBrane::Networking
static void ScanIDs (Networking *node)
 
static void AcceptConnections (AcceptConnectionArgs *acargs)
 
static void Sync (Networking *node)
 
- Static Protected Member Functions inherited from mBrane::Messaging
static void SendMessages (Node *node)
 
- Protected Attributes inherited from mBrane::Networking
Host::host_name hostName
 
uint8_t hostNameSize
 
SharedLibrarycallbackLibrary
 
BootCallback bootCallback
 
DynamicClassLoader< NetworkInterface > * networkInterfaceLoaders [7]
 
NetworkInterfacenetworkInterfaces [7]
 
Network network
 
std::mutex acceptConnectionMutex
 
int32_t bcastTimeout
 
uint8_t connectedNodeCount
 
NetworkIDnetworkID
 
CommChanneldiscoveryChannel
 
CommChannelbroadcastChannel [2]
 
std::mutex channelsMutex
 
UNORDERED_MAP< uint8_t, NodeCon * > nodes
 
bool isTimeReference
 
uint8_t referenceNID
 
Array< std::thread, 32 > commThreads
 
uint8_t nodeCount
 
int64_t timeDrift
 
int64_t syncPeriod
 
- Protected Attributes inherited from mBrane::sdk::mdaemon::Node
bool volatile _shutdown
 
StaticArray< DynamicClassLoader< Daemon > * > daemonLoaders
 
StaticArray< Daemon * > daemons
 
StaticArray< std::threaddaemonThreads
 
- Protected Attributes inherited from mBrane::sdk::module::Node
uint8_t _ID
 
- Protected Attributes inherited from mBrane::Messaging
Pipe11< P< _Payload >, MESSAGE_INPUT_BLOCK_SIZEmessageInputQueue
 
PipeN1< MessageSlot, MESSAGE_OUTPUT_BLOCK_SIZEmessageOutputQueue
 
PipeNN< Job, JOBS_BLOCK_SIZEjobs
 
Array< RecvThread *, MESSAGE_INPUT_BLOCK_SIZErecvThreads
 
std::thread sendThread
 
Array< PushThread *, MESSAGE_INPUT_BLOCK_SIZEpushThreads
 
std::vector< ConstantEntryconstants
 
UNORDERED_MAP< uint32_t, P< _Payload > > cache
 
std::vector< UNORDERED_SET< uint32_t > > lookup
 
std::mutex cacheMutex
 
uint8_t pendingAck
 
UNORDERED_SET< _Payload * > pendingDeletions [2]
 
uint8_t pendingDeletions_GC
 
uint8_t pendingDeletions_SO
 
std::mutex pendingDeletionsMutex
 
uint32_t GCPeriod
 
GarbageCollectorGC
 
- Protected Attributes inherited from mBrane::Executing
StaticArray< XThread * > xThreads
 
uint16_t threadCount
 
std::mutex supportSync
 
- Static Protected Attributes inherited from mBrane::sdk::module::Node
static std::ostream * Streams [3]
 

Constructor & Destructor Documentation

mBrane::Node::Node ( uint8_t  traceLevels)
private
mBrane::Node::~Node ( )

Member Function Documentation

void mBrane::Node::activateModule ( const _Module sender,
uint16_t  module_cid,
uint16_t  module_id,
uint16_t  space_id,
float  activationLevel,
Network  network = PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

void mBrane::Node::activateSpace ( const _Module sender,
uint16_t  space_id,
uint16_t  target_sid,
float  activationLevel,
Network  network = PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

void mBrane::Node::addConstantObject ( _Payload c,
const std::string &  name 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

void mBrane::Node::addLookup ( uint8_t  sourceNID,
uint32_t  OID 
)
virtual
void mBrane::Node::addSharedObject ( _Payload o)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

void mBrane::Node::consolidate ( _Payload p)
virtual
void mBrane::Node::deleteModule ( uint16_t  CID,
uint16_t  ID,
Network  network = PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

void mBrane::Node::deleteSpace ( uint16_t  ID,
Network  network = PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

void mBrane::Node::dump ( const char *  fileName)
virtual
_Payload * mBrane::Node::getConstantObject ( uint32_t  OID)
virtual
_Payload * mBrane::Node::getConstantObject ( const std::string &  name)
virtual
_Module * mBrane::Node::getModule ( uint8_t  hostID,
uint16_t  CID,
uint16_t  ID 
)
virtual
const char * mBrane::Node::getModuleName ( uint16_t  CID)
virtual
_Payload * mBrane::Node::getSharedObject ( uint32_t  OID)
virtual
const char * mBrane::Node::getSpaceName ( uint16_t  hostID,
uint16_t  ID 
)
virtual
bool mBrane::Node::hasLookup ( uint8_t  destinationNID,
uint32_t  OID 
)
virtual
void mBrane::Node::load ( const char *  fileName)
virtual
bool mBrane::Node::loadApplication ( const char *  fileName)
private

Here is the call graph for this function:

Here is the caller graph for this function:

Node * mBrane::Node::loadConfigFile ( const char *  configFileName)
private

Here is the call graph for this function:

Here is the caller graph for this function:

Node * mBrane::Node::loadConfigXML ( const char *  configXML)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void mBrane::Node::markUnused ( _Payload p)
virtual
void mBrane::Node::migrate ( uint16_t  CID,
uint16_t  ID,
uint8_t  NID 
)
virtual
const char * mBrane::Node::name ( )
virtual

Implements mBrane::sdk::module::Node.

Here is the caller graph for this function:

Node * mBrane::Node::New ( const char *  configFileName,
SharedLibrary userLibrary,
uint8_t  traceLevels 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

void mBrane::Node::newModule ( const _Module sender,
uint16_t  CID,
Network  network = PRIMARY,
const char *  hostName = "local" 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

void mBrane::Node::newSpace ( const _Module sender,
Network  network = PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

Node * mBrane::Node::NewXML ( const char *  configXML,
SharedLibrary userLibrary,
uint8_t  traceLevels 
)
static

Here is the call graph for this function:

void mBrane::Node::notifyNodeJoined ( uint8_t  NID,
NetworkID networkID 
)
privatevirtual

Implements mBrane::Networking.

Here is the call graph for this function:

void mBrane::Node::notifyNodeLeft ( uint8_t  NID)
privatevirtual

Implements mBrane::Networking.

Here is the call graph for this function:

void mBrane::Node::ready ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void mBrane::Node::run ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void mBrane::Node::send ( const _Module sender,
_Payload message,
module::Node::Network  network = module::Node::PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

Here is the caller graph for this function:

void mBrane::Node::send ( const _Module sender,
_Payload message,
uint8_t  nodeID,
Network  network = module::Node::PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

void mBrane::Node::send ( const _Module sender,
_Payload message,
Array< uint8_t, 128 > *  nodeIDs,
Network  network 
)

Here is the call graph for this function:

void mBrane::Node::setSpaceThreshold ( const _Module sender,
uint16_t  space_id,
float  threshold,
Network  network = PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

void mBrane::Node::shutdown ( )
virtual

Reimplemented from mBrane::Networking.

Here is the call graph for this function:

Here is the caller graph for this function:

void mBrane::Node::start ( uint8_t  assignedNID,
NetworkID networkID,
bool  isTimeReference 
)
privatevirtual

Reimplemented from mBrane::Networking.

Here is the call graph for this function:

void mBrane::Node::startReceivingThreads ( uint8_t  NID)
privatevirtual

Implements mBrane::Networking.

void mBrane::Node::subscribeMessage ( const _Module sender,
uint16_t  module_cid,
uint16_t  module_id,
uint16_t  space_id,
uint16_t  message_cid,
Network  network = PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

void mBrane::Node::subscribeStream ( const _Module sender,
uint16_t  module_cid,
uint16_t  module_id,
uint16_t  space_id,
uint16_t  stream_id,
Network  network = PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

uint64_t mBrane::Node::time ( ) const
inlinevirtual

Implements mBrane::sdk::module::Node.

Here is the caller graph for this function:

void mBrane::Node::unsubscribeMessage ( const _Module sender,
uint16_t  module_cid,
uint16_t  module_id,
uint16_t  space_id,
uint16_t  message_cid,
Network  network = PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

void mBrane::Node::unsubscribeStream ( const _Module sender,
uint16_t  module_cid,
uint16_t  module_id,
uint16_t  space_id,
uint16_t  stream_id,
Network  network = PRIMARY 
)
virtual

Implements mBrane::sdk::module::Node.

Here is the call graph for this function:

Member Data Documentation

SharedLibrary* mBrane::Node::userLibrary
private

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