8 #ifndef META_OCEAN_BASE_DEBUG_ELEMENTS_H
9 #define META_OCEAN_BASE_DEBUG_ELEMENTS_H
18 #include <unordered_set>
50 void change(
const std::string& newHierarchyItem);
209 Frame element(
const uint32_t elementId,
const bool popElement =
false);
247 std::vector<Hierarchy>
hierarchies(
const uint32_t elementId)
const;
286 hierarchyItem_(hierarchyItem)
295 if (!hierarchyItem_.empty())
297 owner_.popHierarchyItem();
This class implements a scoped hierarchy.
Definition: DebugElements.h:37
void release()
Explicitly releases the hierarchy (already before the destructor is called).
~ScopedHierarchyBase()
Releases the hierarchy and disposes this object.
Definition: DebugElements.h:293
ScopedHierarchyBase & operator=(const ScopedHierarchyBase &scopedHierarchy)=delete
Disabled copy operator.
void change(const std::string &newHierarchyItem)
Explicitly exchanges the hierarchy instead of releasing it and creating a new one.
DebugElements & owner_
The owner of this object.
Definition: DebugElements.h:82
std::string hierarchyItem_
The hierarchy item of this object.
Definition: DebugElements.h:85
ScopedHierarchyBase(const ScopedHierarchyBase &scopedHierarchy)=delete
Disabled copy constructor.
This class implements the base class for a container for debug elements.
Definition: DebugElements.h:29
std::map< Hierarchy, Frame > HierarchyMap
Definition of a map mapping hierarchies to frames.
Definition: DebugElements.h:103
ElementUpdateCallback elementUpdateCallback_
Optional callback function for updated debug elements.
Definition: DebugElements.h:278
void updateElement(const uint32_t elementId, Frame &&frame)
Updates the debug information of a specific debug element.
std::map< uint32_t, HierarchyMap > ElementMap
Definition of a map mapping element ids to hierarchy maps.
Definition: DebugElements.h:108
ElementMap elementMap_
The map mapping ids to frames.
Definition: DebugElements.h:272
std::vector< Hierarchy > hierarchies(const uint32_t elementId) const
Returns all existing hierarchies for a given element id.
void updateElement(const uint32_t elementId, const Frame &frame, const Hierarchy &explicitHierarchy)
Updates the debug information of a specific debug element.
ElementSet activeElements_
The set holding activate debug element ids.
Definition: DebugElements.h:266
Frame element(const uint32_t elementId, const Hierarchy &hierarchy, const bool popElement=false)
Returns the most recent debug frame of a specific debug element.
void updateElement(const uint32_t elementId, Frame &&frame, const Hierarchy &explicitHierarchy)
Updates the debug information of a specific debug element.
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 ...
Lock lock_
The data lock.
Definition: DebugElements.h:281
Hierarchy hierarchy_
The current hierarchy.
Definition: DebugElements.h:275
DebugElements()
Protected default constructor.
Definition: DebugElements.h:301
void setElementUpdateCallback(const ElementUpdateCallback &callback)
Sets the optional callback function for updated debug element.
Definition: DebugElements.h:307
void pushHierarchyItem(const std::string &hierarchyItem)
Pushes a new hierarchy.
bool isElementActive(const uint32_t elementId) const
Returns whether a specific debug elements is activated.
void deactivateElement(const uint32_t elementId)
Deactivates a specific debug element.
Frame element(const uint32_t elementId, const bool popElement=false)
Returns the most recent debug frame of a specific debug element.
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 ...
void activateAllElements()
Explicitly activates all elements (to avoid defining all active elements individually).
void updateElement(const uint32_t elementId, const Frame &frame)
Updates the debug information of a specific debug element.
void activateElement(const uint32_t elementId)
Activates a specific debug element.
void popHierarchyItem()
Pops the most recent hierarchy item.
std::vector< std::string > Hierarchy
Definition of a vector holding strings (a hierarchy).
Definition: DebugElements.h:91
bool allElementsActivate_
True, if all debug elements are activated (this state overrides the individual ids of activeIds_).
Definition: DebugElements.h:269
std::unordered_set< uint32_t > ElementSet
Definition of a set holding element ids.
Definition: DebugElements.h:113
Callback< void, const uint32_t, const Frame *, const Hierarchy * > ElementUpdateCallback
Definition of a callback function for an updated debug element.
Definition: DebugElements.h:96
This class implements Ocean's image class.
Definition: Frame.h:1792
This class implements a recursive lock object.
Definition: Lock.h:31
This class implements a scoped lock object for recursive lock objects.
Definition: Lock.h:135
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15