20void PropertyList::delAllProperties()
24void PropertyList::delProperty(std::string
const& key)
26 this->g_data.erase(key);
30bool PropertyList::findProperty(std::string
const& key)
const
32 auto it = this->g_data.find(key);
33 if (it != this->g_data.cend())
35 return it->second.isType<T>();
39bool PropertyList::findProperty(std::string
const& key)
const
41 return this->g_data.find(key) != this->g_data.cend();
45void PropertyList::setProperty(std::string
const& key, T&& value)
47 this->g_data[key] = std::forward<T>(value);
51T* PropertyList::getProperty(std::string
const& key)
53 return this->g_data[key].getPtr<T>();
56T
const* PropertyList::getProperty(std::string
const& key)
const
58 auto it = this->g_data.find(key);
59 if (it != this->g_data.cend())
61 return it->second.getPtr<T>();
65template<
class T,
class TDefault>
66T& PropertyList::getProperty(std::string
const& key, TDefault&& defaultValue)
68 auto& data = this->g_data[key];
69 if (!data.isType<T>())
71 return data.setType<T>() = std::forward<TDefault>(defaultValue);
76fge::Property& PropertyList::getProperty(std::string
const& key)
78 return this->g_data[key];
80fge::Property const* PropertyList::getProperty(std::string
const& key)
const
82 auto it = this->g_data.find(key);
83 if (it != this->g_data.cend())
90fge::Property& PropertyList::operator[](std::string
const& key)
92 return this->g_data[key];
94fge::Property const* PropertyList::operator[](std::string
const& key)
const
96 auto it = this->g_data.find(key);
97 if (it != this->g_data.cend())
104std::size_t PropertyList::count()
const
106 return this->g_data.size();
109fge::PropertyList::DataType::iterator PropertyList::begin()
111 return this->g_data.begin();
113fge::PropertyList::DataType::iterator PropertyList::end()
115 return this->g_data.end();
117fge::PropertyList::DataType::const_iterator PropertyList::begin()
const
119 return this->g_data.begin();
121fge::PropertyList::DataType::const_iterator PropertyList::end()
const
123 return this->g_data.end();
126void PropertyList::clearAllModificationFlags()
128 for (
auto& data: this->g_data)
130 data.second.setModifiedFlag(
false);
133std::size_t PropertyList::countAllModificationFlags()
const
135 std::size_t counter{0};
137 for (
auto const& data: this->g_data)
139 if (data.second.isModified())
A class that can store any type of data.
Definition C_property.hpp:54