Class SerializableControl

Class Documentation

class SerializableControl

Callback class for serialization.

This must be provided by code that calls serialize.

Public Functions

inline virtual ~SerializableControl()

Destructor.

virtual void flushSerializeBuffer() = 0

Done with this buffer. Flush it.

virtual void ensureBuffer(std::size_t size) = 0

Make sure buffer has at least size bytes remaining. If not flush existing buffer and provide a new one.

Parameters

size – The number of bytes.

inline virtual void alignBuffer (std::size_t alignment) EPICS_DEPRECATED
virtual bool directSerialize(ByteBuffer *existingBuffer, const char *toSerialize, std::size_t elementCount, std::size_t elementSize) = 0

Method for serializing primitive array data. Hook for supplying custom serialization implementation. The serialization implementation need not be provided. Returns true if method performs serialization, false otherwise. This should only be used for arrays of primitive types, i. e. boolean, byte,…, double. It cannot be called for string, structure, or union arrays.

Parameters
  • existingBuffer – the existing buffer from the caller.

  • toSerialize – location of data to be put into buffer.

  • elementCount – number of elements.

  • elementSize – element size.

Returns

true if serialization performed, else false.

virtual void cachedSerialize(std::tr1::shared_ptr<const Field> const &field, ByteBuffer *buffer) = 0

serialize via cache

Parameters
  • field – instance to be serialized

  • buffer – buffer to be serialized to