As i understood, only classes and structures can be serialized. Whether complex data types contained in structure can be serialized?
I have custom class with '@ remote' directive, so its public methods are reachable from other bundles. Is it possible to have public method which will return Poco::XML::Document object as return type?
I tried to place Poco::XML::Document variable inside structure which has '@ serialize' directive, run remoteNG generator, but when I try to compile bundle, I get error "DocumentSerializer.h: No such file or directory". I understand that it must be DocumentSerializer and DocumentDeserializer helper classes, but I don't know how to generate it.
Do I have to write TypeSerializer for Document type, and where and how should I do it?
As i understood, only classes and structures can be serialized. Whether complex data types contained in structure can be serialized?
I have custom class with '@ remote' directive, so its public methods are reachable from other bundles. Is it possible to have public method which will return Poco::XML::Document object as return type?
I tried to place Poco::XML::Document variable inside structure which has '@ serialize' directive, run remoteNG generator, but when I try to compile bundle, I get error "DocumentSerializer.h: No such file or directory". I understand that it must be DocumentSerializer and DocumentDeserializer helper classes, but I don't know how to generate it.
Do I have to write TypeSerializer for Document type, and where and how should I do it?
Inside MyBundle I have:
//@ serialize struct DocumentValue { DocumentValue(): _pDocument(NULL) { }
};
Helper class DocumentValueSerializer contains:
include "IoT/MyBundle/DocumentDeserializer.h"
include "IoT/MyBundle/DocumentSerializer.h"
include "IoT/MyBundle/MbusPollControl.h"
include "Poco/RemotingNG/TypeSerializer.h"
namespace Poco { namespace RemotingNG {
template <> class TypeSerializer
{
public:
static void serialize(const std::string& name, const MyBundle::DocumentValue& value, Serializer& ser)
{
ser.serializeStructBegin(name);
serializeImpl(value, ser);
ser.serializeStructEnd(name);
}
};
} // namespace RemotingNG } // namespace Poco
Any example would be of great help to me.
Thanks in advance Aleksandar