GRINS-0.8.0
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Attributes | Private Member Functions
GRINS::CatalycityFactoryAbstract Class Referenceabstract

#include <catalycity_factory_abstract.h>

Inheritance diagram for GRINS::CatalycityFactoryAbstract:
Inheritance graph
[legend]
Collaboration diagram for GRINS::CatalycityFactoryAbstract:
Collaboration graph
[legend]

Public Member Functions

 CatalycityFactoryAbstract (const std::string &physics_name)
 
 ~CatalycityFactoryAbstract ()
 
- Public Member Functions inherited from GRINS::FactoryWithGetPot< CatalycityBase >
 FactoryWithGetPot (const std::string &name)
 
 ~FactoryWithGetPot ()
 
- Public Member Functions inherited from GRINS::FactoryAbstract< CatalycityBase >
virtual ~FactoryAbstract ()
 

Static Public Member Functions

static void set_section (const std::string &section)
 
- Static Public Member Functions inherited from GRINS::FactoryWithGetPot< CatalycityBase >
static void set_getpot (const GetPot &input)
 
- Static Public Member Functions inherited from GRINS::FactoryAbstract< CatalycityBase >
static libMesh::UniquePtr< CatalycityBasebuild (const std::string &name)
 Use this method to build objects of type Base. More...
 

Protected Member Functions

virtual libMesh::UniquePtr< CatalycityBasebuild_catalycity (const GetPot &input, const std::string &section)=0
 
virtual void check_state () const
 Helper function to reduce code duplication. More...
 
virtual void reset_state ()
 Helper function to reduce code duplication. More...
 
- Protected Member Functions inherited from GRINS::FactoryAbstract< CatalycityBase >
 FactoryAbstract (const std::string &name)
 Constructor is protected. Use the build() method to construct Base objects. More...
 

Static Protected Attributes

static std::string _section = std::string("DIE!")
 
- Static Protected Attributes inherited from GRINS::FactoryWithGetPot< CatalycityBase >
static const GetPot * _input
 We store only a raw pointer here because we can't make a copy. More...
 

Private Member Functions

virtual libMesh::UniquePtr< CatalycityBasecreate ()
 Subclasses implement the actual construction of the Base object in create(). More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from GRINS::FactoryAbstract< CatalycityBase >
static FactoryAbstract< CatalycityBase > & get_factory (const std::string &name)
 Helper method that looks up the factory and returns it if present, or error if it's not. More...
 
static DerivedType & get_factory_subclass (const std::string &name)
 Like get_factory, but will downcast to DerivedType. More...
 
static std::map< std::string, FactoryAbstract< CatalycityBase > * > & factory_map ()
 

Detailed Description

Definition at line 38 of file catalycity_factory_abstract.h.

Constructor & Destructor Documentation

GRINS::CatalycityFactoryAbstract::CatalycityFactoryAbstract ( const std::string &  physics_name)
inline

Definition at line 41 of file catalycity_factory_abstract.h.

42  : FactoryWithGetPot<CatalycityBase>(physics_name)
43  {}
GRINS::CatalycityFactoryAbstract::~CatalycityFactoryAbstract ( )
inline

Definition at line 45 of file catalycity_factory_abstract.h.

45 {};

Member Function Documentation

virtual libMesh::UniquePtr<CatalycityBase> GRINS::CatalycityFactoryAbstract::build_catalycity ( const GetPot &  input,
const std::string &  section 
)
protectedpure virtual
void GRINS::CatalycityFactoryAbstract::check_state ( ) const
inlineprotectedvirtual

Helper function to reduce code duplication.

Reimplemented in GRINS::CatalycityFactoryOldStyleBase.

Definition at line 81 of file catalycity_factory_abstract.h.

References GRINS::FactoryWithGetPot< CatalycityBase >::_input, and _section.

Referenced by GRINS::CatalycityFactoryOldStyleBase::check_state(), and create().

82  {
83  if( !_input )
84  libmesh_error_msg("ERROR: must call set_getpot() before building Catalycity!");
85 
86  if( _section == std::string("DIE!") )
87  libmesh_error_msg("ERROR: must call set_section() before building Catalycity!");
88  }
static const GetPot * _input
We store only a raw pointer here because we can't make a copy.
libMesh::UniquePtr< CatalycityBase > GRINS::CatalycityFactoryAbstract::create ( )
inlineprivatevirtual

Subclasses implement the actual construction of the Base object in create().

Implements GRINS::FactoryAbstract< CatalycityBase >.

Definition at line 69 of file catalycity_factory_abstract.h.

References GRINS::FactoryWithGetPot< CatalycityBase >::_input, _section, build_catalycity(), check_state(), and reset_state().

70  {
71  this->check_state();
72 
73  libMesh::UniquePtr<CatalycityBase> new_catalycity = this->build_catalycity( *_input, _section );
74 
75  this->reset_state();
76 
77  return new_catalycity;
78  }
virtual libMesh::UniquePtr< CatalycityBase > build_catalycity(const GetPot &input, const std::string &section)=0
virtual void check_state() const
Helper function to reduce code duplication.
virtual void reset_state()
Helper function to reduce code duplication.
static const GetPot * _input
We store only a raw pointer here because we can't make a copy.
void GRINS::CatalycityFactoryAbstract::reset_state ( )
inlineprotectedvirtual

Helper function to reduce code duplication.

Reimplemented in GRINS::CatalycityFactoryOldStyleBase.

Definition at line 91 of file catalycity_factory_abstract.h.

References _section.

Referenced by create(), and GRINS::CatalycityFactoryOldStyleBase::reset_state().

92  {
93  // Reset for error checking
94  _section = std::string("DIE!");
95  }
static void GRINS::CatalycityFactoryAbstract::set_section ( const std::string &  section)
inlinestatic

Member Data Documentation

std::string GRINS::CatalycityFactoryAbstract::_section = std::string("DIE!")
staticprotected

Definition at line 61 of file catalycity_factory_abstract.h.

Referenced by check_state(), create(), reset_state(), and set_section().


The documentation for this class was generated from the following files:

Generated on Tue Dec 19 2017 12:47:30 for GRINS-0.8.0 by  doxygen 1.8.9.1