25 if ((
m_cans.size() == 1) && (
id.empty())) {
26 return m_cans.begin()->second;
29 auto indexIter =
m_cans.find(
id);
30 if (indexIter !=
m_cans.end())
31 return indexIter->second;
33 throw std::invalid_argument(
"SampleEnvironmentSpec::find() - Unable to "
34 "find Container matching ID '" +
57 if (can->id().empty()) {
58 throw std::invalid_argument(
"SampleEnvironmentSpec::addContainer() - Container must "
59 "have an id field. Empty string found.");
61 m_cans.emplace(can->id(), can);
SampleEnvironmentSpec(std::string name)
Constructor.
void addContainer(const Geometry::Container_const_sptr &can)
Adds a can definition to the known list.
ComponentList m_components
Geometry::SampleEnvironment_uptr buildEnvironment(const std::string &canID) const
Build a new SampleEnvironment instance from a given can ID.
void addComponent(const Geometry::IObject_const_sptr &component)
Add a non-can component to the specification.
Geometry::Container_const_sptr findContainer(const std::string &id) const
Find a can by id string.
std::shared_ptr< const Container > Container_const_sptr
Typdef for a shared pointer to a const object.
std::unique_ptr< SampleEnvironment > SampleEnvironment_uptr
std::shared_ptr< const IObject > IObject_const_sptr
Typdef for a shared pointer to a const object.