MeshLib Documentation
Loading...
Searching...
No Matches
MRObjectFactory.h File Reference
#include "MRMeshFwd.h"
#include "MRPch/MRBindingMacros.h"
#include <memory>
#include <string>

Go to the source code of this file.

Classes

class  MR::ObjectFactoryBase
 
class  MR::ObjectFactory< T >
 

Namespaces

namespace  MR
 
#define MR_ADD_CLASS_FACTORY(className)    static MR::ObjectFactory<className> className##_Factory_{ #className };
 use this macro to register a class in the factory before calling createObject
 
using MR::ObjectMakerFunc = std::shared_ptr<Object>()
 
MRMESH_API std::shared_ptr< ObjectMR::createObject (const std::string &className)
 the function to create new object instance by registered class name
 

Macro Definition Documentation

◆ MR_ADD_CLASS_FACTORY

#define MR_ADD_CLASS_FACTORY ( className)     static MR::ObjectFactory<className> className##_Factory_{ #className };

use this macro to register a class in the factory before calling createObject