IntrospectionRegistry changes, compiles

This commit is contained in:
Matej Sekoranja
2012-07-24 23:40:50 +02:00
parent fe3f5e76d0
commit 0ca43eb89b
3 changed files with 12 additions and 82 deletions

View File

@@ -56,7 +56,7 @@ LIBSRCS += simpleChannelSearchManagerImpl.cpp
LIBSRCS += abstractResponseHandler.cpp
LIBSRCS += blockingTCPAcceptor.cpp
LIBSRCS += transportRegistry.cpp
#LIBSRCS += serializationHelper.cpp
LIBSRCS += serializationHelper.cpp
SRC_DIRS += $(PVACCESS)/remoteClient
INC += clientContextImpl.h

View File

@@ -20,9 +20,9 @@
namespace epics {
namespace pvData {
namespace pvAccess {
class SerializationHelper : public NoDefaultMethods {
class SerializationHelper : public epics::pvData::NoDefaultMethods {
public:
static epics::pvData::PVDataCreatePtr _pvDataCreate;
@@ -32,7 +32,7 @@ namespace epics {
* @param payloadBuffer data buffer.
* @return deserialized PVRequest, can be <code>null</code>.
*/
static PVStructure::shared_pointer deserializePVRequest(ByteBuffer* payloadBuffer, DeserializableControl* control);
static epics::pvData::PVStructure::shared_pointer deserializePVRequest(epics::pvData::ByteBuffer* payloadBuffer, epics::pvData::DeserializableControl* control);
/**
* Deserialize Structure and create PVStructure instance.
@@ -40,7 +40,7 @@ namespace epics {
* @param control deserialization control.
* @return PVStructure instance, can be <code>null</code>.
*/
static PVStructure::shared_pointer deserializeStructureAndCreatePVStructure(ByteBuffer* payloadBuffer, DeserializableControl* control);
static epics::pvData::PVStructure::shared_pointer deserializeStructureAndCreatePVStructure(epics::pvData::ByteBuffer* payloadBuffer, epics::pvData::DeserializableControl* control);
/**
* Deserialize Structure and create PVStructure instance, if necessary.
@@ -50,28 +50,28 @@ namespace epics {
* <code>existingStructure</code> instance is returned. <code>null</code> value is allowed.
* @return PVStructure instance, can be <code>null</code>.
*/
static PVStructure deserializeStructureAndCreatePVStructure(ByteBuffer* payloadBuffer, DeserializableControl* control, PVStructure::shared_pointer const & existingStructure);
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 <code>null</code>.
*/
static PVStructure::shared_pointer deserializeStructureFull(ByteBuffer* payloadBuffer, DeserializableControl* control);
static epics::pvData::PVStructure::shared_pointer deserializeStructureFull(epics::pvData::ByteBuffer* payloadBuffer, epics::pvData::DeserializableControl* control);
static void serializeNullField(ByteBuffer* buffer, SerializableControl* control);
static void serializeNullField(epics::pvData::ByteBuffer* buffer, epics::pvData::SerializableControl* control);
/**
* Serialize PVRequest.
* @param buffer data buffer.
*/
static void serializePVRequest(ByteBuffer* buffer, SerializableControl* control, PVStructure::shared_pointer const & pvRequest);
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(ByteBuffer* buffer, SerializableControl* control, PVStructure::shared_pointer const & pvStructure);
static void serializeStructureFull(epics::pvData::ByteBuffer* buffer, epics::pvData::SerializableControl* control, epics::pvData::PVStructure::shared_pointer const & pvStructure);
};

View File

@@ -6,6 +6,7 @@
#include <pv/introspectionRegistry.h>
#include <pv/convert.h>
#include <pv/serializationHelper.h>
using namespace epics::pvData;
using namespace std;
@@ -102,10 +103,7 @@ void IntrospectionRegistry::serialize(FieldConstPtr const & field, ByteBuffer* b
{
if (field.get() == NULL)
{
// TODO
//SerializationHelper::serializeNullField(buffer, control);
control->ensureBuffer(1);
buffer->putByte(IntrospectionRegistry::NULL_TYPE_CODE);
SerializationHelper::serializeNullField(buffer, control);
}
else
{
@@ -161,73 +159,5 @@ FieldConstPtr IntrospectionRegistry::deserialize(ByteBuffer* buffer, Deserializa
return _fieldCreate->deserialize(buffer, control);
}
/*
void IntrospectionRegistry::serializeFull(FieldConstPtr field, ByteBuffer* buffer, SerializableControl* control)
{
serialize(field, StructureConstPtr(), buffer, control, NULL);
}
FieldConstPtr IntrospectionRegistry::deserializeFull(ByteBuffer* buffer, DeserializableControl* control)
{
return deserialize(buffer, control, NULL);
}
void IntrospectionRegistry::serializeStructure(ByteBuffer* buffer, SerializableControl* control, PVStructurePtr pvStructure)
{
if (pvStructure == NULL)
{
serialize(StructureConstPtr(), buffer, control);
}
else
{
serialize(pvStructure->getField(), buffer, control);
pvStructure->serialize(buffer, control);
}
}
PVStructurePtr IntrospectionRegistry::deserializeStructure(ByteBuffer* buffer, DeserializableControl* control)
{
PVStructurePtr pvStructure;
FieldConstPtr structureField = deserialize(buffer, control);
if (structureField.get() != NULL)
{
pvStructure = _pvDataCreate->createPVStructure(static_pointer_cast<const Structure>(structureField));
pvStructure->deserialize(buffer, control);
}
return pvStructure;
}
void IntrospectionRegistry::serializePVRequest(ByteBuffer* buffer, SerializableControl* control, PVStructurePtr pvRequest)
{
// for now ordinary structure, later can be changed
serializeStructure(buffer, control, pvRequest);
}
PVStructurePtr IntrospectionRegistry::deserializePVRequest(ByteBuffer* buffer, DeserializableControl* control)
{
// for now ordinary structure, later can be changed
return deserializeStructure(buffer, control);
}
PVStructurePtr IntrospectionRegistry::deserializeStructureAndCreatePVStructure(ByteBuffer* buffer, DeserializableControl* control)
{
FieldConstPtr field = deserialize(buffer, control);
if (field == NULL)
return PVStructurePtr();
return _pvDataCreate->createPVStructure(static_pointer_cast<const Structure>(field));
}
void IntrospectionRegistry::serializeStatus(ByteBuffer* buffer, SerializableControl* control, const Status& status)
{
status.serialize(buffer, control);
}
void IntrospectionRegistry::deserializeStatus(Status &status, ByteBuffer* buffer, DeserializableControl* control)
{
status.deserialize(buffer, control);
}
*/
}}