OpenJAUS SAE SDK  6.0.0
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
openjaus::model::SystemTree Class Reference

#include <SystemTree.h>

Classes

class  Callback
 

Public Member Functions

const std::map< uint16, SubsystemInfo * > & getSubsystems () const
 
uint16 getThisSubsytem () const
 
bool setThisSubsytem (uint16 thisSubsytem)
 
uint8 getThisNode () const
 
bool setThisNode (uint8 thisNode)
 
const system::MutexgetMutex () const
 
bool hasComponent (const transport::Address &address)
 
bool hasComponent (uint16 subsystemId, uint8 nodeId, uint8 componentId)
 
bool hasNode (const transport::Address &address)
 
bool hasNode (uint16 subsystemId, uint8 nodeId)
 
bool hasSubsystem (const transport::Address &address)
 
bool hasSubsystem (uint16 subsystemId)
 
bool hasComponentIdentification (ComponentInfo &component)
 
bool hasComponentIdentification (const transport::Address &address)
 
bool hasComponentIdentification (uint16 subsystemId, uint8 nodeId, uint8 componentId)
 
bool hasNodeIdentification (NodeInfo &node)
 
bool hasNodeIdentification (const transport::Address &address)
 
bool hasNodeIdentification (uint16 subsystemId, uint8 nodeId)
 
bool hasSubsystemIdentification (SubsystemInfo &subsystem)
 
bool hasSubsystemIdentification (const transport::Address &address)
 
bool hasSubsystemIdentification (uint16 subsystemId)
 
bool hasComponentConfiguration (ComponentInfo &component)
 
bool hasComponentConfiguration (const transport::Address &address)
 
bool hasComponentConfiguration (uint16 subsystemId, uint8 nodeId, uint8 componentId)
 
bool hasNodeConfiguration (NodeInfo &node)
 
bool hasNodeConfiguration (const transport::Address &address)
 
bool hasNodeConfiguration (uint16 subsystemId, uint8 nodeId)
 
bool hasSubsystemConfiguration (SubsystemInfo &subsystem)
 
bool hasSubsystemConfiguration (const transport::Address &address)
 
bool hasSubsystemConfiguration (uint16 subsystemId)
 
ComponentInfo getComponent (ComponentInfo &component, bool &success)
 
ComponentInfo getComponent (const transport::Address &address, bool &success)
 
ComponentInfo getComponent (uint16 subsystemId, uint8 nodeId, uint8 componentId, bool &success)
 
NodeInfo getNode (NodeInfo &node, bool &success)
 
NodeInfo getNode (const transport::Address &address, bool &success)
 
NodeInfo getNode (uint16 subsystemId, uint8 nodeId, bool &success)
 
SubsystemInfo getSubsystem (SubsystemInfo &subsystem, bool &success)
 
SubsystemInfo getSubsystem (const transport::Address &address, bool &success)
 
SubsystemInfo getSubsystem (uint16 subsystemId, bool &success)
 
bool addService (transport::Address address, std::string uri, int versionMajor, int versionMinor)
 
bool addComponent (ComponentInfo &component)
 
bool addComponent (const transport::Address &address)
 
bool addComponent (uint16 subsystemId, uint8 nodeId, uint8 componentId)
 
bool addNode (NodeInfo &node)
 
bool addNode (const transport::Address &address)
 
bool addNode (uint16 subsystemId, uint8 nodeId)
 
bool addSubsystem (SubsystemInfo &subsystem)
 
bool addSubsystem (const transport::Address &address)
 
bool addSubsystem (uint16 subsystemId)
 
bool replaceComponent (ComponentInfo &component)
 
bool removeComponent (ComponentInfo &component)
 
bool removeComponent (const transport::Address &address)
 
bool removeComponent (uint16 subsystemId, uint8 nodeId, uint8 componentId)
 
bool removeNode (NodeInfo &node)
 
bool removeNode (const transport::Address &address)
 
bool removeNode (uint16 subsystemId, uint8 nodeId)
 
