gsystem
Loading...
Searching...
No Matches
GSystemFactory Class Referenceabstract

Abstract base class for loading a GSystem from a specific source. More...

#include <systemFactory.h>

Public Member Functions

 ~GSystemFactory () override=default
 
 GSystemFactory (const std::shared_ptr< GOptions > &g)
 Construct the factory with shared configuration.
 
void loadSystem (GSystem *system)
 Load a system by invoking the concrete factory steps.
 
virtual void closeSystem ()
 Factory cleanup hook.
 
void addPossibleFileLocation (const std::string &fl)
 Add a candidate directory for file searches.
 
- Public Member Functions inherited from GBase< GSystemFactory >
 GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
 
 GBase (const std::shared_ptr< GLogger > &logger)
 
 GBase (const GBase &)=default
 
 GBase (GBase &&) noexcept=default
 
virtual ~GBase ()
 
GBaseoperator= (const GBase &)=default
 
GBaseoperator= (GBase &&) noexcept=default
 

Protected Attributes

std::vector< std::string > possibleLocationOfFiles
 List of candidate directories used by file-based factories.
 
- Protected Attributes inherited from GBase< GSystemFactory >
std::shared_ptr< GLoggerlog
 

Detailed Description

Concrete factories implement two core steps:

  • material loading (so volumes can reference material names);
  • geometry loading (volumes and placement metadata).

The public orchestration method loadSystem():

  • logs the start of loading;
  • seeds possibleLocationOfFiles with default search locations;
  • invokes the concrete material-loading step;
  • invokes the concrete geometry-loading step.

Search-path behavior:

  • "." is always added first.
  • GEMC installation root (from gutilities) is added.
  • system->get_dbhost() is also added, which can act as either a DB name or a directory hint depending on the concrete factory.

Definition at line 34 of file systemFactory.h.

Constructor & Destructor Documentation

◆ ~GSystemFactory()

GSystemFactory::~GSystemFactory ( )
overridedefault

◆ GSystemFactory()

GSystemFactory::GSystemFactory ( const std::shared_ptr< GOptions > & g)
inlineexplicit
Parameters
gShared options/configuration instance.

Definition at line 44 of file systemFactory.h.

Member Function Documentation

◆ addPossibleFileLocation()

void GSystemFactory::addPossibleFileLocation ( const std::string & fl)
inline
Parameters
flDirectory path to append.

Factories may accumulate locations from multiple sources (YAML directories, install roots, user-specified paths). Locations are searched in insertion order.

Definition at line 129 of file systemFactory.h.

◆ closeSystem()

virtual void GSystemFactory::closeSystem ( )
inlinevirtual

Concrete factories override this when they own external resources (e.g. open sqlite handles, file streams, cached state).

The base implementation clears possibleLocationOfFiles.

Definition at line 89 of file systemFactory.h.

◆ loadSystem()

void GSystemFactory::loadSystem ( GSystem * system)
inline
Parameters
systemTarget system instance to populate.

Sequence:

  • initialize default search locations;
  • load materials first (so geometry can reference material names);
  • load geometry (volumes) second.

The base class does not enforce additional invariants beyond calling order. Concrete factories are responsible for:

  • validating input files / database connectivity;
  • logging and erroring out on unrecoverable conditions;
  • leaving the system in a consistent state on success.

Definition at line 63 of file systemFactory.h.

Field Documentation

◆ possibleLocationOfFiles

std::vector<std::string> GSystemFactory::possibleLocationOfFiles
protected

Definition at line 118 of file systemFactory.h.


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