SourceXtractorPlusPlus  0.13
Please provide a description of the project.
PropertyHolder.cpp
Go to the documentation of this file.
1 
24 
26 
27 namespace SourceXtractor {
28 
29 const Property& PropertyHolder::getProperty(const PropertyId& property_id) const {
30  auto iter = m_properties.find(property_id);
31  if (iter != m_properties.end()) {
32  // Returns the property if it is found
33  return *iter->second;
34  } else {
35  // If we don't have that property throws an exception
36  throw PropertyNotFoundException(property_id);
37  }
38 }
39 
41  m_properties[property_id] = std::move(property);
42 }
43 
44 bool PropertyHolder::isPropertySet(const PropertyId& property_id) const {
45  return m_properties.find(property_id) != m_properties.end();
46 }
47 
49  m_properties.clear();
50 }
51 
52 } // SEFramework namespace
std::move
T move(T... args)
SourceXtractor::Property
Base class for all Properties. (has no actual content)
Definition: Property.h:33
SourceXtractor::PropertyHolder::setProperty
void setProperty(std::unique_ptr< Property > property, const PropertyId &property_id)
Sets a property, overwriting it if necessary.
Definition: PropertyHolder.cpp:40
SourceXtractor::PropertyHolder::isPropertySet
bool isPropertySet(const PropertyId &property_id) const
Returns true if the property is set.
Definition: PropertyHolder.cpp:44
SourceXtractor::PropertyNotFoundException
An exception indicating that a Property was not available and could not be computed on demand.
Definition: PropertyNotFoundException.h:36
SourceXtractor::PropertyId
Identifier used to set and retrieve properties.
Definition: PropertyId.h:40
SourceXtractor::PropertyHolder::m_properties
std::unordered_map< PropertyId, std::unique_ptr< Property > > m_properties
Definition: PropertyHolder.h:72
SourceXtractor::PropertyHolder::getProperty
const Property & getProperty(const PropertyId &property_id) const
Returns a reference to a Property if it is set, if not throws a PropertyNotFoundException.
Definition: PropertyHolder.cpp:29
SourceXtractor
Definition: Aperture.h:30
PropertyHolder.h
SourceXtractor::PropertyHolder::clear
void clear()
Definition: PropertyHolder.cpp:48
std::unique_ptr
STL class.
PropertyNotFoundException.h