OpenJAUS Software Development Kit  4.3.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
openjaus::core::services::Discovery Class Reference

Provides static methods for the Discovery service. More...

#include <Discovery.h>

Inherits openjaus::core::DiscoveryInterface, and openjaus::core::services::Events.

Inherited by openjaus::core::EventsBase [virtual].

Public Member Functions

 Discovery ()
 
virtual ~Discovery ()
 
virtual bool publishServices (RegisterServices *registerServices)
 PublishServices action with input RegisterServices. More...
 
virtual ReportIdentification getReportIdentification (QueryIdentification *queryIdentification)
 Send a Report Identification message to the component that sent the query. More...
 
virtual ReportConfiguration getReportConfiguration (QueryConfiguration *queryConfiguration)
 Send a Report Configuration message to the component that sent the query. More...
 
virtual ReportSubsystemList getReportSubsystemList (QuerySubsystemList *querySubsystemList)
 Send a Report Subsystems List message to the component that sent the query. More...
 
virtual ReportServices getReportServices (QueryServices *queryServices)
 Send a Report Services message to the component that sent the query. More...
 
virtual ReportServiceList getReportServiceList (QueryServiceList *queryServiceList)
 Send a Report Service List message to the component that sent the query Send a Report Service List message to the component that sent the query. More...
 
void startService ()
 
void stopService ()
 
- Public Member Functions inherited from openjaus::core::DiscoveryInterface
virtual ~DiscoveryInterface ()
 
- Public Member Functions inherited from openjaus::core::EventsInterface
virtual ~EventsInterface ()
 
- Public Member Functions inherited from openjaus::core::TransportInterface
virtual ~TransportInterface ()
 
- Public Member Functions inherited from openjaus::core::services::Events
 Events ()
 
virtual ~Events ()
 
virtual bool createEvent (CreateEvent *createEvent)
 CreateEvent action with input CreateEvent. More...
 
virtual bool processEvent (ProcessEventRequest *processEventRequest)
 ProcessEvent action with input ProcessEventRequest. More...
 
virtual bool resetEventTimer (CreateEvent *createEvent)
 ResetEventTimer action with input CreateEvent. More...
 
virtual bool resetEventTimer (UpdateEvent *updateEvent)
 ResetEventTimer action with input UpdateEvent. More...
 
virtual bool updateEvent (CreateEvent *createEvent)
 UpdateEvent action with input CreateEvent. More...
 
virtual bool updateEvent (UpdateEvent *updateEvent)
 UpdateEvent action with input UpdateEvent. More...
 
virtual bool cancelEvent (CancelEvent *cancelEvent)
 CancelEvent action with input CancelEvent. More...
 
virtual bool stopEventTimer (CancelEvent *cancelEvent)
 StopEventTimer action with input CancelEvent. More...
 
virtual RejectEventRequest getRejectEventRequest (CreateEvent *createEvent)
 Send action for RejectEventRequest with input message CreateEvent. More...
 
virtual RejectEventRequest getRejectEventRequest (UpdateEvent *updateEvent)
 Send action for RejectEventRequest with input message UpdateEvent. More...
 
virtual RejectEventRequest getRejectEventRequest (CancelEvent *cancelEvent)
 Send action for RejectEventRequest with input message CancelEvent. More...
 
virtual ConfirmEventRequest getConfirmEventRequest (CreateEvent *createEvent)
 Send action for ConfirmEventRequest with input message CreateEvent. More...
 
virtual ConfirmEventRequest getConfirmEventRequest (UpdateEvent *updateEvent)
 Send action for ConfirmEventRequest with input message UpdateEvent. More...
 
virtual ConfirmEventRequest getConfirmEventRequest (CancelEvent *cancelEvent)
 Send action for ConfirmEventRequest with input message CancelEvent. More...
 
virtual ReportEvents getReportEvents (QueryEvents *queryEvents)
 Send action for ReportEvents with input message QueryEvents. More...
 
virtual ReportEventTimeout getReportEventTimeout (QueryEventTimeout *queryEventTimeout)
 Send action for ReportEventTimeout with input message QueryEventTimeout. More...
 
virtual bool confirmEvent (ConfirmEventRequest *confirmEventRequest)
 ConfirmEvent action with input ConfirmEventRequest. More...
 
virtual bool rejectEvent (RejectEventRequest *rejectEventRequest)
 RejectEvent action with input RejectEventRequest. More...
 
virtual bool handleIncomingEvent (Event *event)
 HandleIncomingEvent action with input Event. More...
 
virtual bool handleReportEvents (ReportEvents *reportEvents)
 HandleReportEvents action with input ReportEvents. More...
 
virtual bool isSupported (CreateEvent *createEvent)
 isSupported condition. More...
 
virtual bool isSupported (UpdateEvent *updateEvent)
 isSupported condition. More...
 
virtual bool eventExists (CreateEvent *createEvent)
 eventExists condition. More...
 
virtual bool eventExists (UpdateEvent *updateEvent)
 eventExists condition. More...
 
virtual bool eventExists (CancelEvent *cancelEvent)
 eventExists condition. More...
 
bool createOutgoingPeriodicEvent (uint8_t eventId, double rateHz, model::Message *query)
 
bool createOutgoingOnChangeEvent (uint8_t eventId, model::Message *query)
 
OPENJAUS_DEPRECATED bool publish (model::Message *message)
 
OPENJAUS_DEPRECATED bool unpublish (model::Message *message)
 
OPENJAUS_DEPRECATED bool publish (uint16 messageId)
 
bool publish (uint16 messageId, double maximumRate_Hz, model::ConnectionType type)
 
bool unpublish (uint16 messageId)
 
bool notifyChanged (uint16 messageId)
 
uint32_t subscribePeriodic (transport::Address &address, model::Message *query, double rate_Hz)
 
uint32_t subscribePeriodic (transport::Address &address, model::Message *query, double rate_Hz, void(*subscribeCallback)(const model::EventRequestResponseArgs &args))
 
uint32_t subscribePeriodic (transport::Address &address, model::Message *query, double rate_Hz, void(*subscribeCallback)(void *object, const model::EventRequestResponseArgs &args), void *object)
 
uint32_t subscribeOnChange (transport::Address &address, model::Message *query)
 
uint32_t subscribeOnChange (transport::Address &address, model::Message *query, void(*subscribeCallback)(const model::EventRequestResponseArgs &args))
 
uint32_t subscribeOnChange (transport::Address &address, model::Message *query, void(*subscribeCallback)(void *object, const model::EventRequestResponseArgs &args), void *object)
 
bool unsubscribe (uint32_t subscriptionId)
 
bool unsubscribe (uint32_t subscriptionId, void(*callback)(const model::EventRequestResponseArgs &args))
 
bool unsubscribe (uint32_t subscriptionId, void(*callback)(void *object, const model::EventRequestResponseArgs &args), void *object)
 
bool isActive (uint32 subscriptionId)
 
uint8 getEventId (uint32 subscriptionId)
 
double getConfirmedRate_Hz (uint32 subscriptionId)
 
bool updatePeriodic (uint32 subscriptionId, double rate_Hz)
 
- Public Member Functions inherited from openjaus::core::services::Transport
 Transport ()
 
virtual ~Transport ()
 
virtual bool enqueue (model::Trigger *trigger)
 Convert the destination address into an unsigned integer such that the ComponentID maps to the least significant byte, NodeID to the next least significant byte and SubsystemID maps onto the remaining two bytes of the integer. More...
 
virtual bool broadcastLocalEnqueue (model::Trigger *trigger)
 Package the message as specified by the transport layer specification and send it to all endpoints in the local subsystem. More...
 
virtual bool broadcastGlobalEnqueue (model::Trigger *trigger)
 Package the message as specified by the transport layer specification and send it to all endpoints on all subsystems. More...
 
virtual bool sendMessage (model::Trigger *trigger)
 SendMessage action with input SendMessage. More...
 
virtual bool broadcastToNode (model::Trigger *trigger)
 Broadcasts message to all components within the local node Broadcasts message to all components within the local node. More...
 
virtual bool broadcastToSubsystem (model::Trigger *trigger)
 Broadcasts a given message to all nodes in the local subsystem (equivalent to broadcast local enqueue) Broadcasts a given message to all nodes in the local subsystem (equivalent to broadcast local enqueue) More...
 
virtual bool broadcastToSystem (model::Trigger *trigger)
 Broadcasts the message to all subsystems on the JAUS network (equivalent to broadcast global enqueue) Broadcasts the message to all subsystems on the JAUS network (equivalent to broadcast global enqueue) More...
 
virtual bool checkTransportPolicy (model::Trigger *trigger)
 CheckTransportPolicy action with input CheckTransportPolicy. More...
 
virtual ReportTransportPolicy getReportTransportPolicy (QueryTransportPolicy *queryTransportPolicy)
 Send action for ReportTransportPolicy with input message QueryTransportPolicy. More...
 
virtual bool storeTransportPolicy (ReportTransportPolicy *reportTransportPolicy)
 StoreTransportPolicy action with input ReportTransportPolicy. More...
 
model::StategetCurrentState ()
 
