15 #ifndef __IPSDKSERIALIZATION_STLSERIALIZATIONOPERATORS_H__ 16 #define __IPSDKSERIALIZATION_STLSERIALIZATIONOPERATORS_H__ 19 #include <IPSDKSerialization/Archive/BaseIArchive.h> 20 #include <IPSDKSerialization/Archive/BaseOArchive.h> 24 #include <boost/type_traits/is_arithmetic.hpp> 25 #include <boost/type_traits/is_same.hpp> 41 typename boost::enable_if_c<boost::is_arithmetic<T>::value ==
false,
46 std::vector<T>& coll = item._value;
63 typename std::vector<T>::iterator iter = coll.begin();
64 while (iter != coll.end()) {
82 typename boost::enable_if_c<boost::is_arithmetic<T>::value ==
true &&
83 boost::is_same<T, bool>::value ==
false,
88 std::vector<T>& coll = item._value;
106 ar.
read(coll.data(), size *
sizeof(T));
109 typename std::vector<T>::iterator iter = coll.begin();
110 while (iter != coll.end()) {
129 typename boost::enable_if_c<boost::is_same<T, ipBool>::value ==
true,
134 std::vector<T>& coll = item._value;
151 typename std::vector<T>::iterator iter = coll.begin();
152 while (iter != coll.end()) {
171 typename boost::enable_if_c<boost::is_arithmetic<T>::value ==
false ||
172 boost::is_same<T, ipBool>::value ==
true,
174 operator<< (BaseOArchive& ar, const SerializationOItem<std::vector<T> >& item)
177 const std::vector<T>& coll = item._value;
190 typename std::vector<T>::const_iterator iter = coll.begin();
191 while (iter != coll.end()) {
193 const T& value = *iter;
208 typename boost::enable_if_c<boost::is_arithmetic<T>::value ==
true &&
209 boost::is_same<T, ipBool>::value ==
false,
211 operator<< (BaseOArchive& ar, const SerializationOItem<std::vector<T> >& item)
214 const std::vector<T>& coll = item._value;
227 if (ar.isTextArchive() ==
false)
228 ar.write(coll.data(), size *
sizeof(T));
231 typename std::vector<T>::const_iterator iter = coll.begin();
232 while (iter != coll.end()) {
234 const T& value = *iter;
260 std::list<T>& coll = item._value;
277 typename std::list<T>::iterator iter = coll.begin();
278 while (iter != coll.end()) {
297 operator<< (BaseOArchive& ar, const SerializationOItem<std::list<T> >& item)
300 const std::list<T>& coll = item._value;
313 typename std::list<T>::const_iterator iter = coll.begin();
314 while (iter != coll.end()) {
316 const T& value = *iter;
338 template <
class Key,
class Value>
343 std::map<Key, Value>& coll = item._value;
377 template <
class Key,
class Value>
379 operator<< (BaseOArchive& ar, const SerializationOItem<std::map<Key, Value> >& item)
382 const std::map<Key, Value>& coll = item._value;
395 typename std::map<Key, Value>::const_iterator iter = coll.begin();
396 while (iter != coll.end()) {
398 const Key& key = iter->first;
399 const Value& value = iter->second;
428 std::set<T>& coll = item._value;
462 operator<< (BaseOArchive& ar, const SerializationOItem<std::set<T> >& item)
465 const std::set<T>& coll = item._value;
478 typename std::set<T>::const_iterator iter = coll.begin();
479 while (iter != coll.end()) {
481 const T& key = *iter;
508 std::deque<T>& coll = item._value;
525 typename std::deque<T>::iterator iter = coll.begin();
526 while (iter != coll.end()) {
545 operator<< (BaseOArchive& ar, const SerializationOItem<std::deque<T> >& item)
548 const std::deque<T>& coll = item._value;
561 typename std::deque<T>::const_iterator iter = coll.begin();
562 while (iter != coll.end()) {
564 const T& value = *iter;
585 template <
class T,
class U>
590 std::pair<T, U>& p = item._value;
616 template <
class T,
class U>
618 operator<< (BaseOArchive& ar, const SerializationOItem<std::pair<T, U> >& item)
621 const std::pair<T, U>& p = item._value;
629 const T& first = p.first;
630 const U& second = p.second;
651 #endif // __IPSDKSERIALIZATION_STLSERIALIZATIONOPERATORS_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
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
#define IPSDK_MAKE_OITEM_VALUE(value)
macro for SerializationOItem creation
Definition: SerializationOItemMacros.h:26
bool isTextArchive() const
method allowing to test whether archive is an human readable text archive
Definition: BaseArchive.h:98
Base class for serialization input archives.
Definition: BaseIArchive.h:36
#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.
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53