Template Class AbstractDataStructure

Nested Relationships

Class Documentation

template <typename DataStructure>
class AbstractDataStructure

AbstractDataStructure.

The AbstractDataStructure serves as base class for all the SHAD ‘global’ data structures. It implements the Create and Destroy methods for the data structures, and allows accessing them on any locality through Global Identifiers, internally managed and maintained.

The inheriting class constructor can accept aribitrary memcpyable arguments (args): the create method of

AbstractDataStructure can be called from the subclass using the same arguments (args) of the constructor. It is recommended to implement the constructor as private/protected.
Warning
Subclasses SUBC of AbstractDataStructure MUST implement the constructor SUBC(ObjectID oid, Args … args) and the GetGlobalID() method.

Template Parameters

Public Types

template<>
using ObjectID = ObjectIdentifier<DataStructure>

Global Object Identifier.

template<>
using SharedPtr = std::shared_ptr<DataStructure>

SharedPtr to DataStructure.

Public Functions

AbstractDataStructure()

Default constructor.

virtual ObjectID GetGlobalID() const = 0

DataStructure identifier getter.

Returns the global object identifier associated to a DataStructure instance.

Warning
It must be implemented in the inheriting DataStructure.

Public Static Functions

template <typename... Args>
static SharedPtr Create(Args... args)

Create method.

Creates a global instance of DataStructure, and associates to it a unique global identifier. The Create method can be called within the inheriting class using the arguments args as in the constructor.

Warning
The Create method assumes that DataStructure implements a constructor with signature:
DataStructure(ObjectID oid, Args ... args);
with arbitrary memcpyable arguments.
Return
A shared_ptr to the newly created DataStructure instance.
Parameters
  • args: Arguments to the DataStructure constructor.

static void Destroy(const ObjectID &oid)

Destroy method.

Destroys a global instance of DataStructure, and invalidates its unique global identifier.

Parameters
  • oid: Global object identifier of the DataStructure instance to destroy.

static SharedPtr GetPtr(ObjectID oid)

DataStructure Shared pointer getter.

Returns the shared_ptr of the DataStructure associated to the global identifier oid. Allows accessing a DataStructure instance on any locality.

Warning
shared_ptrs are valid ONLY in the locality where it is obtained, via GetPtr or Create methods. In case of remote execution, use oids to retrieve a valid shared_ptr via the GetPtr operation.
Return
A shared_ptr to the DataStructure instance associared to oid.
Parameters
  • oid: The global identifier of the DataStructure instance.

Protected Static Functions

template <typename... Args>
static void UpdateCatalogAndConstruct(const ObjectID &oid, Args&&... args)
template <typename... Args, std::size_t... is>
static void CreateFunInnerWrapper(const std::tuple<Args...> &&tuple, std::index_sequence<is...>)
template <typename... Args>
static void CreateFunWrapper(const std::tuple<Args...> &args)
class Catalog

Public Functions

template<>
void Insert(const ObjectID &oid, const SharedPtr ce)
template<>
void Erase(const ObjectID &oid)
template<>
SharedPtr GetPtr(const ObjectID &oid)
template<>
ObjectID GetNextID()

Public Static Functions

template<>
static Catalog *Instance()