void addAckNakCallback (void(*callback)(const transport::AckNakEventArgs &args))
 Adds a static callback that will execute when an ACK/NAK events occurs on the JUDP Interface. More...
 
void addAckNakCallback (void(*callback)(void *object, const transport::AckNakEventArgs &args), void *object)
 Adds a class callback that will execute when an ACK/NAK events occurs on the JUDP Interface. More...
 
template<class MessageType , class CallbackClass >
void addMessageCallback (bool(CallbackClass::*callback)(MessageType &messageRef), CallbackClass *object)
 
template<class CallbackClass >
void addMessageCallback (bool(CallbackClass::*callback)(model::Trigger *trigger), CallbackClass *object)
 
template<class MessageType >
void addMessageCallback (bool(*callback)(MessageType &messageRef))
 

Static Public Member Functions

static const char * uri ()
 The URI for the Service. More...
 
static model::Servicecreate ()
 Builds a default instance of the Discovery Service and populates the URI and Version numbers. More...
 
- Static Public Member Functions inherited from openjaus::core::DiscoveryInterface
static OPENJAUS_DEPRECATED model::Service DiscoveryService ()
 Builds a default instance of the Discovery Service and populates the URI and Version numbers. More...
 
static OPENJAUS_DEPRECATED std::string DiscoveryUri ()
 Static accessor for Service URI. More...
 
- Static Public Member Functions inherited from openjaus::core::EventsInterface
static OPENJAUS_DEPRECATED model::Service EventsService ()
 Builds a default instance of the Events Service and populates the URI and Version numbers. More...
 
static OPENJAUS_DEPRECATED std::string EventsUri ()
 Static accessor for Service URI. More...
 
- Static Public Member Functions inherited from openjaus::core::TransportInterface
static OPENJAUS_DEPRECATED model::Service TransportService ()
 Builds a default instance of the Transport Service and populates the URI and Version numbers. More...
 
static OPENJAUS_DEPRECATED std::string TransportUri ()
 Static accessor for Service URI. More...
 
- Static Public Member Functions inherited from openjaus::core::services::Events
static const char * uri ()
 The URI for the Service. More...
 
static model::Servicecreate ()
 Builds a default instance of the Events Service and populates the URI and Version numbers. More...
 
- Static Public Member Functions inherited from openjaus::core::services::Transport
static const char * uri ()
 The URI for the Service. More...
 
static model::Servicecreate ()
 Builds a default instance of the Transport Service and populates the URI and Version numbers. More...
 

Protected Member Functions

void setSystemTree (model::SystemTree *systemTree)
 
void setServices (std::vector< model::Service *> *serviceList)
 
void configure (DiscoverySettingsInterface *settings)
 
- Protected Member Functions inherited from openjaus::core::services::Events
void configure (EventsSettingsInterface *settings)
 
void startService ()
 
void stopService ()
 
- Protected Member Functions inherited from openjaus::core::services::Transport
void configure (services::TransportSettingsInterface *settings)
 
void setComponentAddress (transport::Address *address)
 
void setReceiveQueue (system::PriorityQueue *queue)
 
void setSubsInterface (transport::Interface *interface)
 
void setNodeInterface (transport::Interface *interface)
 
void setComponentInterface (transport::Interface *interface)
 
void setJtcpInterface (transport::AS5669::JtcpInterface *interface)
 
void fireEvent (model::InternalEvent *event)
 
void sendToSelf (transport::Wrapper *wrapper)
 
transport::Address *& getComponentAddress ()
 

Private Member Functions

core::RSLSubsystemRecord reportServiceListGetSubsystem (core::QSLSubsystemRecord &querySubsRec)
 
core::ServicesNodeRecord reportServiceListGetNode (uint16 subsId, core::QSLNodeRecord &queryNodeRec)
 
core::ServicesComponentRecord reportServiceListGetComponent (uint16 subsId, uint8 nodeId, core::QSLComponentRecord &queryCmptRec)
 
void handleLocalComponentAdd (const transport::Address &address)
 
void sendQueryIdentification (core::SystemLevelEnumeration::SystemLevelEnum queryLevel, const transport::Address &destination)
 
std::vector< std::pair< uint8_t, std::vector< uint8_t > > > buildRequestedIds (core::QSNodeList &nodeList)
 
void populateReportedNodeList (std::vector< std::pair< uint8_t, std::vector< uint8_t > > > &requestedIds, model::SubsystemInfo &subsystem, core::ServicesNodeList &nodeList)
 
void addComponentsOnNode (uint8_t nodeId, std::vector< uint8_t > &cmptIds, model::SubsystemInfo &subsystem, core::ServicesNodeList &nodeList)
 