bool removeSubsystem (SubsystemInfo &subsystem)
 
bool removeSubsystem (const transport::Address &address)
 
bool removeSubsystem (uint16 subsystemId)
 
void lock ()
 
void unlock ()
 
unsigned char getAvailableComponentId (uint16 subsystemId, uint8 nodeId)
 
unsigned char getAvailableNodeId (uint16 subsystemId)
 
uint16 getAvailableSubsystemId ()
 
bool setComponentIdentification (const transport::Address &address, std::string name)
 
bool setNodeIdentification (const transport::Address &address, std::string name)
 
bool setSubsystemIdentification (const transport::Address &address, std::string name)
 
bool addLocalComponent (const transport::Address &address)
 
virtual std::string toString () const
 
std::vector< uint16getSubsystemIds ()
 
std::string toXml (unsigned char level=0) const
 
std::vector< transport::AddresslookupService (std::string uri, int versionMajor=Service::ANY_VERSION, int versionMinor=Service::ANY_VERSION, transport::Address addressHint=transport::Address(transport::Address::ANY_SUBSYSTEM, transport::Address::ANY_NODE, transport::Address::ANY_COMPONENT))
 
std::vector< transport::AddresslookupComponent (std::string name, transport::Address addressHint=transport::Address(transport::Address::ANY_SUBSYSTEM, transport::Address::ANY_NODE, transport::Address::ANY_COMPONENT))
 
void setIdentification (const transport::Address &address, std::string subsystemName, std::string nodeName, std::string componentName)
 
void addUnsolicitedSender (const transport::Address &source, const transport::Address &destination)
 
void addOnItemAddCallback (void(*onAddItemCallback)(void *object, const transport::Address &address), void *object)
 
void removeOnItemAddCallback (void(*onAddItemCallback)(void *object, const transport::Address &address), void *object)
 
void addOnLocalComponentAddCallback (void(*onAddLocalComponentCallback)(void *object, const transport::Address &address), void *object)
 Execute the provided callback when a local component is added. More...
 
void removeOnLocalComponentAddCallback (void(*onAddLocalComponentCallback)(void *object, const transport::Address &address), void *object)
 
void addOnUnsolicitedSenderAddCallback (void(*onAddUnsolicitedSenderCallback)(void *object, const transport::Address &source, const transport::Address &destination), void *object)
 
void removeOnUnsolicitedSenderAddCallback (void(*onAddUnsolicitedSenderCallback)(void *object, const transport::Address &source, const transport::Address &destination), void *object)
 
void addServices (const transport::Address &address, std::vector< model::Service *> *serviceList)
 

Static Public Member Functions

static SystemTreeinstance ()
 

Private Member Functions

 SystemTree ()
 
virtual ~SystemTree ()
 
NodeInfofindNode (uint16 subsId, unsigned char nodeId)
 
ComponentInfofindComponent (uint16 subsId, unsigned char nodeId, unsigned char cmptId)
 
bool addComponentInternal (const transport::Address &address)
 
bool addComponentInternal (uint16 subsystemId, uint8 nodeId, uint8 componentId)
 
void executeOnItemAddCallbacks (const openjaus::transport::Address &address)
 
void executeOnLocalComponentAddCallbacks (const openjaus::transport::Address &address)
 
void executeOnAddUnsolicitedSenderCallbacks (const transport::Address &source, const transport::Address &destination)
 

Private Attributes

std::map< uint16, SubsystemInfo * > subsystems
 
uint16 thisSubsytem
 
uint8 thisNode
 
system::Mutex mutex
 
system::Mutex onItemAddCallbacksLock
 
system::Mutex onLocalComponentAddCallbacksLock
 
system::Mutex onUnsolicitedSenderAddCallbacksLock
 
std::vector< SystemTree::CallbackonItemAddCallbacks
 
std::vector< SystemTree::CallbackonLocalComponentAddCallbacks
 
std::vector< SystemTree::CallbackonUnsolicitedSenderAddCallbacks
 

Friends

