7#ifndef __PHOENIX_CREATEDATA_IMPL_H__
8#define __PHOENIX_CREATEDATA_IMPL_H__
10#include "phoenix_type_stream.h"
11#include "phoenix_assert.h"
22 param.
setType(phoenix_getTypeToStr<T>());
23 param.
getValue().resize(data_size(value));
24 DataStreamIter iter = (DataStreamIter)param.
getValue().data();
25 phoenix_assert(data_message_save(iter, value));
35 phoenix_assert(data.
getType() == phoenix_getTypeToStr<T>());
36 DataStreamIter resIter = (DataStreamIter)data.
getValue().data();
38 phoenix_assert(data_message_load(resIter, resValue));
Basic Data exchanged in the swarm.
void setType(const PString &type)
Sets the type of the Data.
const PString & getType() const
Gets the type of the Data.
const DataStreamMsg & getValue() const
Gets the value of the Data.
T phoenix_getValueFromData(const Data &data)
Get the value in the Data.
Data phoenix_createData(const T &value)
Create a Data from a value.