IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BasePtrColl.h
1 // BasePtrColl.h:
3 // --------------
4 //
15 
16 #ifndef __IPSDKBASEDATA_BASEPTRCOLL_H__
17 #define __IPSDKBASEDATA_BASEPTRCOLL_H__
18 
19 // suppression warnings
20 // warning C4251: 'ipsdk::BasePtrColl::_coll' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class 'ipsdk::BasePtrColl'
21 #pragma warning (push)
22 #pragma warning (disable : 4251)
23 
25 #include <IPSDKSerialization/Engine/BaseObjectWithSkeleton.h>
26 #include <vector>
27 
28 namespace ipsdk {
29 
32 
34 {
35  // declare serial class
37 
38 // predefined public types
39 public:
41  typedef std::vector<SerializationObjectPtr> BaseCollType;
42 
43 public:
46  BasePtrColl();
47  virtual ~BasePtrColl() = 0;
49 
50 // methods
51 public:
53  virtual const std::string& getElementsClassName() const = 0;
54 
57  virtual bool haveSkeleton() const = 0;
58 
60  ipUInt32 getSize() const;
61 
63  bool isEmpty() const;
64 
66  void clear();
67 
68 protected:
71  const BaseCollType& getBaseColl() const;
72  BaseCollType& getBaseColl();
74 
75 // attributes
76 protected:
79 };
80 
83 
84 inline ipUInt32
86 {
87  return static_cast<ipUInt32>(_coll.size());
88 }
89 
90 inline bool
92 {
93  return _coll.empty();
94 }
95 
96 inline const BasePtrColl::BaseCollType&
98 {
99  return _coll;
100 }
101 
104 {
105  return _coll;
106 }
107 inline void
109 {
110  _coll.clear();
111 }
112 
115 
116 } // end of namespace ipsdk
117 
118 #pragma warning (pop)
119 
120 #endif // __IPSDKBASEDATA_BASEPTRCOLL_H__
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
BaseCollType _coll
collection of serializable object
Definition: BasePtrColl.h:78
#define IPSDK_DECLARE_ABSTRACT_SERIAL_WITHOUT_COPY(libraryName, className)
macro enabling serialization on abstract class
Definition: SerializationHdrMacro.h:97
Definition of import/export macro for library.
bool isEmpty() const
check whether collection is emtpy
Definition: BasePtrColl.h:91
ipUInt32 getSize() const
retrieve collection size
Definition: BasePtrColl.h:85
std::vector< SerializationObjectPtr > BaseCollType
collection of serializable object
Definition: BasePtrColl.h:41
Base class for serialization object with three serialization modes :
Definition: BaseObjectWithSkeleton.h:33
void clear()
clear collection data
Definition: BasePtrColl.h:108
Base class for collection (std::vector) of shared pointer to serializable objects.
Definition: BasePtrColl.h:33
#define IPSDKBASEDATA_API
Import/Export macro for library IPSDKUtil.
Definition: IPSDKBaseDataExports.h:27
const BaseCollType & getBaseColl() const
access to base collection
Definition: BasePtrColl.h:97
boost::enable_if< typename boost::mpl::and_< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename boost::is_same< boost::mpl::int_< LeafCollType::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_LeafColl > >::type >::type, RulePtr >::type isEmpty(const boost::shared_ptr< AttributeType > &pAttribute)
functions allowing to check that a leaf collection is empty
Definition: LeafCollSizeRuleOperators.h:65
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53