HEBench
hebench::cpp::ITaggedObject Class Referenceabstract

Represents an object with a tag. More...

#include <engine_object.hpp>

Inheritance diagram for hebench::cpp::ITaggedObject:

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ITaggedObject()

hebench::cpp::ITaggedObject::ITaggedObject ( )
inline

Definition at line 40 of file engine_object.hpp.

◆ ~ITaggedObject()

virtual hebench::cpp::ITaggedObject::~ITaggedObject ( )
inlinevirtual

Definition at line 41 of file engine_object.hpp.

Member Function Documentation

◆ classTag()

virtual std::int64_t hebench::cpp::ITaggedObject::classTag ( ) const
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.

Member Data Documentation

◆ MaskByteSet

constexpr std::int64_t hebench::cpp::ITaggedObject::MaskByteSet = 0xFF
staticconstexpr

Definition at line 49 of file engine_object.hpp.

◆ MaskReservedBits

constexpr std::int64_t hebench::cpp::ITaggedObject::MaskReservedBits = MaskByteSet << 56
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

new_tag & MaskReservedBits == 0
static constexpr std::int64_t MaskReservedBits
Mask representing all bits reserved by C++ wrapper.

to respect the C++ wrapper tag convention.

Definition at line 61 of file engine_object.hpp.


The documentation for this class was generated from the following file: