4#include "MRPch/MRBindingMacros.h"
18#define MR_ADD_CLASS_FACTORY( className ) \
19 static MR::ObjectFactory<className> className##_Factory_{ #className };
30 std::string className_;
37 static_assert( std::is_base_of_v<Object, T>,
"MR::Object is not base of T" );
41 []() {
return std::static_pointer_cast<Object>( std::make_shared<T>() ); } )
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Definition MRObjectFactory.h:24
MRMESH_API ~ObjectFactoryBase()
MR_BIND_IGNORE MRMESH_API ObjectFactoryBase(std::string className, ObjectMakerFunc *creator)
Definition MRObjectFactory.h:35
ObjectFactory(std::string className)
Definition MRObjectFactory.h:39
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:21