SourceXtractorPlusPlus  0.16
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
A class providing a simple implementation of a container of properties.
bool isPropertySet(const PropertyId &property_id) const
Returns true if the property is set.
PropertyHolder(PropertyHolder &&)=delete
PropertyHolder & operator=(const PropertyHolder &)=delete
virtual ~PropertyHolder()=default
Destructor.
const Property & getProperty(const PropertyId &property_id) const
Returns a reference to a Property if it is set, if not throws a PropertyNotFoundException.
void setProperty(std::unique_ptr< Property > property, const PropertyId &property_id)
Sets a property, overwriting it if necessary.
std::unordered_map< PropertyId, std::unique_ptr< Property > > m_properties
PropertyHolder(const PropertyHolder &)=delete
PropertyHolder & operator=(PropertyHolder &&)=delete
Identifier used to set and retrieve properties.
Definition: PropertyId.h:40
Base class for all Properties. (has no actual content)
Definition: Property.h:33