SourceXtractorPlusPlus
0.12
Please provide a description of the project.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
SEFramework
SEFramework
Property
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
29
#include "
SEFramework/Property/PropertyId.h
"
30
#include "
SEFramework/Property/Property.h
"
31
32
namespace
SourceXtractor {
33
34
43
class
PropertyHolder
{
44
45
public
:
46
48
virtual
~PropertyHolder
() =
default
;
49
50
// removes copy/move constructors and assignment operators
51
PropertyHolder
(
const
PropertyHolder
&) =
delete
;
52
PropertyHolder
&
operator=
(
const
PropertyHolder
&) =
delete
;
53
PropertyHolder
(
PropertyHolder
&&) =
delete
;
54
PropertyHolder
&
operator=
(
PropertyHolder
&&) =
delete
;
55
57
PropertyHolder
() {}
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
72
std::unordered_map<PropertyId, std::unique_ptr<Property>
>
m_properties
;
73
74
};
/* End of ObjectWithProperties class */
75
76
}
/* namespace SourceXtractor */
77
78
79
#endif
SourceXtractor::PropertyHolder::operator=
PropertyHolder & operator=(const PropertyHolder &)=delete
SourceXtractor::PropertyHolder::m_properties
std::unordered_map< PropertyId, std::unique_ptr< Property > > m_properties
Definition:
PropertyHolder.h:72
Property.h
SourceXtractor::Property
Base class for all Properties. (has no actual content)
Definition:
Property.h:33
SourceXtractor::PropertyHolder::clear
void clear()
Definition:
PropertyHolder.cpp:48
SourceXtractor::PropertyHolder::PropertyHolder
PropertyHolder()
Constructors.
Definition:
PropertyHolder.h:57
PropertyId.h
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::PropertyHolder::isPropertySet
bool isPropertySet(const PropertyId &property_id) const
Returns true if the property is set.
Definition:
PropertyHolder.cpp:44
std::unique_ptr
STL class.
SourceXtractor::PropertyId
Identifier used to set and retrieve properties.
Definition:
PropertyId.h:40
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::~PropertyHolder
virtual ~PropertyHolder()=default
Destructor.
std::unordered_map
STL class.
Generated by
1.8.5