![]() |
Inviwo 0.9.12-pre
Inviwo documentation
|
#include <inviwo/core/util/factory.h>
Public Member Functions | |
| virtual std::unique_ptr< T > | create (Key key, Args... args) const override |
| virtual bool | hasKey (Key key) const override |
| Public Member Functions inherited from inviwo::Factory< T, std::string_view, Args... > | |
| virtual std::unique_ptr< T > | create (std::string_view key, Args... args) const =0 |
| virtual std::shared_ptr< T > | createShared (std::string_view key, Args... args) const |
| virtual bool | hasKey (std::string_view key) const=0 |
| Factory & | operator= (const Factory &)=delete |
| Public Member Functions inherited from inviwo::FactoryBase | |
| FactoryBase (const FactoryBase &)=delete | |
| FactoryBase (FactoryBase &&)=default | |
| FactoryBase & | operator= (const FactoryBase &)=delete |
| FactoryBase & | operator= (FactoryBase &&)=default |
| Public Member Functions inherited from inviwo::FactoryRegister< FactoryObject, factoryKeyType< std::string_view >, std::string_view > | |
| FactoryObject * | getFactoryObject (std::string_view key) const |
| std::vector< factoryKeyType< std::string_view > > | getKeys () const |
| auto | getKeyView () const |
| bool | hasKey (std::string_view key) const |
| virtual bool | registerObject (FactoryObject *obj) |
| virtual bool | unRegisterObject (FactoryObject *obj) |
| Public Member Functions inherited from inviwo::Observable< FactoryObserver< FactoryObject > > | |
| void | addObserver (FactoryObserver< FactoryObject > *observer) |
| bool | isObservedBy (FactoryObserver< FactoryObject > *observer) const |
| Observable< FactoryObserver< FactoryObject > > & | operator= (const Observable< FactoryObserver< FactoryObject > > &other) |
| void | removeObserver (FactoryObserver< FactoryObject > *observer) |
| virtual void | startBlockingNotifications () override final |
| virtual void | stopBlockingNotifications () override final |
Additional Inherited Members | |
| Protected Member Functions inherited from inviwo::FactoryObservable< FactoryObject > | |
| void | notifyObserversOnRegister (FactoryObject *p) |
| void | notifyObserversOnUnRegister (FactoryObject *p) |
| Protected Member Functions inherited from inviwo::Observable< FactoryObserver< FactoryObject > > | |
| void | forEachObserver (C callback) |
| Protected Member Functions inherited from inviwo::ObservableInterface | |
| void | addObservationHelper (Observer *observer) |
| virtual void | addObserver (Observer *observer)=0 |
| void | removeObservationHelper (Observer *observer) |
| virtual void | removeObserver (Observer *observer)=0 |
| Protected Attributes inherited from inviwo::FactoryRegister< FactoryObject, factoryKeyType< std::string_view >, std::string_view > | |
| std::map< factoryKeyType< std::string_view >, FactoryObject *, std::less<> > | map_ |
Standard setup of Factory using factory objects to create an instance. The factory will use a FactoryRegister of FactoryObject and factoryKeyType<Key>. This indirection allows std::string_view to be used as key where as the FactoryRegister will store strings for the keys.
| T | The object created |
| FactoryObject | An object with a function std::unique_ptr<T> create(Args...) that can create objects of type T with constructor T(Args...). FactoryObject would usually be a "factory object". A getClassIdentifier() function is also required for registration. |
| Key | Models a key used to look up T |
| Args | A variadic list of arguments passed to T on construction |