GRINS-0.7.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 ()
 

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)
 

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...
 

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 ()
 

Detailed Description

Definition at line 34 of file catalycity_factory_abstract.h.

Constructor & Destructor Documentation

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

Definition at line 37 of file catalycity_factory_abstract.h.

38  : FactoryWithGetPot<CatalycityBase>(physics_name)
39  {}
GRINS::CatalycityFactoryAbstract::~CatalycityFactoryAbstract ( )
inline

Definition at line 41 of file catalycity_factory_abstract.h.

41 {};

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 77 of file catalycity_factory_abstract.h.

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

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

78  {
79  if( !_input )
80  libmesh_error_msg("ERROR: must call set_getpot() before building Catalycity!");
81 
82  if( _section == std::string("DIE!") )
83  libmesh_error_msg("ERROR: must call set_section() before building Catalycity!");
84  }
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

Definition at line 65 of file catalycity_factory_abstract.h.

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

66  {
67  this->check_state();
68 
69  libMesh::UniquePtr<CatalycityBase> new_catalycity = this->build_catalycity( *_input, _section );
70 
71  this->reset_state();
72 
73  return new_catalycity;
74  }
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 87 of file catalycity_factory_abstract.h.

References _section.

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

88  {
89  // Reset for error checking
90  _section = std::string("DIE!");
91  }
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 57 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 Thu Jun 2 2016 21:52:30 for GRINS-0.7.0 by  doxygen 1.8.10