IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
AttributeSrcMacros.h
Go to the documentation of this file.
1 // AttributeSrcMacros.h:
3 // ---------------------
4 //
14 
15 #ifndef __IPSDKBASEPROCESSING_ATTRIBUTESRCMACROS_H__
16 #define __IPSDKBASEPROCESSING_ATTRIBUTESRCMACROS_H__
17 
20 #include <IPSDKBaseProcessing/Attribute/Base/AttributeFactory.h>
21 #include <boost/make_shared.hpp>
22 
25 
28 #define IPSDK_IMPLEMENT_ATTRIBUTE_BASE_BODY(className, eMsgEnum) \
29  ipsdk::processor::AttributePtr className::createBaseAttribute() { \
30  return boost::make_shared<className>(); \
31  } \
32  boost::shared_ptr<className> className::createAttribute() { \
33  return boost::make_shared<className>(); \
34  } \
35  ipsdk::processor::RulePtr className::createRule(const ipsdk::processor::AttributePtr& pBaseThis) const \
36  { \
37  boost::shared_ptr<className> pThis = \
38  boost::static_pointer_cast<className,ipsdk::processor::BaseAttribute>(pBaseThis); \
39  return className::createRule(pThis); \
40  } \
41  namespace ipsdk { \
42  namespace processor { \
43  template <typename T> \
44  struct AttributeRegistrator; \
45  template <> \
46  struct AttributeRegistrator<className> { \
47  AttributeRegistrator() \
48  { \
49  MessageMapRegistrator<eMsgEnum>::process(); \
50  AttributeFactory& factory = AttributeFactory::getInstance(); \
51  factory.registerAttribute<className>(); \
52  } \
53  ~AttributeRegistrator() \
54  { \
55  AttributeFactory& factory = AttributeFactory::getInstance(); \
56  factory.unRegisterAttribute<className>(); \
57  } \
58  static AttributeRegistrator<className> g_bAttributeRegistrator; \
59  }; \
60  AttributeRegistrator<className> AttributeRegistrator<className>::g_bAttributeRegistrator; \
61  } \
62  }
63 
66 
67 #endif // __IPSDKBASEPROCESSING_ATTRIBUTESRCMACROS_H__
Source part of macros set for ToolTip class declaration.
Source part of macros set for class serialization.