46 #ifndef MQSERIALIZATIONPROTOCOL_HPP_ 47 #define MQSERIALIZATIONPROTOCOL_HPP_ 51 #include <boost/iostreams/stream.hpp> 52 #include <boost/iostreams/device/array.hpp> 70 namespace io = boost::iostreams;
75 io::stream<io::array_sink> outbuf( (
char*)blob, size);
80 return std::make_pair((
void*)0,
int(0));
87 namespace io = boost::iostreams;
90 io::stream<io::array_source> inbuf((
const char*)blob, size);
101 log(
Error) <<
"getSampleSize: sample has wrong type."<<endlog();
104 namespace io = boost::iostreams;
106 io::stream<io::array_sink> outbuf(sink,1);
108 out << tsample->
get();
DataSource is a base class representing a generic way to read data of type T.
This archive is capable of saving objects of serialization level 1 and 2 in a binary, non-portable format.
virtual result_t get() const =0
Return the data as type T.
This file implements a 'level 2' binary archiver of serializable objects.
For each transportable type T, specify the conversion functions.
virtual void set(param_t t)=0
Set this DataSource with a value.
MQSerializationProtocol()
This archive is capable of loading objects of serialization level 1 and 2 from a binary, non-portable format.
virtual bool updateFromBlob(const void *blob, int size, base::DataSourceBase::shared_ptr target, void *cookie) const
Update target with the contents of blob which is an object of a protocol.
virtual const_reference_t rvalue() const =0
Get a const reference to the value of this DataSource.
virtual unsigned int getSampleSize(base::DataSourceBase::shared_ptr sample, void *cookie) const
Returns the size in bytes of a marshalled data element.
int getArchiveSize()
Helper method to say how much we wrote.
boost::intrusive_ptr< DataSource< T > > shared_ptr
boost::intrusive_ptr< AssignableDataSource< T > > shared_ptr
Use this type to store a pointer to an AssignableDataSource.
static AssignableDataSource< T > * narrow(base::DataSourceBase *db)
This method narrows a base::DataSourceBase to a typeded AssignableDataSource, possibly returning a ne...
boost::intrusive_ptr< DataSourceBase > shared_ptr
Use this type to store a pointer to a DataSourceBase.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
virtual std::pair< void const *, int > fillBlob(base::DataSourceBase::shared_ptr source, void *blob, int size, void *cookie) const
Create an transportable object for a protocol which contains the value of source. ...