7 #ifndef __FWATOMS_MAP_HPP__ 8 #define __FWATOMS_MAP_HPP__ 10 #include "fwAtoms/Base.hpp" 11 #include "fwAtoms/config.hpp" 12 #include "fwAtoms/factory/new.hpp" 13 #include "fwAtoms/Object.hpp" 36 typedef std::map<std::string, Base::sptr> MapType;
38 typedef MapType::key_type KeyType;
39 typedef MapType::mapped_type MappedType;
40 typedef MapType::value_type ValueType;
41 typedef MapType::iterator IteratorType;
42 typedef MapType::const_iterator ConstIteratorType;
43 typedef MapType::reverse_iterator ReverseIteratorType;
44 typedef MapType::const_reverse_iterator ConstReverseIteratorType;
45 typedef MapType::size_type SizeType;
79 std::pair<IteratorType, bool>
insert(
const std::string& key,
const Base::sptr& value)
81 return m_value.insert( ValueType(key, value) );
90 return m_value.size();
99 return m_value.begin();
108 return m_value.begin();
116 return m_value.end();
122 ConstIteratorType
end()
const 124 return m_value.end();
139 return m_value.empty();
156 MapType::const_iterator
find(
const std::string& key)
const 158 return m_value.find(key);
175 FWATOMS_API
virtual Base::sptr clone()
const override;
180 ::fwAtoms::Base::AtomType
type()
const override 182 return ::fwAtoms::Base::MAP;
MapType::const_iterator const_iterator
fwAtoms contains basic objects to represent any other kind of object
MapType::iterator iterator
Base::sptr operator[](const std::string &key)
Access to a member with [].
MapType::const_iterator find(const std::string &key) const
find an element in the map
Map(::fwAtoms::Base::Key key)
Constructor.
MapType::reverse_iterator reverse_iterator
const MapType & getValue() const
returns atom's map
void clear()
clear the map
ConstIteratorType end() const
Return a const iterator after the last element in the map.
Map is a container for mapping representation.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
std::pair< IteratorType, bool > insert(const std::string &key, const Base::sptr &value)
Insert a new value in the map.
MapType::mapped_type mapped_type
MapType::const_reverse_iterator const_reverse_iterator
IteratorType begin()
Provide an iterator on the first element.
::fwAtoms::Base::AtomType type() const override
returns Atom type
size_t size() const
retrieve size of map
MapType::key_type key_type
bool empty() const
test if the map is empty
ConstIteratorType begin() const
Provide a const iterator on the first element.
MapType::value_type value_type
MapType::size_type size_type
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
Base class for all Atom classes.
IteratorType end()
Return an iterator after the last element in the map.
virtual ~Map()
Destructor.