46#include "data/untypedSharedPtr.h"
135 size_t getId()
const;
155 virtual bool canHandle(
const std::type_info& type)
const = 0;
217 const size_t address)
const = 0;
241 const std::type_info& type,
const size_t address)
const = 0;
262 const std::type_info& type)
const;
264#ifdef CODE_GENERATION
Base class for all sources of data to be accessed by a TPG Instruction executed within a Program.
Definition: dataHandler.h:54
size_t getId() const
Get the ID of the DataHandler.
Definition: dataHandler.cpp:47
virtual ~DataHandler()=default
Default destructor.
virtual const std::type_info & getNativeType() const =0
Function returning the native type of the DataHandler.
virtual std::vector< size_t > getDimensionsSize() const =0
Give the size of each dimension (if any) of the DataHandler.
virtual size_t getLargestAddressSpace() const =0
Get the largest AddressSpace for all data types handled by the DataHandler.
virtual size_t getAddressSpace(const std::type_info &type) const =0
Get the getAddressSpace size for the given data type.
DataHandler()
Default constructor of the DataHandler class.
Definition: dataHandler.cpp:44
virtual void resetData()=0
Generic method for DataHandler to reset their data.
bool invalidCachedHash
Boolean value indicating whether the current cachedValue is valid, or not.
Definition: dataHandler.h:89
virtual UntypedSharedPtr getDataAt(const std::type_info &type, const size_t address) const =0
Get data of the given type, from the given address.
virtual size_t updateHash() const =0
Update the cachedHash value.
uint64_t scaleLocation(const uint64_t rawLocation, const std::type_info &type) const
Scale a location from the Environment largestAddressSpace to the largestAddressSpace of the dataHandl...
Definition: dataHandler.cpp:61
virtual std::vector< size_t > getAddressesAccessed(const std::type_info &type, const size_t address) const =0
Get the set of addresses actually used when getting the given type of data, at the given address.
virtual bool canHandle(const std::type_info &type) const =0
Check a given DataHandler can handle data for the given data type.
size_t cachedHash
Cached value returned by the getHash() function.
Definition: dataHandler.h:77
static size_t count
Static count used to initialize the id of each DataHandler.
Definition: dataHandler.h:60
const size_t id
Identifier of each DataHandler.
Definition: dataHandler.h:69
virtual DataHandler * clone() const =0
Return a copy of the DataHandler (with all its content).
DataHandler(const DataHandler &other)=default
Default copy constructor.
size_t getHash() const
Get the current value of the hash for this DataHandler.
Definition: dataHandler.cpp:52
Class behaving as a std::shared_ptr whose type is not templated.
Definition: untypedSharedPtr.h:72
Definition: array2DWrapper.h:44