1#ifndef included_AMP_VectorDataDefault
2#define included_AMP_VectorDataDefault
4#include "AMP/utils/Memory.h"
5#include "AMP/utils/UtilityMacros.h"
6#include "AMP/vectors/data/GhostDataHelper.hpp"
7#include "AMP/vectors/data/VectorData.h"
13template<
typename TYPE>
14class VectorDataIterator;
22template<
typename TYPE =
double,
class Allocator = AMP::HostAllocator<
void>>
28 typename std::allocator_traits<Allocator>::template rebind_alloc<TYPE>;
80 const size_t *indices,
82 const typeID &
id )
override;
96 const size_t *indices,
98 const typeID &
id )
override;
112 const size_t *indices,
114 const typeID &
id )
const override;
155 std::shared_ptr<VectorData>
cloneData(
const std::string &name =
"" )
const override;
Class to manage reading/writing restart data.
A class used to hold vector data.
virtual ~VectorDataDefault()
Virtual destructor.
size_t sizeofDataBlockType(size_t i) const override
Return the result of sizeof(TYPE) for the given data block.
void swapData(VectorData &rhs) override
Swap the data with another VectorData object.
void putRawData(const void *buf, const typeID &id) override
Copy data into this vector.
const TYPE & operator[](size_t i) const
Access the raw element.
VectorDataDefault(int64_t, AMP::IO::RestartManager *)
AMP::Utilities::MemoryType getMemoryLocation() const override
returns the memory location for data
typeID getType(size_t block) const override
Return the typeid of the given block.
void writeRestart(int64_t) const override
Write restart data to file.
std::string VectorDataName() const override
Get the type name.
void setValuesByLocalID(size_t num, const size_t *indices, const void *vals, const typeID &id) override
Set values in the vector by their local offset.
uint64_t getDataID() const override
A unique id for the underlying data allocation.
void registerChildObjects(AMP::IO::RestartManager *manager) const override
Register any child objects.
std::shared_ptr< VectorData > cloneData(const std::string &name="") const override
Clone the data.
const void * getRawDataBlockAsVoid(size_t i) const override
Return a pointer to a particular block of memory in the vector.
TYPE & operator[](size_t i)
Access the raw element.
void * getRawDataBlockAsVoid(size_t i) override
Return a pointer to a particular block of memory in the vector.
VectorDataDefault(size_t start, size_t localSize, size_t globalSize)
VectorDataDefault(const VectorDataDefault &)=delete
typename std::allocator_traits< Allocator >::template rebind_alloc< TYPE > scalarAllocator_t
void getRawData(void *buf, const typeID &id) const override
Copy data out of this vector.
size_t numberOfDataBlocks() const override
Number of blocks of contiguous data in the Vector.
void getValuesByLocalID(size_t num, const size_t *indices, void *vals, const typeID &id) const override
Get values to vector entities by their local offset.
void addValuesByLocalID(size_t num, const size_t *indices, const void *vals, const typeID &id) override
Add values to vector entities by their local offset.
size_t sizeOfDataBlock(size_t i=0) const override
Number of elements in a data block.
A class used to hold vector data.
MemoryType
Enum to store pointer type.
Class to store type info.