126 const std::string& name,
127 const std::string& group,
129 const std::string& desc,
144 ensureParentIsValid_(parent);
151 const std::string& name,
152 const std::string& group,
154 const std::string& desc,
168 CounterBase(TreeNode* parent,
169 const std::string& name,
170 const std::string& desc,
252 virtual std::string
stringize(
bool pretty=
false)
const = 0;
293 void ensureParentIsValid_(
TreeNode* parent);
Byte order types and byte-swapping routines.
Virtual interface node for simulator instrumentation (e.g. counters, stats, nontifications).
Set of macros for Sparta assertions. Caught by the framework.
Exception class for all of Sparta.
Basic Node framework in sparta device tree composite pattern.
The base class for all Counters.
virtual ~CounterBase()
Destructor.
virtual void onAddingChild_(TreeNode *child)
React to child registration.
virtual counter_type get() const =0
Gets the value of this counter.
static std::string getBehaviorName(CounterBehavior behave)
Returns a string containing the name of the given behavior.
uint64_t counter_type
Counter value type.
virtual bool supportsCompression() const
CounterBase(const CounterBase &rhp)=delete
Copy construction not allowed.
CounterBehavior
Behavior of this counter.
@ COUNT_INTEGRAL
Counter intended to increase each cycle by some variable X.
@ COUNT_LATEST
Counter holds the latest value (from most recent activity) and can increase or decrease at any time.
@ COUNT_NORMAL
Counter counts the number of times something happens like one would expect. This is a weakly monotoni...
virtual std::string stringize(bool pretty=false) const =0
Create a string representation of this node.
CounterBase(CounterBase &&rhp)
Move constructor.
CounterBase(TreeNode *parent, const std::string &name, const std::string &group, TreeNode::group_idx_type group_idx, const std::string &desc, CounterBehavior behave, visibility_t visibility)
CounterBase constructor.
CounterBehavior getBehavior() const
Gets the behavior for this counter specified at construction.
@ TYPE_COUNTER
Counter (of any subclass)
uint32_t visibility_t
Continuous visibility level. Several key points along continum are indicated within Visibility.
static constexpr visibility_t DEFAULT_VISIBILITY
Default node visibility.
Used to construct and throw a standard C++ exception. Inherits from std::exception.
Node in a composite tree representing a sparta Tree item.
static const group_idx_type GROUP_IDX_NONE
GroupIndex indicating that a node has no group index because it belongs to no group.
static constexpr char GROUP_NAME_NONE[]
Group name indicating that a node belongs to no group.
void addChild(TreeNode *child, bool inherit_phase=true)
Adds a TreeNode to this node as a child.
uint32_t group_idx_type
Index within a group.
void setExpectedParent_(const TreeNode *parent)
Tracks a node as an expected parent without actually adding this node as a child. This is used almost...
Macros for handling exponential backoff.