17#define MR_ADD_CLASS_FACTORY( className ) \
18 static MR::ObjectFactory<className> className##_Factory_{ #className };
29 std::string className_;
36 static_assert( std::is_base_of_v<Object, T>,
"MR::Object is not base of T" );
40 []() {
return std::static_pointer_cast<Object>( std::make_shared<T>() ); } )
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRObjectFactory.h:23
MRMESH_API ~ObjectFactoryBase()
MRMESH_API ObjectFactoryBase(std::string className, ObjectMakerFunc *creator)
Definition MRObjectFactory.h:34
ObjectFactory(std::string className)
Definition MRObjectFactory.h:38
MRMESH_API std::shared_ptr< Object > createObject(const std::string &className)
the function to create new object instance by registered class name
Definition MRCameraOrientationPlugin.h:8
std::shared_ptr< Object >() ObjectMakerFunc
Definition MRObjectFactory.h:20