#include <descriptions-manager.h>
Classes | |
struct | NodeDescription |
Potentially partial Descriptions of nodes along with their reception status. More... | |
Public Member Functions | |
const TargetDescription *const | getDescription (unsigned nodeId, bool *ok=0) const |
Return the description of a node and set ok to true, if provided; if invalid, return 0 and set ok to false. | |
const TargetDescription *const | getDescription (unsigned nodeId, bool *ok=0) const |
Return the description of a node and set ok to true, if provided; if invalid, return 0 and set ok to false. | |
unsigned | getNodeId (const std::string &name, bool *ok=0) const |
Return the id of the node corresponding to name and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false. | |
unsigned | getNodeId (const std::string &name, bool *ok=0) const |
Return the id of the node corresponding to name and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false. | |
std::string | getNodeName (unsigned nodeId) const |
Return the name corresponding to a node identifier; if invalid, return the empty string. | |
std::string | getNodeName (unsigned nodeId) const |
Return the name corresponding to a node identifier; if invalid, return the empty string. | |
unsigned | getVariablePos (unsigned nodeId, const std::string &name, bool *ok=0) const |
Return the position of a variable and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false. | |
unsigned | getVariablePos (unsigned nodeId, const std::string &name, bool *ok=0) const |
Return the position of a variable and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false. | |
unsigned | getVariableSize (unsigned nodeId, const std::string &name, bool *ok=0) const |
Return the length of a variable and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false. | |
unsigned | getVariableSize (unsigned nodeId, const std::string &name, bool *ok=0) const |
Return the length of a variable and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false. | |
void | processMessage (const Message *message) |
Process a message and reconstruct descriptions if relevant. | |
void | processMessage (const Message *message) |
Process a message and reconstruct descriptions if relevant. | |
virtual | ~DescriptionsManager () |
Virtual destructor. | |
virtual | ~DescriptionsManager () |
Virtual destructor. | |
Protected Types | |
typedef std::map< unsigned, NodeDescription > | NodesDescriptionsMap |
Map from nodes id to nodes descriptions. | |
typedef std::map< unsigned, NodeDescription > | NodesDescriptionsMap |
Map from nodes id to nodes descriptions. | |
Protected Member Functions | |
void | checkIfNodeDescriptionComplete (unsigned id, const NodeDescription &description) |
Check if a node description has been fully received, and if so, call the nodeDescriptionReceived() virtual function. | |
void | checkIfNodeDescriptionComplete (unsigned id, const NodeDescription &description) |
Check if a node description has been fully received, and if so, call the nodeDescriptionReceived() virtual function. | |
virtual void | nodeDescriptionReceived (unsigned nodeId) |
Virtual function that is called when a node description has been fully received. | |
virtual void | nodeDescriptionReceived (unsigned nodeId) |
Virtual function that is called when a node description has been fully received. | |
virtual void | nodeProtocolVersionMismatch (const std::string &nodeName, uint16 protocolVersion) |
Virtual function that is called when a version mismatches. | |
virtual void | nodeProtocolVersionMismatch (const std::string &nodeName, uint16 protocolVersion) |
Virtual function that is called when a version mismatches. | |
Protected Attributes | |
NodesDescriptionsMap | nodesDescriptions |
all known nodes descriptions |
This helper class builds complete descriptions out of multiple message parts. For now, it does not support the disconnection of a whole network nor the update of the description of any node
Definition at line 34 of file descriptions-manager.h.
typedef std::map<unsigned, NodeDescription> Aseba::DescriptionsManager::NodesDescriptionsMap [protected] |
Map from nodes id to nodes descriptions.
Definition at line 51 of file descriptions-manager.h.
typedef std::map<unsigned, NodeDescription> Aseba::DescriptionsManager::NodesDescriptionsMap [protected] |
Map from nodes id to nodes descriptions.
Definition at line 48 of file descriptions-manager.h.
virtual Aseba::DescriptionsManager::~DescriptionsManager | ( | ) | [inline, virtual] |
Virtual destructor.
Definition at line 53 of file descriptions-manager.h.
virtual Aseba::DescriptionsManager::~DescriptionsManager | ( | ) | [inline, virtual] |
Virtual destructor.
Definition at line 56 of file descriptions-manager.h.
void Aseba::DescriptionsManager::checkIfNodeDescriptionComplete | ( | unsigned | id, | |
const NodeDescription & | description | |||
) | [protected] |
Check if a node description has been fully received, and if so, call the nodeDescriptionReceived() virtual function.
void Aseba::DescriptionsManager::checkIfNodeDescriptionComplete | ( | unsigned | id, | |
const NodeDescription & | description | |||
) | [protected] |
Check if a node description has been fully received, and if so, call the nodeDescriptionReceived() virtual function.
Definition at line 133 of file descriptions-manager.cpp.
const TargetDescription* const Aseba::DescriptionsManager::getDescription | ( | unsigned | nodeId, | |
bool * | ok = 0 | |||
) | const |
Return the description of a node and set ok to true, if provided; if invalid, return 0 and set ok to false.
const TargetDescription *const Aseba::DescriptionsManager::getDescription | ( | unsigned | nodeId, | |
bool * | ok = 0 | |||
) | const |
Return the description of a node and set ok to true, if provided; if invalid, return 0 and set ok to false.
Definition at line 175 of file descriptions-manager.cpp.
unsigned Aseba::DescriptionsManager::getNodeId | ( | const std::string & | name, | |
bool * | ok = 0 | |||
) | const |
Return the id of the node corresponding to name and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false.
unsigned Aseba::DescriptionsManager::getNodeId | ( | const std::string & | name, | |
bool * | ok = 0 | |||
) | const |
Return the id of the node corresponding to name and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false.
Definition at line 156 of file descriptions-manager.cpp.
std::string Aseba::DescriptionsManager::getNodeName | ( | unsigned | nodeId | ) | const |
Return the name corresponding to a node identifier; if invalid, return the empty string.
std::string Aseba::DescriptionsManager::getNodeName | ( | unsigned | nodeId | ) | const |
Return the name corresponding to a node identifier; if invalid, return the empty string.
Definition at line 143 of file descriptions-manager.cpp.
unsigned Aseba::DescriptionsManager::getVariablePos | ( | unsigned | nodeId, | |
const std::string & | name, | |||
bool * | ok = 0 | |||
) | const |
Return the position of a variable and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false.
unsigned Aseba::DescriptionsManager::getVariablePos | ( | unsigned | nodeId, | |
const std::string & | name, | |||
bool * | ok = 0 | |||
) | const |
Return the position of a variable and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false.
Definition at line 192 of file descriptions-manager.cpp.
unsigned Aseba::DescriptionsManager::getVariableSize | ( | unsigned | nodeId, | |
const std::string & | name, | |||
bool * | ok = 0 | |||
) | const |
Return the length of a variable and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false.
unsigned Aseba::DescriptionsManager::getVariableSize | ( | unsigned | nodeId, | |
const std::string & | name, | |||
bool * | ok = 0 | |||
) | const |
Return the length of a variable and set ok to true, if provided; if invalid, return 0xFFFFFFFF and set ok to false.
Definition at line 218 of file descriptions-manager.cpp.
virtual void Aseba::DescriptionsManager::nodeDescriptionReceived | ( | unsigned | nodeId | ) | [inline, protected, virtual] |
Virtual function that is called when a node description has been fully received.
Reimplemented in Aseba::AsebaNetworkInterface, Aseba::SignalingDescriptionsManager, and AsebaROS.
Definition at line 82 of file descriptions-manager.h.
virtual void Aseba::DescriptionsManager::nodeDescriptionReceived | ( | unsigned | nodeId | ) | [inline, protected, virtual] |
Virtual function that is called when a node description has been fully received.
Reimplemented in Aseba::AsebaNetworkInterface, Aseba::SignalingDescriptionsManager, and AsebaROS.
Definition at line 79 of file descriptions-manager.h.
virtual void Aseba::DescriptionsManager::nodeProtocolVersionMismatch | ( | const std::string & | nodeName, | |
uint16 | protocolVersion | |||
) | [inline, protected, virtual] |
Virtual function that is called when a version mismatches.
Reimplemented in Aseba::SignalingDescriptionsManager.
Definition at line 79 of file descriptions-manager.h.
virtual void Aseba::DescriptionsManager::nodeProtocolVersionMismatch | ( | const std::string & | nodeName, | |
uint16 | protocolVersion | |||
) | [inline, protected, virtual] |
Virtual function that is called when a version mismatches.
Reimplemented in Aseba::SignalingDescriptionsManager.
Definition at line 76 of file descriptions-manager.h.
void Aseba::DescriptionsManager::processMessage | ( | const Message * | message | ) |
Process a message and reconstruct descriptions if relevant.
void Aseba::DescriptionsManager::processMessage | ( | const Message * | message | ) |
Process a message and reconstruct descriptions if relevant.
Definition at line 46 of file descriptions-manager.cpp.
all known nodes descriptions
Definition at line 49 of file descriptions-manager.h.