11 #error "File under development. Do not use."
18 template <
class DataType,
class value_type = DataType::value_type>
23 typedef std::shared_ptr<Marshalled_Data<DataType, mutable_DataType>>
serialized_type;
30 auto res = std::make_shared<Marshalled_Data<DataType, mutable_DataType>>();
31 res->DataPointers = std::vector<mutable_DataType>(d.size());
32 for (
size_t i = 0; i < (size_t)d.size(); ++i) res->DataPointers[i] = d[i];
41 auto res = std::make_shared<Marshalled_Data<DataType, mutable_DataType>>();
42 res->DataPointers = std::vector<mutable_DataType>(numObjects);
47 const size_t ds = data.size(), dp = p->DataPointers.size();
49 for (
size_t i = 0; i < (size_t)data.size(); ++i) {
50 data[i] = p->DataPointers[i];
std::shared_ptr< const Marshalled_Data< DataType, mutable_DataType > > const_serialized_type
void deserialize(serialized_type p, gsl::span< DataType > data)
Unpack the data. For POD, nothing special here.
std::remove_const< DataType >::type mutable_DataType
const_serialized_type serialize(::gsl::span< const DataType > d)
Converts an object into a void* byte stream.
serialized_type prep_deserialize(size_t numObjects)
Construct an object from a byte stream, and deallocate any temporary buffer.
std::shared_ptr< Marshalled_Data< DataType, mutable_DataType > > serialized_type