github.com/kaydxh/golang@v0.0.131/pkg/gocv/cgo/third_path/opencv4/include/opencv2/gapi/s11n/base.hpp (about) 1 // This file is part of OpenCV project. 2 // It is subject to the license terms in the LICENSE file found in the top-level directory 3 // of this distribution and at http://opencv.org/license.html. 4 // 5 // Copyright (C) 2020 Intel Corporation 6 7 #ifndef OPENCV_GAPI_S11N_BASE_HPP 8 #define OPENCV_GAPI_S11N_BASE_HPP 9 10 #include <opencv2/gapi/own/assert.hpp> 11 #include <opencv2/gapi/own/exports.hpp> 12 13 namespace cv { 14 namespace gapi { 15 16 /** 17 * @brief This namespace contains G-API serialization and 18 * deserialization functions and data structures. 19 */ 20 namespace s11n { 21 struct IOStream; 22 struct IIStream; 23 24 namespace detail { 25 26 struct NotImplemented { 27 }; 28 29 // The default S11N for custom types is NotImplemented 30 // Don't! sublass from NotImplemented if you actually implement S11N. 31 template<typename T> 32 struct S11N: public NotImplemented { 33 static void serialize(IOStream &, const T &) { 34 GAPI_Assert(false && "No serialization routine is provided!"); 35 } 36 static T deserialize(IIStream &) { 37 GAPI_Assert(false && "No deserialization routine is provided!"); 38 } 39 }; 40 41 template<typename T> struct has_S11N_spec { 42 static constexpr bool value = !std::is_base_of<NotImplemented, 43 S11N<typename std::decay<T>::type>>::value; 44 }; 45 46 } // namespace detail 47 } // namespace s11n 48 } // namespace gapi 49 } // namespace cv 50 51 #endif // OPENCV_GAPI_S11N_BASE_HPP