SourceXtractorPlusPlus  0.11
Please provide a description of the project.
PropertyHolder.h
Go to the documentation of this file.
1 
23 #ifndef _SEFRAMEWORK_PROPERTY_PROPERTYHOLDER_H
24 #define _SEFRAMEWORK_PROPERTY_PROPERTYHOLDER_H
25 
26 #include <memory>
27 #include <unordered_map>
28 
31 
32 namespace SourceXtractor {
33 
34 
44 
45 public:
46 
48  virtual ~PropertyHolder() = default;
49 
50  // removes copy/move constructors and assignment operators
51  PropertyHolder(const PropertyHolder&) = delete;
55 
58 
60  const Property& getProperty(const PropertyId& property_id) const;
61 
63  void setProperty(std::unique_ptr<Property> property, const PropertyId& property_id);
64 
66  bool isPropertySet(const PropertyId& property_id) const;
67 
68  void clear();
69 
70 private:
71 
73 
74 }; /* End of ObjectWithProperties class */
75 
76 } /* namespace SourceXtractor */
77 
78 
79 #endif
PropertyId.h
SourceXtractor::PropertyHolder::~PropertyHolder
virtual ~PropertyHolder()=default
Destructor.
SourceXtractor::PropertyHolder::PropertyHolder
PropertyHolder()
Constructors.
Definition: PropertyHolder.h:57
SourceXtractor::Property
Base class for all Properties. (has no actual content)
Definition: Property.h:33
SourceXtractor::PropertyHolder
A class providing a simple implementation of a container of properties.
Definition: PropertyHolder.h:43
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::PropertyHolder::PropertyHolder
PropertyHolder(PropertyHolder &&)=delete
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
Property.h
SourceXtractor::PropertyHolder::operator=
PropertyHolder & operator=(const PropertyHolder &)=delete
SourceXtractor::PropertyHolder::operator=
PropertyHolder & operator=(PropertyHolder &&)=delete
SourceXtractor::PropertyHolder::clear
void clear()
Definition: PropertyHolder.cpp:48
SourceXtractor::PropertyHolder::PropertyHolder
PropertyHolder(const PropertyHolder &)=delete
std::unique_ptr
STL class.
std::unordered_map
STL class.