template<typename T>
struct cv::gapi::s11n::detail::S11N< T >
This structure allows to implement serialization routines for custom types.
The default S11N for custom types is not implemented.
- Note
- When providing an overloaded implementation for S11N with your type don't inherit it from NotImplemented structure.
-
There are lots of overloaded >> and << operators for basic and OpenCV/G-API types which can be utilized when serializing a custom type.
Example of usage:
namespace gapi {
namespace s11n {
namespace detail {
template<>
struct S11N<SimpleCustomType> {
os << p.val;
}
SimpleCustomType p;
is >> p.val;
return p;
}
};
template<> struct S11N<SimpleCustomType2> {
static void serialize(IOStream &os,
const SimpleCustomType2 &p) {
os << p.val << p.name << p.vec << p.mmap;
}
static SimpleCustomType2 deserialize(IIStream &is) {
SimpleCustomType2 p;
is >> p.val >> p.name >> p.vec >> p.mmap;
return p;
}
};
}
}
}
}
cv::GComputation deserialize(const std::vector< char > &bytes)
Deserialize GComputation from a byte array.
Definition s11n.hpp:90
std::vector< char > serialize(const cv::GComputation &c)
Serialize a graph represented by GComputation into an array of bytes.
"black box" representation of the file storage associated with a file on disk.
Definition core.hpp:102
This structure is an interface for deserialization routines.
Definition s11n.hpp:200
This structure is an interface for serialization routines.
Definition s11n.hpp:174
This structure allows to implement serialization routines for custom types.
Definition base.hpp:47