SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
PropertyHolder.h
Go to the documentation of this file.
1
22
23#ifndef _SEFRAMEWORK_PROPERTY_PROPERTYHOLDER_H
24#define _SEFRAMEWORK_PROPERTY_PROPERTYHOLDER_H
25
26#include <memory>
27#include <unordered_map>
28
31
32namespace SourceXtractor {
33
34
42
44
45public:
46
48 virtual ~PropertyHolder() = default;
49
50 // removes copy/move constructors and assignment operators
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
70private:
71
73
74}; /* End of ObjectWithProperties class */
75
76} /* namespace SourceXtractor */
77
78
79#endif
PropertyHolder & operator=(PropertyHolder &&)=delete
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
Identifier used to set and retrieve properties.
Definition PropertyId.h:40
Base class for all Properties. (has no actual content).
Definition Property.h:33