Ocean
|
This class implements the base class for a container for debug elements. More...
Data Structures | |
class | ScopedHierarchyBase |
This class implements a scoped hierarchy. More... | |
Public Types | |
typedef std::vector< std::string > | Hierarchy |
Definition of a vector holding strings (a hierarchy). More... | |
typedef Callback< void, const uint32_t, const Frame *, const Hierarchy * > | ElementUpdateCallback |
Definition of a callback function for an updated debug element. More... | |
Public Member Functions | |
bool | isElementActive (const uint32_t elementId) const |
Returns whether a specific debug elements is activated. More... | |
void | activateElement (const uint32_t elementId) |
Activates a specific debug element. More... | |
void | deactivateElement (const uint32_t elementId) |
Deactivates a specific debug element. More... | |
void | activateAllElements () |
Explicitly activates all elements (to avoid defining all active elements individually). More... | |
void | pushHierarchyItem (const std::string &hierarchyItem) |
Pushes a new hierarchy. More... | |
void | popHierarchyItem () |
Pops the most recent hierarchy item. More... | |
void | updateElement (const uint32_t elementId, Frame &&frame) |
Updates the debug information of a specific debug element. More... | |
void | updateElement (const uint32_t elementId, Frame &&frame, const Hierarchy &explicitHierarchy) |
Updates the debug information of a specific debug element. More... | |
void | updateElement (const uint32_t elementId, const Frame &frame) |
Updates the debug information of a specific debug element. More... | |
void | updateElement (const uint32_t elementId, const Frame &frame, const Hierarchy &explicitHierarchy) |
Updates the debug information of a specific debug element. More... | |
Frame | element (const uint32_t elementId, const bool popElement=false) |
Returns the most recent debug frame of a specific debug element. More... | |
Frame | element (const uint32_t elementId, const Hierarchy &hierarchy, const bool popElement=false) |
Returns the most recent debug frame of a specific debug element. More... | |
bool | elementIfActivate (const uint32_t elementId, Frame &frame, const bool popElement=false) |
Returns the most recent debug frame of a specific debug element if the debug element is activate and exists. More... | |
bool | elementIfActivate (const uint32_t elementId, Frame &frame, const Hierarchy &hierarchy, const bool popElement=false) |
Returns the most recent debug frame of a specific debug element if the debug element is activate and exists. More... | |
std::vector< Hierarchy > | hierarchies (const uint32_t elementId) const |
Returns all existing hierarchies for a given element id. More... | |
void | setElementUpdateCallback (const ElementUpdateCallback &callback) |
Sets the optional callback function for updated debug element. More... | |
Protected Types | |
typedef std::map< Hierarchy, Frame > | HierarchyMap |
Definition of a map mapping hierarchies to frames. More... | |
typedef std::map< uint32_t, HierarchyMap > | ElementMap |
Definition of a map mapping element ids to hierarchy maps. More... | |
typedef std::unordered_set< uint32_t > | ElementSet |
Definition of a set holding element ids. More... | |
Protected Member Functions | |
DebugElements () | |
Protected default constructor. More... | |
Protected Attributes | |
ElementSet | activeElements_ |
The set holding activate debug element ids. More... | |
bool | allElementsActivate_ |
True, if all debug elements are activated (this state overrides the individual ids of activeIds_ ). More... | |
ElementMap | elementMap_ |
The map mapping ids to frames. More... | |
Hierarchy | hierarchy_ |
The current hierarchy. More... | |
ElementUpdateCallback | elementUpdateCallback_ |
Optional callback function for updated debug elements. More... | |
Lock | lock_ |
The data lock. More... | |
This class implements the base class for a container for debug elements.
To use this class, create an own singleton class and derive from this object.
|
protected |
Definition of a map mapping element ids to hierarchy maps.
|
protected |
Definition of a set holding element ids.
typedef Callback<void, const uint32_t, const Frame*, const Hierarchy*> Ocean::DebugElements::ElementUpdateCallback |
Definition of a callback function for an updated debug element.
typedef std::vector<std::string> Ocean::DebugElements::Hierarchy |
Definition of a vector holding strings (a hierarchy).
|
protected |
Definition of a map mapping hierarchies to frames.
|
inlineprotected |
Protected default constructor.
void Ocean::DebugElements::activateAllElements | ( | ) |
Explicitly activates all elements (to avoid defining all active elements individually).
Beware: Activating a couple of debug elements (and preparing the debug data in particular) can reduce the performance.
void Ocean::DebugElements::activateElement | ( | const uint32_t | elementId | ) |
Activates a specific debug element.
elementId | The id of the element to activate |
void Ocean::DebugElements::deactivateElement | ( | const uint32_t | elementId | ) |
Deactivates a specific debug element.
elementId | The id of the element to activate |
Frame Ocean::DebugElements::element | ( | const uint32_t | elementId, |
const bool | popElement = false |
||
) |
Returns the most recent debug frame of a specific debug element.
If more than one debug element with individual hierarchies exist, one of the elements will be returned.
Beware: Due to performance reasons, the specific debug element must be activated before calling this function.
elementId | The id for which the frame will be returned |
popElement | True, to remove the debug element; False, to keep the debug element until it gets updated again |
Frame Ocean::DebugElements::element | ( | const uint32_t | elementId, |
const Hierarchy & | hierarchy, | ||
const bool | popElement = false |
||
) |
Returns the most recent debug frame of a specific debug element.
Beware: Due to performance reasons, the specific debug element must be activated before calling this function.
elementId | The id for which the frame will be returned |
hierarchy | The hierarchy for which the element will be returned |
popElement | True, to remove the debug element; False, to keep the debug element until it gets updated again |
bool Ocean::DebugElements::elementIfActivate | ( | const uint32_t | elementId, |
Frame & | frame, | ||
const bool | popElement = false |
||
) |
Returns the most recent debug frame of a specific debug element if the debug element is activate and exists.
If more than one debug element with individual hierarchies exist, one of the elements will be returned.
elementId | The id for which the frame will be returned |
frame | The resulting copy of the debug frame which is associated with the id |
popElement | True, to remove the debug element; False, to keep the debug element until it gets updated again |
bool Ocean::DebugElements::elementIfActivate | ( | const uint32_t | elementId, |
Frame & | frame, | ||
const Hierarchy & | hierarchy, | ||
const bool | popElement = false |
||
) |
Returns the most recent debug frame of a specific debug element if the debug element is activate and exists.
elementId | The id for which the frame will be returned |
frame | The resulting copy of the debug frame which is associated with the id |
hierarchy | The hierarchy for which the element will be returned |
popElement | True, to remove the debug element; False, to keep the debug element until it gets updated again |
std::vector<Hierarchy> Ocean::DebugElements::hierarchies | ( | const uint32_t | elementId | ) | const |
Returns all existing hierarchies for a given element id.
elementId | The id for which all hierarchies will be returned |
bool Ocean::DebugElements::isElementActive | ( | const uint32_t | elementId | ) | const |
Returns whether a specific debug elements is activated.
Call this function before preparing the debug information (and updating via updateElement) to reduce the performance overhead when debugging.
elementId | The id for which the activation state is returned |
void Ocean::DebugElements::popHierarchyItem | ( | ) |
Pops the most recent hierarchy item.
void Ocean::DebugElements::pushHierarchyItem | ( | const std::string & | hierarchyItem | ) |
Pushes a new hierarchy.
hierarchyItem | The hierarchy item to be pushed |
|
inline |
Sets the optional callback function for updated debug element.
The callback function will be called whenever a debug element is updated.
callback | The callback function to be set, can be invalid to remove a previously set function |
void Ocean::DebugElements::updateElement | ( | const uint32_t | elementId, |
const Frame & | frame | ||
) |
Updates the debug information of a specific debug element.
Beware: Due to performance reasons, the specific debug element must be activated before it can be updated,
as the preparation of debug information for disabled elements can be skipped.
elementId | The id of the debug element, should be a value from DebugId |
frame | The new debug frame of the debug element, will be copied |
void Ocean::DebugElements::updateElement | ( | const uint32_t | elementId, |
const Frame & | frame, | ||
const Hierarchy & | explicitHierarchy | ||
) |
Updates the debug information of a specific debug element.
Beware: Due to performance reasons, the specific debug element must be activated before it can be updated,
as the preparation of debug information for disabled elements can be skipped.
elementId | The id of the debug element, should be a value from DebugId |
frame | The new debug frame of the debug element, will be copied |
explicitHierarchy | The explicit hierarchy which will be used instead of the actual internal known hierarchy |
void Ocean::DebugElements::updateElement | ( | const uint32_t | elementId, |
Frame && | frame | ||
) |
Updates the debug information of a specific debug element.
In case one (or several) sub-element bits are set, the element with matching sub-element bit mask will be updated only. Beware: Due to performance reasons, the specific debug element must be activated before it can be updated,
as the preparation of debug information for disabled elements can be skipped.
elementId | The id of the debug element, should be a value from DebugId |
frame | The new debug frame of the debug element, will be moved |
void Ocean::DebugElements::updateElement | ( | const uint32_t | elementId, |
Frame && | frame, | ||
const Hierarchy & | explicitHierarchy | ||
) |
Updates the debug information of a specific debug element.
In case one (or several) sub-element bits are set, the element with matching sub-element bit mask will be updated only. Beware: Due to performance reasons, the specific debug element must be activated before it can be updated,
as the preparation of debug information for disabled elements can be skipped.
elementId | The id of the debug element, should be a value from DebugId |
frame | The new debug frame of the debug element, will be moved |
explicitHierarchy | The explicit hierarchy which will be used instead of the actual internal known hierarchy |
|
protected |
The set holding activate debug element ids.
|
protected |
True, if all debug elements are activated (this state overrides the individual ids of activeIds_
).
|
protected |
The map mapping ids to frames.
|
protected |
Optional callback function for updated debug elements.
|
protected |
The current hierarchy.
|
mutableprotected |
The data lock.