HEBench
|
Represents an object with a tag. More...
#include <engine_object.hpp>
Public Member Functions | |
ITaggedObject () | |
virtual | ~ITaggedObject () |
virtual std::int64_t | classTag () const =0 |
Retrieves the tag of the class to which this object belongs. More... | |
Static Public Attributes | |
static constexpr std::int64_t | MaskByteSet = 0xFF |
static constexpr std::int64_t | MaskReservedBits = MaskByteSet << 56 |
Mask representing all bits reserved by C++ wrapper. More... | |
Represents an object with a tag.
The design philosophy is that objects are tagged using a bit mask.
A backend implementation will test the tag of an opaque handle received from the Test Harness against the tag mask of the expected class to see if it is of the correct type and to decide the correct operations. Thus, it is recommended that derived classes form their tags by combining their bit mask with the base class' tag using binary OR.
It is the client's responsibility to ensure that their tags are compatible and masks are correct. This class is only offered as a helper wrapper for object tagging.
Convention:
C++ wrapper will use the most significant 8 bits of the 64-bit tag. The 56 least significant bits can be used by clients as they see fit. Not respecting this convention will result in undefined behavior by the C++ wrapper.
Definition at line 37 of file engine_object.hpp.
|
inline |
Definition at line 40 of file engine_object.hpp.
|
inlinevirtual |
Definition at line 41 of file engine_object.hpp.
|
pure virtual |
Retrieves the tag of the class to which this object belongs.
Most significant 8 bits of the 64-bit tag are reserved by C++ wrapper. See ITaggedObject
for more details.
Implemented in hebench::cpp::EngineObject, hebench::cpp::BaseEngine, hebench::cpp::BaseBenchmark, and hebench::cpp::BenchmarkDescription.
|
staticconstexpr |
Definition at line 49 of file engine_object.hpp.
|
staticconstexpr |
Mask representing all bits reserved by C++ wrapper.
Most significant 8 bits of the 64-bit tag are reserved by C++ wrapper. See ITaggedObject
for more details.
Any client tag value must satisfy
to respect the C++ wrapper tag convention.
Definition at line 61 of file engine_object.hpp.