/* * serializationHelper.h * * Created on: Jul 24, 2012 * Author: msekoranja */ #ifndef SERIALIZATIONHELPER_H_ #define SERIALIZATIONHELPER_H_ #ifdef epicsExportSharedSymbols # define serializationHelperEpicsExportSharedSymbols # undef epicsExportSharedSymbols #endif #include #include #include #include #include #ifdef serializationHelperEpicsExportSharedSymbols # define epicsExportSharedSymbols # undef serializationHelperEpicsExportSharedSymbols #endif #include #include namespace epics { namespace pvAccess { class SerializationHelper : public epics::pvData::NoDefaultMethods { public: static epics::pvData::PVDataCreatePtr _pvDataCreate; /** * Deserialize PVRequest. * @param payloadBuffer data buffer. * @return deserialized PVRequest, can be null. */ static epics::pvData::PVStructure::shared_pointer deserializePVRequest(epics::pvData::ByteBuffer* payloadBuffer, epics::pvData::DeserializableControl* control); /** * Deserialize Structure and create PVStructure instance. * @param payloadBuffer data buffer. * @param control deserialization control. * @return PVStructure instance, can be null. */ static epics::pvData::PVStructure::shared_pointer deserializeStructureAndCreatePVStructure(epics::pvData::ByteBuffer* payloadBuffer, epics::pvData::DeserializableControl* control); /** * Deserialize Structure and create PVStructure instance, if necessary. * @param payloadBuffer data buffer. * @param control deserialization control. * @param existingStructure if deserialized Field matches existingStrcuture Field, then * existingStructure instance is returned. null value is allowed. * @return PVStructure instance, can be null. */ static epics::pvData::PVStructure::shared_pointer deserializeStructureAndCreatePVStructure(epics::pvData::ByteBuffer* payloadBuffer, epics::pvData::DeserializableControl* control, epics::pvData::PVStructure::shared_pointer const & existingStructure); /** * Deserialize optional PVStructrue. * @param payloadBuffer data buffer. * @return deserialized PVStructure, can be null. */ static epics::pvData::PVStructure::shared_pointer deserializeStructureFull(epics::pvData::ByteBuffer* payloadBuffer, epics::pvData::DeserializableControl* control); static void serializeNullField(epics::pvData::ByteBuffer* buffer, epics::pvData::SerializableControl* control); /** * Serialize PVRequest. * @param buffer data buffer. */ static void serializePVRequest(epics::pvData::ByteBuffer* buffer, epics::pvData::SerializableControl* control, epics::pvData::PVStructure::shared_pointer const & pvRequest); /** * Serialize optional PVStructrue. * @param buffer data buffer. */ static void serializeStructureFull(epics::pvData::ByteBuffer* buffer, epics::pvData::SerializableControl* control, epics::pvData::PVStructure::shared_pointer const & pvStructure); }; } } #endif /* SERIALIZATIONHELPER_H_ */