32 typedef uint32_t SequenceType;
39 this_seq_ (global_seq_++)
60 this_seq_ = parent->child_seq_;
61 ++(parent->child_seq_);
64 this_seq_ = global_seq_++;
73 operator std::string()
const
77 ss << std::string(*parent_) <<
'.' << this_seq_;
95 if(other.parent_ ==
nullptr) {
99 return (this_seq_ == other.this_seq_) &&
100 (*parent_ == *other.parent_);
103 if(other.parent_ !=
nullptr) {
107 return (this_seq_ == other.this_seq_);
132 return (std::string(*
this) == s);
147 static void resetGlobalSeqNum() {
152 Tag *parent_ =
nullptr;
153 SequenceType this_seq_ = 0;
154 SequenceType child_seq_ = 1;
155 static SequenceType global_seq_;
168 os << std::string(tag);
182 if (tag !=
nullptr) {
183 os << std::string(*tag);
195#define SPARTA_TAG_BODY \
197 Tag::SequenceType Tag::global_seq_ = 1; \
Set of macros for Sparta assertions. Caught by the framework.
#define SPARTA_EXPECT_TRUE(x)
A macro for hinting to the compiler a particular condition should be considered most likely true.
Exception class for all of Sparta.
Tag(): Simple class to provide nested sequence numbering.
bool operator==(const std::string &s) const
==(): Equality operator (vs. string)
bool operator!=(const Tag &other) const
!=(): Inequality operator
bool operator!=(const std::string &s) const
!=(): Inequality operator (vs. string)
Tag(Tag *parent)
Tag(): Construct as a child of a parent Tag. This will increment the child sequence counter in the pa...
Tag()
Tag(): Constructor Construct a new tag, using the internal global sequence number.
bool operator==(const Tag &other) const
==(): Equality operator
Tag(const Tag &other)=default
Tag(): Copy constructor.
Macros for handling exponential backoff.
std::ostream & operator<<(std::ostream &o, const SimulationInfo &info)
ostream insertion operator for SimulationInfo