32 #include "../EventId.h"
33 #include "rsb/protocol/EventId.pb.h"
42 EventIdConverter::EventIdConverter() :
55 return "EventIdConverter";
62 "Called with unsupported data type " + data.first);
65 boost::shared_ptr<EventId> eventId = boost::static_pointer_cast<
EventId>(
68 boost::shared_ptr<protocol::EventId> protocolId(
new protocol::EventId);
70 boost::uuids::uuid uuid = eventId->getParticipantId().getId();
71 protocolId->set_sender_id(uuid.data, uuid.size());
72 protocolId->set_sequence_number(eventId->getSequenceNumber());
75 make_pair(rsc::runtime::typeName<protocol::EventId>(), protocolId),
83 boost::shared_ptr<protocol::EventId> protocolId =
84 boost::static_pointer_cast<protocol::EventId>(
89 boost::shared_ptr<EventId>(
92 (boost::uint8_t*) protocolId->sender_id().c_str()),
93 protocolId->sequence_number())));
virtual ~EventIdConverter()
std::pair< std::string, boost::shared_ptr< void > > AnnotatedData
A combination of data type and the actual data.
std::string serialize(const AnnotatedData &data, std::string &wire)
Serialized the given domain object to the wire.
An exception indicating a serialization or deserialization problem for data.
std::string getWireSchema() const
Returns the name of the wire schema this converter can (de)serialize from/to.
A generic converter for data types based on Protocol Buffer messages.
virtual std::string getWireSchema() const
Returns the name of the wire schema this converter can (de)serialize from/to.
Converter< std::string >::Ptr converter
virtual AnnotatedData deserialize(const std::string &wireSchema, const WireType &wire)=0
Deserializes a domain object from a wire type.
virtual std::string serialize(const AnnotatedData &data, WireType &wire)=0
Serialized the given domain object to the wire.
AnnotatedData deserialize(const std::string &wireSchema, const std::string &wire)
Deserializes a domain object from a wire type.
virtual std::string getDataType() const
Returns the name of the data type this converter is applicable for.
std::string getClassName() const
A unique ID for events in RSB.