OPENJAUS_EXPORT friend std::ostream & operator<< (std::ostream &output, const SystemTree &object)
 
OPENJAUS_EXPORT friend std::ostream & operator<< (std::ostream &output, const SystemTree *object)
 

Constructor & Destructor Documentation

◆ SystemTree()

openjaus::model::SystemTree::SystemTree ( )
private

◆ ~SystemTree()

openjaus::model::SystemTree::~SystemTree ( )
privatevirtual

Member Function Documentation

◆ addComponent() [1/3]

bool openjaus::model::SystemTree::addComponent ( ComponentInfo component)

◆ addComponent() [2/3]

bool openjaus::model::SystemTree::addComponent ( const transport::Address address)
inline

◆ addComponent() [3/3]

bool openjaus::model::SystemTree::addComponent ( uint16  subsystemId,
uint8  nodeId,
uint8  componentId 
)

◆ addComponentInternal() [1/2]

bool openjaus::model::SystemTree::addComponentInternal ( const transport::Address address)
inlineprivate

◆ addComponentInternal() [2/2]

bool openjaus::model::SystemTree::addComponentInternal ( uint16  subsystemId,
uint8  nodeId,
uint8  componentId 
)
private

◆ addLocalComponent()

bool openjaus::model::SystemTree::addLocalComponent ( const transport::Address address)

◆ addNode() [1/3]

bool openjaus::model::SystemTree::addNode ( NodeInfo node)

◆ addNode() [2/3]

bool openjaus::model::SystemTree::addNode ( const transport::Address address)
inline

◆ addNode() [3/3]

bool openjaus::model::SystemTree::addNode ( uint16  subsystemId,
uint8  nodeId 
)

◆ addOnItemAddCallback()

void openjaus::model::SystemTree::addOnItemAddCallback ( void(*)(void *object, const transport::Address &address)  onAddItemCallback,
void *  object 
)

◆ addOnLocalComponentAddCallback()

void openjaus::model::SystemTree::addOnLocalComponentAddCallback ( void(*)(void *object, const transport::Address &address)  onAddLocalComponentCallback,
void *  object 
)

Note: Adding a local component will execute both this callback as well as the OnItemAddCallback.

◆ addOnUnsolicitedSenderAddCallback()

void openjaus::model::SystemTree::addOnUnsolicitedSenderAddCallback ( void(*)(void *object, const transport::Address &source, const transport::Address &destination)  onAddUnsolicitedSenderCallback,
void *  object 
)

◆ addService()

bool openjaus::model::SystemTree::addService ( transport::Address  address,
std::string  uri,
int  versionMajor,
int  versionMinor 
)

◆ addServices()

void openjaus::model::SystemTree::addServices ( const transport::Address address,
std::vector< model::Service *> *  serviceList 
)

◆ addSubsystem() [1/3]

bool openjaus::model::SystemTree::addSubsystem ( SubsystemInfo subsystem)

◆ addSubsystem() [2/3]

bool openjaus::model::SystemTree::addSubsystem ( const transport::Address address)
inline

◆ addSubsystem() [3/3]

bool openjaus::model::SystemTree::addSubsystem ( uint16  subsystemId)

◆ addUnsolicitedSender()

void openjaus::model::SystemTree::addUnsolicitedSender ( const transport::Address source,
const transport::Address destination 
)

◆ executeOnAddUnsolicitedSenderCallbacks()

void openjaus::model::SystemTree::executeOnAddUnsolicitedSenderCallbacks ( const transport::Address source,
const transport::Address destination 
)
private

◆ executeOnItemAddCallbacks()

void openjaus::model::SystemTree::executeOnItemAddCallbacks ( const openjaus::transport::Address address)
private

◆ executeOnLocalComponentAddCallbacks()

void openjaus::model::SystemTree::executeOnLocalComponentAddCallbacks ( const openjaus::transport::Address address)
private

◆ findComponent()

ComponentInfo * openjaus::model::SystemTree::findComponent ( uint16  subsId,
unsigned char  nodeId,
unsigned char  cmptId 
)
private

