15 #ifndef __IPSDKSERIALIZATION_BOOSTSERIALIZATIONOPERATORS_H__ 16 #define __IPSDKSERIALIZATION_BOOSTSERIALIZATIONOPERATORS_H__ 22 #include <IPSDKSerialization/Archive/BaseIArchive.h> 23 #include <IPSDKSerialization/Archive/BaseOArchive.h> 24 #include <boost/filesystem/path.hpp> 25 #include <boost/date_time/gregorian/gregorian.hpp> 26 #include <boost/date_time/posix_time/posix_time.hpp> 27 #include <boost/optional.hpp> 28 #include <boost/shared_ptr.hpp> 29 #include <boost/variant.hpp> 30 #include <boost/type_traits/remove_const.hpp> 40 operator>> (BaseIArchive& ar,
const SerializationIItem<boost::filesystem::path>& item);
42 operator<< (BaseOArchive& ar, const SerializationOItem<boost::filesystem::path>& item);
48 operator>> (BaseIArchive& ar,
const SerializationIItem<boost::gregorian::date>& item);
50 operator<< (BaseOArchive& ar, const SerializationOItem<boost::gregorian::date>& item);
56 operator>> (BaseIArchive& ar,
const SerializationIItem<boost::posix_time::ptime>& item);
58 operator<< (BaseOArchive& ar, const SerializationOItem<boost::posix_time::ptime>& item);
68 boost::optional<T>& opt = item._value;
98 operator<< (BaseOArchive& ar, const SerializationOItem<boost::optional<T> >& item)
101 const boost::optional<T>& opt = item._value;
109 const bool bInit = opt.is_initialized();
112 const T& value = opt.get();
150 item._value = boost::static_pointer_cast<T>(pObject);
163 operator<< (BaseOArchive& ar, const SerializationOItem<boost::shared_ptr<T> >& item)
193 reportVariantSerializationError(
const int expectedTypeId,
194 const std::string& typeSeqStr);
196 template <
typename Sequence>
197 struct VariantLoadManager
201 template<
class VariantType>
202 static void apply(BaseIArchive& ar,
int which, VariantType& v)
208 template<
class VariantType>
209 static void apply(BaseIArchive& ar,
int which, VariantType& v)
213 typedef typename boost::mpl::front<Sequence>::type head_type;
220 typedef typename boost::mpl::pop_front<Sequence>::type type;
226 template<
class VariantType>
227 static void load(BaseIArchive& ar,
int which, VariantType& v) {
229 typedef typename boost::mpl::eval_if<boost::mpl::empty<Sequence>,
230 boost::mpl::identity<IterLoad>,
231 boost::mpl::identity<NullLoad>
240 template <BOOST_VARIANT_ENUM_PARAMS(
class T)>
255 typedef typename boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)>::types types;
256 if(which >= boost::mpl::size<types>::value)
257 reportVariantSerializationError(which, BOOST_PP_STRINGIZE((BOOST_VARIANT_ENUM_PARAMS(T))));
272 struct VariantSaveVisitor : boost::static_visitor<>
274 VariantSaveVisitor(BaseOArchive& ar) :
279 void operator()(T
const & value)
const 289 template <BOOST_VARIANT_ENUM_PARAMS(
class T)>
291 operator<< (BaseOArchive& ar, const SerializationOItem<boost::variant<BOOST_VARIANT_ENUM_PARAMS(T)> >& item)
300 const int which = item._value.which();
304 VariantSaveVisitor visitor(ar);
305 item._value.apply_visitor(visitor);
323 #endif // __IPSDKSERIALIZATION_BOOSTSERIALIZATIONOPERATORS_H__ Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
#define IPSDK_END_ARCHIVE_SECTION(unUsed)
macro allowing to end an archive section
Definition: ArchiveSectionMacros.h:29
Serialization operators for basic types.
#define IPSDK_MAKE_IITEM_VALUE(value)
macro for SerializationIItem creation
Definition: SerializationIItemMacros.h:26
boost::shared_ptr< const BaseSerializationObject > SerializationObjectConstPtr
shared pointer to a const base serialization object
Definition: SerializationTypes.h:32
IPSDK_FORCEINLINE ipsdk::simd::IS2Pack< instructionSet, T >::Type load(const T *pT)
load function; loads a simd pack from a buffer in memory
Definition: load.h:37
Macro set allowing to handle input object serialization.
Macro set allowing to handle input object serialization.
virtual void read(const SerializationIItem< BaseSerializationObject > &item)
read an object derived of base class
IPSDKBASEPROCESSING_API RulePtr none()
function allowing to define an empty rule (always true)
#define IPSDK_MAKE_OITEM_VALUE(value)
macro for SerializationOItem creation
Definition: SerializationOItemMacros.h:26
IPSDKGEOMETRY_API bool apply(const BaseGeometryTransform2d &transform, BaseGeometryEntity2d &entity)
function allowing to apply in situ a given transformation on an entity
Base class for serialization input archives.
Definition: BaseIArchive.h:36
boost::shared_ptr< BaseSerializationObject > SerializationObjectPtr
shared pointer to a base serialization object
Definition: SerializationTypes.h:23
#define IPSDK_START_ARCHIVE_SECTION(ar, sectionName)
macro allowing to star an archive section
Definition: ArchiveSectionMacros.h:23
Item used to format inputs during serialization.
Definition: DataItemNodeHdrMacrosDetails.h:42
IPSDKBASESHAPEANALYSIS_API ipsdk::BaseIArchive & operator>>(ipsdk::BaseIArchive &ar, const ipsdk::SerializationIItem< ipsdk::shape::analysis::MeasureId > &item)
serialization of ipsdk::shape::analysis::MeasureId structure
Definition of import/export macro for library.
#define IPSDKSERIALIZATION_API
Import/Export macro for library IPSDKUtil.
Definition: IPSDKSerializationExports.h:27