Loading...
Searching...
No Matches
cv::gapi::s11n::detail::S11N< T > Struct Template Reference
This structure allows to implement serialization routines for custom types. More...
#include <opencv2/gapi/s11n/base.hpp>
Inheritance diagram for cv::gapi::s11n::detail::S11N< T >:
Static Public Member Functions | |
static T | deserialize (IIStream &) |
This function allows user to deserialize their custom type. | |
static void | serialize (IOStream &, const T &) |
This function allows user to serialize their custom type. | |
Detailed Description
template<typename T>
struct cv::gapi::s11n::detail::S11N< 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 cv {
namespace gapi {
namespace s11n {
namespace detail {
os << p.val;
}
SimpleCustomType p;
is >> p.val;
return p;
}
};
template<> struct S11N<SimpleCustomType2> {
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;
}
};
} // namespace detail
} // namespace s11n
} // namespace gapi
} // namespace cv
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:106
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
Member Function Documentation
◆ deserialize()
template<typename T >
|
inlinestatic |
This function allows user to deserialize their custom type.
- Note
- The default overload throws an exception if called. User need to properly overload the function to use it.
◆ serialize()
template<typename T >
|
inlinestatic |
This function allows user to serialize their custom type.
- Note
- The default overload throws an exception if called. User need to properly overload the function to use it.
The documentation for this struct was generated from the following file:
- opencv2/gapi/s11n/base.hpp