void addComponentsOnAllNodes (std::vector< uint8_t > &cmptIds, model::SubsystemInfo &subsystem, core::ServicesNodeList &nodeList)
 
void addComponentsOnNode (std::vector< uint8_t > &cmptIds, const model::NodeInfo *const node, core::ServicesNodeList &nodeList)
 
void addComponentsOnNode (std::vector< uint8_t > &cmptIds, const model::NodeInfo *const node, core::ServicesNodeRecord &nodeRecord)
 
void addAllNodes (std::vector< uint8_t > &cmptIds, core::ServicesNodeList &nodeList, const std::map< unsigned char, model::NodeInfo *> &nodeMap)
 
void addNode (uint8_t nodeId, std::vector< uint8_t > &cmptIds, core::ServicesNodeList &nodeList, const std::map< unsigned char, model::NodeInfo *> &nodeMap)
 
void addComponent (uint8_t cmptId, const model::NodeInfo *const node, core::ServicesNodeRecord &nodeRecord)
 
void addAllComponents (const model::NodeInfo *const node, core::ServicesNodeRecord &nodeRecord)
 
void addComponent (const model::ComponentInfo *const cmpt, ServicesComponentList &cmptList)
 
void addAllServices (const model::ComponentInfo *const cmpt, ServicesComponentRecord &cmptRecord)
 
void addService (const model::Service *const service, core::ServicesServiceList &serviceList)
 

Private Attributes

DiscoveryLoopback discoveryLoopback
 
model::SystemTreesystemTree
 
DiscoverySettingsInterfacesettings
 
std::vector< model::Service * > * myServiceList
 

Additional Inherited Members

- Protected Attributes inherited from openjaus::core::services::Transport
model::StateMachine receive
 
model::State receivingState
 

Detailed Description

Constructor & Destructor Documentation

§ Discovery()

openjaus::core::services::Discovery::Discovery ( )

§ ~Discovery()

openjaus::core::services::Discovery::~Discovery ( )
virtual

Member Function Documentation

§ addAllComponents()

void openjaus::core::services::Discovery::addAllComponents ( const model::NodeInfo *const  node,
core::ServicesNodeRecord nodeRecord 
)
private

§ addAllNodes()

void openjaus::core::services::Discovery::addAllNodes ( std::vector< uint8_t > &  cmptIds,
core::ServicesNodeList nodeList,
const std::map< unsigned char, model::NodeInfo *> &  nodeMap 
)
private

§ addAllServices()

void openjaus::core::services::Discovery::addAllServices ( const model::ComponentInfo *const  cmpt,
ServicesComponentRecord cmptRecord 
)
private

§ addComponent() [1/2]

void openjaus::core::services::Discovery::addComponent ( uint8_t  cmptId,
const model::NodeInfo *const  node,
core::ServicesNodeRecord nodeRecord 
)
private

§ addComponent() [2/2]

void openjaus::core::services::Discovery::addComponent ( const model::ComponentInfo *const  cmpt,
ServicesComponentList cmptList 
)
private

§ addComponentsOnAllNodes()

void openjaus::core::services::Discovery::addComponentsOnAllNodes ( std::vector< uint8_t > &  cmptIds,
model::SubsystemInfo subsystem,
core::ServicesNodeList nodeList 
)
private

§ addComponentsOnNode() [1/3]

void openjaus::core::services::Discovery::addComponentsOnNode ( uint8_t  nodeId,
std::vector< uint8_t > &  cmptIds,
model::SubsystemInfo subsystem,
core::ServicesNodeList nodeList 
)
private

§ addComponentsOnNode() [2/3]

void openjaus::core::services::Discovery::addComponentsOnNode ( std::vector< uint8_t > &  cmptIds,
const model::NodeInfo *const  node,
core::ServicesNodeList nodeList 
)
private

§ addComponentsOnNode() [3/3]

void openjaus::core::services::Discovery::addComponentsOnNode ( std::vector< uint8_t > &  cmptIds,
const model::NodeInfo *const  node,
core::ServicesNodeRecord nodeRecord 
)
private

§ addNode()

void openjaus::core::services::Discovery::addNode ( uint8_t  nodeId,
std::vector< uint8_t > &  cmptIds,
core::ServicesNodeList nodeList,
const std::map< unsigned char, model::NodeInfo *> &  nodeMap 
)
private

§ addService()

void openjaus::core::services::Discovery::addService ( const model::Service *const  service,
core::ServicesServiceList serviceList 
)
private

§ buildRequestedIds()

