|
GEGELATI
|
#include <primitiveTypeArray.h>
Public Member Functions | |
| PrimitiveTypeArray (size_t size=8) | |
| Constructor for the PrimitiveTypeArray class. | |
| PrimitiveTypeArray (const PrimitiveTypeArray< T > &other) | |
| Copy constructor (deep copy). | |
| PrimitiveTypeArray (const ArrayWrapper< T > &other) | |
| Copy content from an ArrayWrapper. | |
| PrimitiveTypeArray (const PointerWrapper< T > &other) | |
| Copy content from a PointerWrapper. | |
| virtual | ~PrimitiveTypeArray ()=default |
| Default destructor. | |
| virtual DataHandler * | clone () const override |
| Inherited from DataHandler. | |
| void | resetData () override |
| Sets all elements of the Array to 0 (or its equivalent for the given template param.) | |
| 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. | |
| PrimitiveTypeArray< T > & | operator= (const PrimitiveTypeArray< T > &other) |
| Assignement Operator for PrimitiveTypeArray<T> | |
Public Member Functions inherited from Data::ArrayWrapper< T > | |
| ArrayWrapper (size_t size=8, std::vector< T > *ptr=nullptr) | |
| Constructor for the ArrayWrapper class. | |
| virtual | ~ArrayWrapper ()=default |
| Default destructor. | |
| ArrayWrapper (const ArrayWrapper< T > &other)=default | |
| Default copy constructor. | |
| ArrayWrapper (const DataHandler &other, size_t size) | |
| Copy constructor for DataHandler. | |
| virtual bool | canHandle (const std::type_info &type) const override |
| Inherited from DataHandler. | |
| virtual size_t | getAddressSpace (const std::type_info &type) const override |
| Inherited from DataHandler. | |
| virtual size_t | getLargestAddressSpace (void) const override |
| Inherited from DataHandler. | |
| void | invalidateCachedHash () |
| Invalidate the hash of the container. | |
| void | setPointer (std::vector< T > *ptr) |
| Set the pointer of the ArrayWrapper. | |
| virtual UntypedSharedPtr | getDataAt (const std::type_info &type, const size_t address) const override |
| Inherited from DataHandler. | |
| virtual std::vector< size_t > | getAddressesAccessed (const std::type_info &type, const size_t address) const override |
| Inherited from DataHandler. | |
| virtual const std::type_info & | getNativeType () const override |
| Inherited from DataHandler. | |
| virtual std::vector< size_t > | getDimensionsSize () const override |
| Inherited from DataHandler. | |
Public Member Functions inherited from Data::DataHandler | |
| DataHandler () | |
| Default constructor of the DataHandler class. | |
| virtual | ~DataHandler ()=default |
| Default destructor. | |
| DataHandler (const DataHandler &other)=default | |
| Default copy constructor. | |
| size_t | getId () const |
| Get the ID of the DataHandler. | |
| virtual size_t | getHash () const |
| Get the current value of the hash for this DataHandler. | |
| 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 dataHandler, for the given data type. | |
Protected Attributes | |
| std::vector< T > | data |
| Array storing the data of the PrimitiveTypeArray. | |
Protected Attributes inherited from Data::ArrayWrapper< T > | |
| const size_t | nbElements |
| Number of elements contained pointer vector. | |
| std::vector< T > * | containerPtr |
| Pointer to the array containing the data accessed through the ArrayWrapper. | |
Protected Attributes inherited from Data::DataHandler | |
| const size_t | id |
| Identifier of each DataHandler. | |
| size_t | cachedHash |
| Cached value returned by the getHash() function. | |
| bool | invalidCachedHash |
| Boolean value indicating whether the current cachedValue is valid, or not. | |
Additional Inherited Members | |
Protected Member Functions inherited from Data::ArrayWrapper< T > | |
| void | checkAddressAndType (const std::type_info &type, const size_t &address) const |
| virtual size_t | updateHash () const override |
| Implementation of the updateHash method. | |
Static Protected Attributes inherited from Data::DataHandler | |
| static size_t | count = 0 |
| Static count used to initialize the id of each DataHandler. | |
DataHandler for manipulating arrays of a primitive data type.
In addition to native data types T, this DataHandler can also provide the following composite data type:
| Data::PrimitiveTypeArray< T >::PrimitiveTypeArray | ( | size_t | size = 8 | ) |
Constructor for the PrimitiveTypeArray class.
| [in] | size | the fixed number of elements of primitive type T contained in the PrimitiveTypeArray. |
|
inlineoverridevirtual |
Inherited from DataHandler.
Reimplemented from Data::ArrayWrapper< T >.
| PrimitiveTypeArray< T > & Data::PrimitiveTypeArray< T >::operator= | ( | const PrimitiveTypeArray< T > & | other | ) |
Assignement Operator for PrimitiveTypeArray<T>
Copy nbElements and data from the right side argument to the left side argument
| [in] | other | the left side argument, to be assigned to the right side argument. |
| std::domain_error | if both arguents do not have the same size, which implies that assignement cannot be successfull. |
|
overridevirtual |
Sets all elements of the Array to 0 (or its equivalent for the given template param.)
Reimplemented from Data::ArrayWrapper< T >.
| void Data::PrimitiveTypeArray< T >::setDataAt | ( | const std::type_info & | type, |
| const size_t | address, | ||
| const T & | value ) |
Set the data at the given address to the given value.
This method is not (yet) part of the DataHandler class as for now, the TPG engine does not need to update data of DataHandler, except for the one used as registers, which are managed with a PrimitiveTypeArray<double>.
Invalidates the cache.
| [in] | type | the std::type_info of data set. |
| [in] | address | the location of the data to set. |
| [in] | value | a const reference to the PrimitiveType holding a value of the data to write in the current PrimitiveTypeArray |
| std::invalid_argument | if the given data type is not handled by the DataHandler. |
| std::out_of_range | if the given address is invalid for the given data type. |