$extrastylesheet
#include <factory.h>

Public Member Functions | |
| FactoryImp (const std::string &name) | |
| ~FactoryImp () | |
Static Public Member Functions | |
| static UniquePtr< Base > | build (const std::string &name) |
Protected Member Functions | |
| template<> | |
| std::map< std::string, Factory < Partitioner > * > & | factory_map () |
Static Protected Member Functions | |
| static std::map< std::string, Factory< Base > * > & | factory_map () |
Private Member Functions | |
| UniquePtr< Base > | create () |
Factory implementation class.
| libMesh::FactoryImp< Derived, Base >::FactoryImp | ( | const std::string & | name | ) | [inline] |
| libMesh::FactoryImp< Derived, Base >::~FactoryImp | ( | ) | [inline] |
| UniquePtr< Base > libMesh::Factory< Base >::build | ( | const std::string & | name | ) | [inline, static, inherited] |
Builds an object of type Base identified by name.
Definition at line 126 of file factory.h.
References libMesh::Factory< Base >::create(), libMesh::err, and libMesh::Quality::name().
{
// name not found in the map
if (!factory_map().count(name))
{
libMesh::err << "Tried to build an unknown type: " << name << std::endl;
libMesh::err << "valid options are:" << std::endl;
for (typename std::map<std::string,Factory<Base>*>::const_iterator
it = factory_map().begin(); it != factory_map().end(); ++it)
libMesh::err << " " << it->first << std::endl;
libmesh_error_msg("Exiting...");
// We'll never get here
return UniquePtr<Base>();
}
Factory<Base> *f = factory_map()[name];
return UniquePtr<Base>(f->create());
}
| UniquePtr< Base > libMesh::FactoryImp< Derived, Base >::create | ( | ) | [inline, private, virtual] |
Implements libMesh::Factory< Base >.
Definition at line 164 of file factory.h.
{
return UniquePtr<Base>(new Derived);
}
| std::map< std::string, Factory< Partitioner > * > & libMesh::Factory< Partitioner >::factory_map | ( | ) | [protected, inherited] |
Definition at line 40 of file partitioner_factory.C.
{
static std::map<std::string, Factory<Partitioner>*> _map;
return _map;
}
| static std::map<std::string, Factory<Base>*>& libMesh::Factory< Base >::factory_map | ( | ) | [static, protected, inherited] |
Map from a name to a Factory<Base>* pointer.