Serialize Protobuf
Algorithm Implementations
activity_type
-
class activity_type : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
activity
-
class activity : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
bounding_box
-
class bounding_box : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
detected_object_set
-
class detected_object_set : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
detected_object_type
-
class detected_object_type : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
detected_object
-
class detected_object : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
geo_polygon
-
class geo_polygon : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
image
-
class image : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &elements) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &elements) override
metadata_map_io
Warning
doxygenclass: Cannot find class “kwiver::arrows::serialize::protobuf::metadata_map_io” in doxygen xml output for project “kwiver” from directory: ./_build/xml
metadata
-
class metadata : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
object_track_set
-
class object_track_set : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
object_track_state
-
class object_track_state : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
string
-
class string : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
timestamp
-
class timestamp : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
track_set
-
class track_set : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
track_state
-
class track_state : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
track
-
class track : public kwiver::vital::algo::data_serializer
Public Functions
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override
Serialize the item into a byte string.
This method serializes the supplied data item(s) and returns a byte string.
All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
The type of the data represented by the datum must match the type expected by the serializer implementation or an exception will be thrown.
- Parameters:
elements – Data items to be serialized.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Byte string of serialized data item.
-
virtual vital::any deserialize(const std::string &message) override
Deserialize byte string into data type.
Deserialize the supplied string of bytes into new data item(s). This method must handle an input byte string created by the
serialize()method and convert it to the concrete type(s). The actual type used for the conversion is based on the concrete implementation of this algorithm. If the input byte string does not represent the expected data type, then an exception will be thrown.All implementations must define the set of expected element names. An exception is thrown if a names is supplied and is not known to the implementation. An implementation can elect to accept an input map that does not contain all supported element names.
If the implementation only supports a single data element, then the name associated with that element will be “datum”.
- Parameters:
message – Serialized data item that is to be processed.
- Throws:
kwiver::vital::bad_any_cast –
kwiver::vital::serialization – - for unexpected element name
- Returns:
Concrete data type, represented as an any, created from the input.
-
virtual std::shared_ptr<std::string> serialize(const vital::any &element) override