Mantid
|
Create a single instance of a SampleEnvironment. More...
#include <SampleEnvironmentFactory.h>
Public Member Functions | |
size_t | cacheSize () const |
void | clearCache () |
Clear the cache of SampleEnvironmentSpec objects. More... | |
Geometry::SampleEnvironment_uptr | create (const std::string &facility, const std::string &instrument, const std::string &specName, const std::string &canName) |
Create a new SampleEnvironment instance from the given specification and can. More... | |
SampleEnvironmentSpec_uptr | parseSpec (const std::string &filename, const std::string &filepath) const |
Calls SampleEnvironmentSpecFileFinder::parseSpec. More... | |
SampleEnvironmentFactory ()=default | |
SampleEnvironmentFactory (ISampleEnvironmentSpecFinder_uptr specFinder) | |
Constructor accepting a pointer to a finder object. More... | |
Private Attributes | |
ISampleEnvironmentSpecFinder_uptr | m_finder |
Create a single instance of a SampleEnvironment.
It requires the name of a sample environment specification and a can name.
The specifications are cached in a static lookup. The class is implemented using the monostate pattern
Definition at line 36 of file SampleEnvironmentFactory.h.
|
default |
References Mantid::DataObjects::create().
Mantid::DataHandling::SampleEnvironmentFactory::SampleEnvironmentFactory | ( | ISampleEnvironmentSpecFinder_uptr | specFinder | ) |
Constructor accepting a pointer to a finder object.
specFinder | A reference to an object used to retrieve find a given specification. |
Definition at line 60 of file SampleEnvironmentFactory.cpp.
size_t Mantid::DataHandling::SampleEnvironmentFactory::cacheSize | ( | ) | const |
Definition at line 95 of file SampleEnvironmentFactory.cpp.
void Mantid::DataHandling::SampleEnvironmentFactory::clearCache | ( | ) |
Clear the cache of SampleEnvironmentSpec objects.
Definition at line 100 of file SampleEnvironmentFactory.cpp.
Geometry::SampleEnvironment_uptr Mantid::DataHandling::SampleEnvironmentFactory::create | ( | const std::string & | facility, |
const std::string & | instrument, | ||
const std::string & | specName, | ||
const std::string & | canName | ||
) |
Create a new SampleEnvironment instance from the given specification and can.
facility | Name of facility |
instrument | Full name of the instrument |
specName | The name of a specification |
canName | The name of a can within the spec |
Definition at line 72 of file SampleEnvironmentFactory.cpp.
References Mantid::DataHandling::SampleEnvironmentSpec::buildEnvironment(), and m_finder.
Referenced by Mantid::DataHandling::SetSample::setSampleEnvironmentFromFile().
SampleEnvironmentSpec_uptr Mantid::DataHandling::SampleEnvironmentFactory::parseSpec | ( | const std::string & | filename, |
const std::string & | filepath | ||
) | const |
Calls SampleEnvironmentSpecFileFinder::parseSpec.
filename | The name of the specification |
filepath | Assumed to be an absolute path to an existing specification |
Definition at line 108 of file SampleEnvironmentFactory.cpp.
References m_finder.
Referenced by Mantid::DataHandling::SetSample::setSampleEnvironmentFromFile().
|
private |
Definition at line 49 of file SampleEnvironmentFactory.h.
Referenced by create(), and parseSpec().