Teamcenter C++ API Reference  2312
BusinessObjectExtenderRegistry.hxx
Go to the documentation of this file.
1 // ==================================================
2 // Copyright 2014.
3 // Siemens Product Lifecycle Management Software Inc.
4 // All Rights Reserved.
5 // ==================================================
6 
13 /* */
14 
15 #ifndef TEAMCENTER_BUSINESSOBJECTEXTENDERREGISTRY_HXX
16 #define TEAMCENTER_BUSINESSOBJECTEXTENDERREGISTRY_HXX
17 
18 #include <unidefs.h>
20 #include <metaframework/libmetaframework_exports.h>
21 
27 namespace Teamcenter
28 {
32  typedef BusinessObjectExtender* (*BusinessObjectExtenderConstructor)( tag_t );
38 }
39 
43 extern METAFRAMEWORK_API void registerExtenderInterface(const std::string& owningExtenderInterfaceName, const std::string& boInterfaceName, const std::string& boName, Teamcenter::BusinessObjectExtenderConstructor ctr,
48 extern METAFRAMEWORK_API Teamcenter::BusinessObjectExtender* findExtenderInterfaceObject (const std::string& interfaceName, tag_t objTag);
49 
50 namespace Teamcenter
51 {
52 
69  template <class B>
71  {
72 
73  public:
77  void registerExtender(const std::string& boName, const std::string& boInterface, BusinessObjectExtenderConstructor ctr,
79  {
80  registerExtenderInterface(B::getExtenderInterfaceName(), boInterface, boName, ctr, initilaizer);
81  };
82 
89  tag_t objTag
90  ) const
91  {
92  return dynamic_cast<B* > ( findExtenderInterfaceObject ( B::getExtenderInterfaceName(), objTag ) );
93  }
94  };
95 }
96 
99 #include <metaframework/libmetaframework_undef.h>
100 #endif //TEAMCENTER_BUSINESSOBJECTEXTENDERREGISTRY_HXX