16 #ifndef __IPSDKBASEPROCESSING_RULECUSTOMLEAFCOLLSIZE_H__ 17 #define __IPSDKBASEPROCESSING_RULECUSTOMLEAFCOLLSIZE_H__ 19 #include <IPSDKBaseProcessing/Rule/Attribute/DataItem/LeafColl/Size/BaseTLeafCollSizeRule.h> 20 #include <boost/function.hpp> 28 template <
typename AttributeType,
29 typename LeafCollType,
30 eValueComparisonRuleType::domain ValueComparisonRuleType>
36 typedef typename boost::enable_if<typename boost::is_same<boost::mpl::int_<AttributeType::g_attributeType>,
37 boost::mpl::int_<eAttributeType::eAT_DataItem> >::type,
41 typedef typename boost::enable_if<typename boost::is_same<boost::mpl::int_<LeafCollType::g_itemType>,
42 boost::mpl::int_<eDataItemType::eDIT_LeafColl> >::type,
60 void init(
const boost::weak_ptr<const AttributeType>& pAttribute,
83 template <
typename AttributeType,
typename LeafCollType, eValueComparisonRuleType::domain ValueComparisonRuleType>
89 _customSizeFun = customSizeFun;
95 template <
typename AttributeType,
typename LeafCollType, eValueComparisonRuleType::domain ValueComparisonRuleType>
99 return AttributeType::getObjectNameStr() +
"::" +
100 DataItemType::template getNodeNameStr<LeafCollType>() +
"{size}";
103 template <
typename AttributeType,
typename LeafCollType, eValueComparisonRuleType::domain ValueComparisonRuleType>
107 return _customSizeFun();
110 template <
typename AttributeType,
typename LeafCollType, eValueComparisonRuleType::domain ValueComparisonRuleType>
115 const AttributeType& derivedAttribute =
static_cast<const AttributeType&
>(this->getAttribute1());
117 return derivedAttribute.getNode().template getSize<LeafCollType>();
126 #endif // __IPSDKBASEPROCESSING_RULECUSTOMLEAFCOLLSIZE_H__ Concrete class for rules on size of leaf collections of data item attributes with custom target size...
Definition: RuleCustomLeafCollSize.h:31
void init(const boost::weak_ptr< const AttributeType > &pAttribute, CustomSizeFun customSizeFun)
initialization of object
Definition: RuleCustomLeafCollSize.h:85
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
boost::function< ipUInt32()> CustomSizeFun
type associated to functions allowing to retrieve target collection size
Definition: RuleCustomLeafCollSize.h:46
ipUInt32 getTargetSize() const
method allowing to retrieve target size into derived class
Definition: RuleCustomLeafCollSize.h:105
void initBase()
base class initialization method
ipUInt32 getCollSize() const
method allowing to retrieve collection size into derived class
Definition: RuleCustomLeafCollSize.h:112
boost::enable_if< typename boost::is_same< boost::mpl::int_< AttributeType::g_attributeType >, boost::mpl::int_< eAttributeType::eAT_DataItem > >::type, typename AttributeType::ValueType >::type DataItemType
retrieve attribute type
Definition: RuleCustomLeafCollSize.h:38
CustomSizeFun _customSizeFun
function allowing to retrieve target collection size
Definition: RuleCustomLeafCollSize.h:77
std::string getAttributeName() const
method allowing to retrieve attribute name into derived class
Definition: RuleCustomLeafCollSize.h:97
Base template class for rules on size of leaf collections of data item attributes.
Definition: BaseTLeafCollSizeRule.h:28
boost::enable_if< typename boost::is_same< boost::mpl::int_< LeafCollType::g_itemType >, boost::mpl::int_< eDataItemType::eDIT_LeafColl > >::type, typename LeafCollType::ValueType >::type ValueType
Value type associated to leaf.
Definition: RuleCustomLeafCollSize.h:43
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53