IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
BaseDataItemNodeColl.h
1 // BaseDataItemNodeColl.h:
3 // -----------------------
4 //
14 
15 #ifndef __IPSDKBASEDATA_BASEDATAITEMNODECOLL_H__
16 #define __IPSDKBASEDATA_BASEDATAITEMNODECOLL_H__
17 
18 // suppression of warnings
19 // warning C4251: 'ipsdk::BaseDataItemNodeColl::_coll' : class 'std::vector<_Ty>' needs to have dll-interface to be used by clients of class 'ipsdk::BaseDataItemNodeColl'
20 #pragma warning (push)
21 #pragma warning (disable : 4251)
22 
23 #include <IPSDKBaseData/DataItem/BaseDataItem.h>
24 
25 namespace ipsdk {
26 
29 
31 {
32  // declare serial class
34 
35 // predefined public types
36 public:
39  static const bool g_bIsColl = true;
40  static const bool g_bNode = true;
41  static const bool g_bLeaf = false;
42  static const eDataItemType::domain g_itemType = eDataItemType::eDIT_NodeColl;
44 
46  typedef std::vector<DataItemNodePtr> BaseCollType;
47 
48 public:
54 
55 // methods
56 public:
58  eDataItemType getDataItemType() const;
59 
61  bool isEmpty() const;
62 
64  ipUInt32 getSize() const;
65 
67  const BaseCollType& getBaseColl() const;
68 
70  void clear();
71 
72 protected:
77  const BaseDataItemNode& getNodeBase(const ipUInt32 nodeIdx) const;
78  BaseDataItemNode& getNodeBase(const ipUInt32 nodeIdx);
80 
84  void push_back(const DataItemNodePtr& pItemNode);
85 
86 // attributes
87 protected:
90 };
91 
94 
95 inline eDataItemType
97 {
98  return g_itemType;
99 }
100 
101 inline bool
103 {
104  return _coll.empty();
105 }
106 
107 inline ipUInt32
109 {
110  return static_cast<ipUInt32>(_coll.size());
111 }
114 {
115  return _coll;
116 }
117 
118 inline void
120 {
121  _coll.clear();
122 }
123 
126 
127 } // end of namespace ipsdk
128 
129 #pragma warning (pop)
130 
131 #endif // __IPSDKBASEDATA_BASEDATAITEMNODECOLL_H__
const BaseCollType & getBaseColl() const
retrieve base collection
Definition: BaseDataItemNodeColl.h:113
#define IPSDK_DECLARE_SERIAL_WITH_COPY(libraryName, className)
macro enabling serialization on class
Definition: SerializationHdrMacro.h:73
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Definition: DataItemTypes.h:55
Base class used to store data item nodes collection.
Definition: BaseDataItemNodeColl.h:30
static const eDataItemType::domain g_itemType
flags indicating item type
Definition: BaseDataItemNodeColl.h:42
boost::shared_ptr< BaseDataItemNode > DataItemNodePtr
shared pointer to DataItemNode
Definition: DataItemTypes.h:158
bool isEmpty() const
check whether collection is empty
Definition: BaseDataItemNodeColl.h:102
Base class for data item nodes.
Definition: BaseDataItemNode.h:29
ipUInt32 getSize() const
retrieve collection size
Definition: BaseDataItemNodeColl.h:108
void clear()
remove all items from collection
Definition: BaseDataItemNodeColl.h:119
#define IPSDKBASEDATA_API
Import/Export macro for library IPSDKUtil.
Definition: IPSDKBaseDataExports.h:27
Base class for data items.
Definition: BaseDataItem.h:27
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
eDataItemType
Enumerate describing data items type.
Definition: DataItemTypes.h:43
BaseCollType _coll
collection of nodes associated to object
Definition: BaseDataItemNodeColl.h:89
eDataItemType getDataItemType() const
retrieve data item type
Definition: BaseDataItemNodeColl.h:96
std::vector< DataItemNodePtr > BaseCollType
collection of nodes shared pointers
Definition: BaseDataItemNodeColl.h:46
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53