◆ findNode()

NodeInfo * openjaus::model::SystemTree::findNode ( uint16  subsId,
unsigned char  nodeId 
)
private

◆ getAvailableComponentId()

unsigned char openjaus::model::SystemTree::getAvailableComponentId ( uint16  subsystemId,
uint8  nodeId 
)

◆ getAvailableNodeId()

unsigned char openjaus::model::SystemTree::getAvailableNodeId ( uint16  subsystemId)

◆ getAvailableSubsystemId()

uint16 openjaus::model::SystemTree::getAvailableSubsystemId ( )

◆ getComponent() [1/3]

ComponentInfo openjaus::model::SystemTree::getComponent ( ComponentInfo component,
bool &  success 
)

◆ getComponent() [2/3]

ComponentInfo openjaus::model::SystemTree::getComponent ( const transport::Address address,
bool &  success 
)

◆ getComponent() [3/3]

ComponentInfo openjaus::model::SystemTree::getComponent ( uint16  subsystemId,
uint8  nodeId,
uint8  componentId,
bool &  success 
)

◆ getMutex()

const system::Mutex & openjaus::model::SystemTree::getMutex ( ) const

◆ getNode() [1/3]

NodeInfo openjaus::model::SystemTree::getNode ( NodeInfo node,
bool &  success 
)

◆ getNode() [2/3]

NodeInfo openjaus::model::SystemTree::getNode ( const transport::Address address,
bool &  success 
)

◆ getNode() [3/3]

NodeInfo openjaus::model::SystemTree::getNode ( uint16  subsystemId,
uint8  nodeId,
bool &  success 
)

◆ getSubsystem() [1/3]

SubsystemInfo openjaus::model::SystemTree::getSubsystem ( SubsystemInfo subsystem,
bool &  success 
)

◆ getSubsystem() [2/3]

SubsystemInfo openjaus::model::SystemTree::getSubsystem ( const transport::Address address,
bool &  success 
)

◆ getSubsystem() [3/3]

SubsystemInfo openjaus::model::SystemTree::getSubsystem ( uint16  subsystemId,
bool &  success 
)

◆ getSubsystemIds()

std::vector< uint16 > openjaus::model::SystemTree::getSubsystemIds ( )

◆ getSubsystems()

const std::map< uint16, SubsystemInfo * > & openjaus::model::SystemTree::getSubsystems ( ) const

◆ getThisNode()

uint8 openjaus::model::SystemTree::getThisNode ( ) const

◆ getThisSubsytem()

uint16 openjaus::model::SystemTree::getThisSubsytem ( ) const

◆ hasComponent() [1/2]

bool openjaus::model::SystemTree::hasComponent ( const transport::Address address)
inline

◆ hasComponent() [2/2]

bool openjaus::model::SystemTree::hasComponent ( uint16  subsystemId,
uint8  nodeId,
uint8  componentId 
)

◆ hasComponentConfiguration() [1/3]

bool openjaus::model::SystemTree::hasComponentConfiguration ( ComponentInfo component)

◆ hasComponentConfiguration() [2/3]

bool openjaus::model::SystemTree::hasComponentConfiguration ( const transport::Address address)
inline

◆ hasComponentConfiguration() [3/3]

bool openjaus::model::SystemTree::hasComponentConfiguration ( uint16  subsystemId,
uint8  nodeId,
uint8  componentId 
)

◆ hasComponentIdentification() [1/3]

bool openjaus::model::SystemTree::hasComponentIdentification ( ComponentInfo component)

◆ hasComponentIdentification() [2/3]

bool openjaus::model::SystemTree::hasComponentIdentification ( const transport::Address address)
inline

◆ hasComponentIdentification() [3/3]

bool openjaus::model::SystemTree::hasComponentIdentification ( uint16  subsystemId,
uint8  nodeId,
uint8  componentId 
)

◆ hasNode() [1/2]

bool openjaus::model::SystemTree::hasNode ( const transport::Address address)
inline

