39#ifndef PRIMITIVE_TYPE_ARRAY_H
40#define PRIMITIVE_TYPE_ARRAY_H
42#include "data/arrayWrapper.h"
43#include "data/dataHandler.h"
44#include "data/pointerWrapper.h"
201 const size_t address,
const T& value)
208 this->
data.at(address) = value;
218 if (
this != &
other) {
221 message <<
"Assigned PrimitiveTypeArray do not have the same "
224 throw std::domain_error(
message.str());
Definition arrayWrapper.h:69
std::vector< T > * containerPtr
Pointer to the array containing the data accessed through the ArrayWrapper.
Definition arrayWrapper.h:105
const size_t nbElements
Number of elements contained pointer vector.
Definition arrayWrapper.h:99
void setPointer(std::vector< T > *ptr)
Set the pointer of the ArrayWrapper.
Definition arrayWrapper.h:383
void checkAddressAndType(const std::type_info &type, const size_t &address) const
Definition arrayWrapper.h:232
Base class for all sources of data to be accessed by a TPG Instruction executed within a Program.
Definition dataHandler.h:55
bool invalidCachedHash
Boolean value indicating whether the current cachedValue is valid, or not.
Definition dataHandler.h:90
DataHandler for 2D arrays of primitive types.
Definition primitiveTypeArray2D.h:69
std::vector< T > data
Array storing the data of the PrimitiveTypeArray2D.
Definition primitiveTypeArray2D.h:74
PrimitiveTypeArray2D(const size_t w=2, const size_t h=4)
Constructor for the 2D array.
Definition primitiveTypeArray2D.h:142
Definition primitiveTypeArray.h:55
PrimitiveTypeArray(size_t size=8)
Constructor for the PrimitiveTypeArray class.
Definition primitiveTypeArray.h:130
virtual ~PrimitiveTypeArray()=default
Default destructor.
std::vector< T > data
Array storing the data of the PrimitiveTypeArray.
Definition primitiveTypeArray.h:60
PrimitiveTypeArray(const PointerWrapper< T > &other)
Copy content from a PointerWrapper.
Definition primitiveTypeArray.h:166
virtual DataHandler * clone() const override
Inherited from DataHandler.
Definition primitiveTypeArray.h:181
void setDataAt(const std::type_info &type, const size_t address, const T &value)
Set the data at the given address to the given value.
Definition primitiveTypeArray.h:200
PrimitiveTypeArray(const PrimitiveTypeArray< T > &other)
Copy constructor (deep copy).
Definition primitiveTypeArray.h:137
PrimitiveTypeArray< T > & operator=(const PrimitiveTypeArray< T > &other)
Assignement Operator for PrimitiveTypeArray<T>
Definition primitiveTypeArray.h:214
void resetData() override
Sets all elements of the Array to 0 (or its equivalent for the given template param....
Definition primitiveTypeArray.h:189
PrimitiveTypeArray(const ArrayWrapper< T > &other)
Copy content from an ArrayWrapper.
Definition primitiveTypeArray.h:146
Definition array2DWrapper.h:44