13 #ifndef __OPC_UA_MAPPING_SERIALIZE_H__ 14 #define __OPC_UA_MAPPING_SERIALIZE_H__ 22 #define OPCUA_DEFAULT_BUFFER_SIZE 4096 34 Buffer.reserve(defBufferSize);
44 template <
typename Acceptor>
61 virtual size_t Read(
char * buffer,
size_t size) = 0;
79 Deserialize<T>(value);
84 void Deserialize(T &);
104 template <
typename OutputChannelType>
108 explicit OStream(std::shared_ptr<OutputChannelType> channel)
123 template <
typename T>
137 Serializer.Flush(Out);
142 std::shared_ptr<OutputChannelType>
Holder;
146 template <
typename ChannelType>
166 template <
typename InputChannelType>
170 explicit IStream(std::shared_ptr<InputChannelType> channel)
173 , Deserializer(*this)
179 , Deserializer(*this)
187 template <
typename T>
190 Deserializer >> value;
195 virtual size_t Read(
char * buffer,
size_t size)
197 return In.Receive(buffer, size);
201 InputChannelType &
In;
202 std::shared_ptr<InputChannelType>
Holder;
207 template <
typename IOChannelType>
212 :
IStream<IOChannelType>(channel)
213 ,
OStream<IOChannelType>(channel)
218 template <
typename InputChannelType,
typename OutputChannelType>
223 :
IStream<InputChannelType>(input)
224 ,
OStream<OutputChannelType>(output)
236 #endif // __OPC_UA_MAPPING_SERIALIZE_H__
OStream(std::shared_ptr< OutputChannelType > channel)
IStream & operator>>(T &value)
std::shared_ptr< InputChannelType > Holder
IStream(InputChannelType &channel)
OpcUa::Binary::OStream< OpcUa::OutputChannel > OStreamBinary
IOStream(std::shared_ptr< IOChannelType > channel)
std::vector< char > Buffer
RawBuffer(char *data, std::size_t size)
DataDeserializer & operator>>(T &value)
DataDeserializer(DataSupplier &supplier)
OStream & operator<<(const T &value)
DataSerializer Serializer
OStream< ChannelType > & flush(OStream< ChannelType > &os)
virtual size_t Read(char *buffer, size_t size)
std::shared_ptr< OutputChannelType > Holder
OStream(OutputChannelType &channel)
void Serialize(const T &value)
void Flush(Acceptor &aceptor)
DataSerializer(std::size_t defBufferSize=OPCUA_DEFAULT_BUFFER_SIZE)
OPC UA Address space part. GNU LGPL.
#define OPCUA_DEFAULT_BUFFER_SIZE
Opc binary stream. Stream classes perform Serialization/Deserialization of opc ua structures...
const char * Binary(const char *input, short n)
DataSerializer & operator<<(const T &value)
OpcUa::Binary::IStream< OpcUa::InputChannel > IStreamBinary
virtual ~DataDeserializer()
IStream(std::shared_ptr< InputChannelType > channel)
OpcUa::Binary::IOStream< OpcUa::IOChannel > IOStreamBinary
RawMessage(const char *data, std::size_t size)
DataDeserializer Deserializer