◆ hasNode() [2/2]

bool openjaus::model::SystemTree::hasNode ( uint16  subsystemId,
uint8  nodeId 
)

◆ hasNodeConfiguration() [1/3]

bool openjaus::model::SystemTree::hasNodeConfiguration ( NodeInfo node)

◆ hasNodeConfiguration() [2/3]

bool openjaus::model::SystemTree::hasNodeConfiguration ( const transport::Address address)
inline

◆ hasNodeConfiguration() [3/3]

bool openjaus::model::SystemTree::hasNodeConfiguration ( uint16  subsystemId,
uint8  nodeId 
)

◆ hasNodeIdentification() [1/3]

bool openjaus::model::SystemTree::hasNodeIdentification ( NodeInfo node)

◆ hasNodeIdentification() [2/3]

bool openjaus::model::SystemTree::hasNodeIdentification ( const transport::Address address)
inline

◆ hasNodeIdentification() [3/3]

bool openjaus::model::SystemTree::hasNodeIdentification ( uint16  subsystemId,
uint8  nodeId 
)

◆ hasSubsystem() [1/2]

bool openjaus::model::SystemTree::hasSubsystem ( const transport::Address address)
inline

◆ hasSubsystem() [2/2]

bool openjaus::model::SystemTree::hasSubsystem ( uint16  subsystemId)

◆ hasSubsystemConfiguration() [1/3]

bool openjaus::model::SystemTree::hasSubsystemConfiguration ( SubsystemInfo subsystem)

◆ hasSubsystemConfiguration() [2/3]

bool openjaus::model::SystemTree::hasSubsystemConfiguration ( const transport::Address address)
inline

◆ hasSubsystemConfiguration() [3/3]

bool openjaus::model::SystemTree::hasSubsystemConfiguration ( uint16  subsystemId)

◆ hasSubsystemIdentification() [1/3]

bool openjaus::model::SystemTree::hasSubsystemIdentification ( SubsystemInfo subsystem)

◆ hasSubsystemIdentification() [2/3]

bool openjaus::model::SystemTree::hasSubsystemIdentification ( const transport::Address address)
inline

◆ hasSubsystemIdentification() [3/3]

bool openjaus::model::SystemTree::hasSubsystemIdentification ( uint16  subsystemId)

◆ instance()

SystemTree & openjaus::model::SystemTree::instance ( )
static

◆ lock()

void openjaus::model::SystemTree::lock ( )

◆ lookupComponent()

std::vector< transport::Address > openjaus::model::SystemTree::lookupComponent ( std::string  name,
transport::Address  addressHint = transport::Address(transport::Address::ANY_SUBSYSTEMtransport::Address::ANY_NODE,transport::Address::ANY_COMPONENT) 
)

◆ lookupService()

std::vector< transport::Address > openjaus::model::SystemTree::lookupService ( std::string  uri,
int  versionMajor = Service::ANY_VERSION,
int  versionMinor = Service::ANY_VERSION,
transport::Address  addressHint = transport::Address(transport::Address::ANY_SUBSYSTEMtransport::Address::ANY_NODE,transport::Address::ANY_COMPONENT) 
)

◆ removeComponent() [1/3]

bool openjaus::model::SystemTree::removeComponent ( ComponentInfo component)

◆ removeComponent() [2/3]

bool openjaus::model::SystemTree::removeComponent ( const transport::Address address)
inline

◆ removeComponent() [3/3]

bool openjaus::model::SystemTree::removeComponent ( uint16  subsystemId,
uint8  nodeId,
uint8  componentId 
)

◆ removeNode() [1/3]

bool openjaus::model::SystemTree::removeNode ( NodeInfo node)

◆ removeNode() [2/3]

bool openjaus::model::SystemTree::removeNode ( const transport::Address address)
inline

◆ removeNode() [3/3]

bool openjaus::model::SystemTree::removeNode ( uint16  subsystemId,
uint8  nodeId 
)

◆ removeOnItemAddCallback()