std::vector<std::pair<uint8_t, std::vector<uint8_t> > > openjaus::core::services::Discovery::buildRequestedIds ( core::QSNodeList nodeList)
private

§ configure()

void openjaus::core::services::Discovery::configure ( DiscoverySettingsInterface settings)
protected

§ create()

model::Service * openjaus::core::services::Discovery::create ( )
static
Returns
model::Service - The populated service.

§ getReportConfiguration()

core::ReportConfiguration openjaus::core::services::Discovery::getReportConfiguration ( QueryConfiguration queryConfiguration)
virtual

Send a Report Configuration message to the component that sent the query.

Parameters
[in]queryConfiguration- Input Trigger.
Returns
ReportConfiguration Output Message.

Implements openjaus::core::DiscoveryInterface.

§ getReportIdentification()

core::ReportIdentification openjaus::core::services::Discovery::getReportIdentification ( QueryIdentification queryIdentification)
virtual

Send a Report Identification message to the component that sent the query.

Parameters
[in]queryIdentification- Input Trigger.
Returns
ReportIdentification Output Message.

Implements openjaus::core::DiscoveryInterface.

§ getReportServiceList()

core::ReportServiceList openjaus::core::services::Discovery::getReportServiceList ( QueryServiceList queryServiceList)
virtual
Parameters
[in]queryServiceList- Input Trigger.
Returns
ReportServiceList Output Message.

Implements openjaus::core::DiscoveryInterface.

§ getReportServices()

core::ReportServices openjaus::core::services::Discovery::getReportServices ( QueryServices queryServices)
virtual

Send a Report Services message to the component that sent the query.

Parameters
[in]queryServices- Input Trigger.
Returns
ReportServices Output Message.

Implements openjaus::core::DiscoveryInterface.

§ getReportSubsystemList()

core::ReportSubsystemList openjaus::core::services::Discovery::getReportSubsystemList ( QuerySubsystemList querySubsystemList)
virtual

Send a Report Subsystems List message to the component that sent the query.

Parameters
[in]querySubsystemList- Input Trigger.
Returns
ReportSubsystemList Output Message.

Implements openjaus::core::DiscoveryInterface.

§ handleLocalComponentAdd()

void openjaus::core::services::Discovery::handleLocalComponentAdd ( const transport::Address address)
private

§ populateReportedNodeList()

void openjaus::core::services::Discovery::populateReportedNodeList ( std::vector< std::pair< uint8_t, std::vector< uint8_t > > > &  requestedIds,
model::SubsystemInfo subsystem,
core::ServicesNodeList nodeList 
)
private

§ publishServices()

bool openjaus::core::services::Discovery::publishServices ( RegisterServices registerServices)
virtual

PublishServices action with input RegisterServices.

Parameters
[in]registerServices- Input Trigger.
Returns
Whether the message was properly processed by this action.

Implements openjaus::core::DiscoveryInterface.

§ reportServiceListGetComponent()

core::ServicesComponentRecord openjaus::core::services::Discovery::reportServiceListGetComponent ( uint16  subsId,
uint8  nodeId,
core::QSLComponentRecord queryCmptRec 
)
private

§ reportServiceListGetNode()

core::ServicesNodeRecord openjaus::core::services::Discovery::reportServiceListGetNode ( uint16  subsId,
core::QSLNodeRecord queryNodeRec 
)
private

§ reportServiceListGetSubsystem()

core::RSLSubsystemRecord openjaus::core::services::Discovery::reportServiceListGetSubsystem ( core::QSLSubsystemRecord querySubsRec)
private

§ sendQueryIdentification()

void openjaus::core::services::Discovery::sendQueryIdentification ( core::SystemLevelEnumeration::SystemLevelEnum  queryLevel,
const transport::Address destination 
)
private

§ setServices()

void openjaus::core::services::Discovery::setServices ( std::vector< model::Service *> *  serviceList)
protected

§ setSystemTree()

void openjaus::core::services::Discovery::setSystemTree ( model::SystemTree systemTree)
protected

§ startService()

void openjaus::core::services::Discovery::startService ( )

§ stopService()

void openjaus::core::services::Discovery::stopService ( )

§ uri()

const char * openjaus::core::services::Discovery::uri ( )
static
Returns
const char* - The URI.

Member Data Documentation

§ discoveryLoopback

DiscoveryLoopback openjaus::core::services::Discovery::discoveryLoopback
private

§ myServiceList

std::vector<model::Service*>* openjaus::core::services::Discovery::myServiceList
private

§ settings

DiscoverySettingsInterface* openjaus::core::services::Discovery::settings
private

§ systemTree

model::SystemTree* openjaus::core::services::Discovery::systemTree
private

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