X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FObject.h;h=03eb2ae1f912047a88153ad96031f91a7bb4e480;hb=00b54bc0344d74f31df8b93f7c28a07cfc8d6873;hp=ef8cab82dfedf6c96feaa84174cd9ef86462c1ca;hpb=2361f4f97631e09d88d8a5510a369817dcaa19db;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/Object.h b/lib/cpPlugins/Interface/Object.h index ef8cab8..03eb2ae 100644 --- a/lib/cpPlugins/Interface/Object.h +++ b/lib/cpPlugins/Interface/Object.h @@ -1,64 +1,19 @@ #ifndef __CPPLUGINS__INTERFACE__OBJECT__H__ #define __CPPLUGINS__INTERFACE__OBJECT__H__ -#include -#include -#include +#include -#define ITK_MANUAL_INSTANTIATION +#include #include #include -// ------------------------------------------------------------------------- -#define CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \ - class cpPlugins_EXPORT TYPE##Provider \ - : public pluma::Provider \ - { \ - private: \ - friend class pluma::Pluma; \ - static const unsigned int PLUMA_INTERFACE_VERSION; \ - static const unsigned int PLUMA_INTERFACE_LOWEST_VERSION; \ - static const std::string PLUMA_PROVIDER_TYPE; \ - std::string plumaGetType( ) const \ - { return( PLUMA_PROVIDER_TYPE ); } \ - public: \ - unsigned int getVersion( ) const \ - { return( PLUMA_INTERFACE_VERSION ); } - -// ------------------------------------------------------------------------- -#define CPPLUGINS_PROVIDER_HEADER_END }; - -// ------------------------------------------------------------------------- -#define CPPLUGINS_PROVIDER_HEADER( TYPE ) \ - CPPLUGINS_PROVIDER_HEADER_BEGIN( TYPE ) \ - virtual TYPE::Pointer create( ) const = 0; \ - CPPLUGINS_PROVIDER_HEADER_END - -// ------------------------------------------------------------------------- -#define CPPLUGINS_PROVIDER_SOURCE( TYPE, Version, LowestVersion ) \ - PLUMA_PROVIDER_SOURCE( TYPE, Version, LowestVersion ) - -// ------------------------------------------------------------------------- -#define CPPLUGINS_INHERIT_PROVIDER( TYPE ) \ - class TYPE##Provider \ - : public cpPlugins::Interface::ObjectProvider \ - { \ - public: \ - cpPlugins::Interface::Object::Pointer create( ) const \ - { \ - TYPE::Pointer a = TYPE::New( ); \ - cpPlugins::Interface::Object::Pointer b = a.GetPointer( ); \ - return( b ); \ - } \ - }; - namespace cpPlugins { namespace Interface { /** */ - class cpPlugins_EXPORT Object + class cpPlugins_Interface_EXPORT Object : public itk::Object { public: @@ -70,10 +25,10 @@ namespace cpPlugins public: itkNewMacro( Self ); itkTypeMacro( Object, itkObject ); + cpPlugins_Id_Macro( Object, "BaseObject" ); - public: - itkGetConstMacro( ClassName, std::string ); - itkGetConstMacro( ClassCategory, std::string ); + itkGetStringMacro( Name ); + itkSetStringMacro( Name ); protected: Object( ); @@ -85,15 +40,9 @@ namespace cpPlugins Self& operator=( const Self& ); protected: - std::string m_ClassName; - std::string m_ClassCategory; + std::string m_Name; }; - /** - * Plugin provider - */ - CPPLUGINS_PROVIDER_HEADER( Object ); - } // ecapseman } // ecapseman