void openjaus::model::SystemTree::removeOnItemAddCallback ( void(*)(void *object, const transport::Address &address)  onAddItemCallback,
void *  object 
)

◆ removeOnLocalComponentAddCallback()

void openjaus::model::SystemTree::removeOnLocalComponentAddCallback ( void(*)(void *object, const transport::Address &address)  onAddLocalComponentCallback,
void *  object 
)

◆ removeOnUnsolicitedSenderAddCallback()

void openjaus::model::SystemTree::removeOnUnsolicitedSenderAddCallback ( void(*)(void *object, const transport::Address &source, const transport::Address &destination)  onAddUnsolicitedSenderCallback,
void *  object 
)

◆ removeSubsystem() [1/3]

bool openjaus::model::SystemTree::removeSubsystem ( SubsystemInfo subsystem)

◆ removeSubsystem() [2/3]

bool openjaus::model::SystemTree::removeSubsystem ( const transport::Address address)
inline

◆ removeSubsystem() [3/3]

bool openjaus::model::SystemTree::removeSubsystem ( uint16  subsystemId)

◆ replaceComponent()

bool openjaus::model::SystemTree::replaceComponent ( ComponentInfo component)

◆ setComponentIdentification()

bool openjaus::model::SystemTree::setComponentIdentification ( const transport::Address address,
std::string  name 
)

◆ setIdentification()

void openjaus::model::SystemTree::setIdentification ( const transport::Address address,
std::string  subsystemName,
std::string  nodeName,
std::string  componentName 
)

◆ setNodeIdentification()

bool openjaus::model::SystemTree::setNodeIdentification ( const transport::Address address,
std::string  name 
)

◆ setSubsystemIdentification()

bool openjaus::model::SystemTree::setSubsystemIdentification ( const transport::Address address,
std::string  name 
)

◆ setThisNode()

bool openjaus::model::SystemTree::setThisNode ( uint8  thisNode)

◆ setThisSubsytem()

bool openjaus::model::SystemTree::setThisSubsytem ( uint16  thisSubsytem)

◆ toString()

std::string openjaus::model::SystemTree::toString ( ) const
virtual

◆ toXml()

std::string openjaus::model::SystemTree::toXml ( unsigned char  level = 0) const

◆ unlock()

void openjaus::model::SystemTree::unlock ( )

Friends And Related Function Documentation

◆ operator<< [1/2]

OPENJAUS_EXPORT friend std::ostream& operator<< ( std::ostream &  output,
const SystemTree object 
)
friend

◆ operator<< [2/2]

OPENJAUS_EXPORT friend std::ostream& operator<< ( std::ostream &  output,
const SystemTree object 
)
friend

Member Data Documentation

◆ mutex

system::Mutex openjaus::model::SystemTree::mutex
private

◆ onItemAddCallbacks

std::vector<SystemTree::Callback> openjaus::model::SystemTree::onItemAddCallbacks
private

◆ onItemAddCallbacksLock

system::Mutex openjaus::model::SystemTree::onItemAddCallbacksLock
private

◆ onLocalComponentAddCallbacks

std::vector<SystemTree::Callback> openjaus::model::SystemTree::onLocalComponentAddCallbacks
private

◆ onLocalComponentAddCallbacksLock

system::Mutex openjaus::model::SystemTree::onLocalComponentAddCallbacksLock
private

◆ onUnsolicitedSenderAddCallbacks

std::vector<SystemTree::Callback> openjaus::model::SystemTree::onUnsolicitedSenderAddCallbacks
private

◆ onUnsolicitedSenderAddCallbacksLock

system::Mutex openjaus::model::SystemTree::onUnsolicitedSenderAddCallbacksLock
private

◆ subsystems

std::map<uint16, SubsystemInfo*> openjaus::model::SystemTree::subsystems
private

◆ thisNode

uint8 openjaus::model::SystemTree::thisNode
private

◆ thisSubsytem

uint16 openjaus::model::SystemTree::thisSubsytem
private

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