usb: getting string descriptors, minor improvements
[quarnos.git] / manes / ods / data_transmit.h
blob662ef7a6c54da5662770e1933a267ac9c880231a
1 #ifndef _DATA_TRANSMIT_
2 #define _DATA_TRANSMIT_
4 #include "object_stream.h"
5 #include "object_serializer.h"
7 namespace manes {
8 namespace ods {
9 /**
10 * @brief Data pack representing obj_val
12 * @details Instances of this class are data packs cointaining
13 * all fields of obj_val object.
15 class data_pack : public serialized_object {
16 public:
17 virtual ~data_pack(){}
20 /**
21 * @brief Serializer of objects transported by value.
23 * @details This is a base class for all serializers able to
24 * marshall objects that can be transmitted only by their value.
26 class data_transmit : public object_serializer {
27 public:
28 /**
29 * Get object stream
30 * This method returns a stream of objects that can be
31 * used by an instance to serialize or deserialize
32 * itself.
33 * @return stream of objects
35 virtual object_stream &get_stream() const = 0;
37 /**
38 * Serialize object
39 * This method serializes object by creating a pack of data
40 * it is cointainging. In most implementations contribution
41 * of the object itself is required.
42 * @param obj object that is to be serialized
43 * @return pack of data, ready to be sent
45 virtual serialized_object serialize(p<object> obj) = 0;
47 /**
48 * Deserialzie object
49 * This method creates a exact copy of object basing on
50 * received pack of data. In most implementations
51 * contribution of the object itself is required.
52 * @param data received pack of data
53 * @return deserialized object
55 virtual p<object> deserialize(const serialized_object &data) = 0;
60 #endif