fw4spl
fwAtoms::Map Class Reference

Map is a container for mapping representation. More...

#include <Map.hpp>

+ Inheritance diagram for fwAtoms::Map:
+ Collaboration diagram for fwAtoms::Map:

Public Types

typedef std::map< std::string, Base::sptr > MapType
 
typedef MapType::key_type KeyType
 
typedef MapType::mapped_type MappedType
 
typedef MapType::value_type ValueType
 
typedef MapType::iterator IteratorType
 
typedef MapType::const_iterator ConstIteratorType
 
typedef MapType::reverse_iterator ReverseIteratorType
 
typedef MapType::const_reverse_iterator ConstReverseIteratorType
 
typedef MapType::size_type SizeType
 
typedef MapType::key_type key_type
 
typedef MapType::mapped_type mapped_type
 
typedef MapType::value_type value_type
 
typedef MapType::iterator iterator
 
typedef MapType::const_iterator const_iterator
 
typedef MapType::reverse_iterator reverse_iterator
 
typedef MapType::const_reverse_iterator const_reverse_iterator
 
typedef MapType::size_type size_type
 
- Public Types inherited from fwAtoms::Base
enum  AtomType {
  BOOLEAN = 1, NUMERIC, STRING, OBJECT,
  SEQUENCE, MAP, BLOB
}
 
typedef ::fwAtoms::factory::Key Key
 

Public Member Functions

virtual bool isA (const std::string &type) const override
 
 Map (::fwAtoms::Base::Key key)
 Constructor. More...
 
virtual ~Map ()
 Destructor.
 
std::pair< IteratorType, bool > insert (const std::string &key, const Base::sptr &value)
 Insert a new value in the map. More...
 
size_t size () const
 retrieve size of map More...
 
IteratorType begin ()
 Provide an iterator on the first element. More...
 
ConstIteratorType begin () const
 Provide a const iterator on the first element. More...
 
IteratorType end ()
 Return an iterator after the last element in the map.
 
ConstIteratorType end () const
 Return a const iterator after the last element in the map.
 
void clear ()
 clear the map
 
bool empty () const
 test if the map is empty More...
 
const MapType & getValue () const
 returns atom's map
 
MapType::const_iterator find (const std::string &key) const
 find an element in the map More...
 
Base::sptr operator[] (const std::string &key)
 Access to a member with []. More...
 
virtual FWATOMS_API Base::sptr clone () const override
 Returns a clone object.
 
::fwAtoms::Base::AtomType type () const override
 returns Atom type
 
- Public Member Functions inherited from fwAtoms::Base
bool isValue () const
 Test if the current base is a value or not (Value = {string;numeric;boolean}) More...
 
bool isBoolean () const
 Test if the current base is a boolean. More...
 
bool isNumeric () const
 Test if the current base is a Numeric (real or integer) More...
 
bool isString () const
 Test if the current base is a string. More...
 
bool isSequence () const
 Test if the current base is a sequence. More...
 
bool isMapping () const
 Test if the current base is a mapping. More...
 
bool isBlob () const
 Test if the current base is a blob (a object with a buffer) More...
 
bool isObject () const
 Test if the current base is an object (representation of fwData) More...
 
virtual FWATOMS_API std::string getString () const
 Return the string representation of a value. More...
 
- Public Member Functions inherited from fwCore::BaseObject

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
- Static Public Member Functions inherited from fwAtoms::Base
static bool isTypeOf (const std::string &type)
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
- Static Public Member Functions inherited from fwCore::BaseObject
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Protected Attributes

MapType m_value
 

Friends

template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Demangling methods

virtual const std::string & getLeafClassname () const override
 return object's classname without its namespace, i.e. BaseObject
 
virtual const std::string & getClassname () const override
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Additional Inherited Members

- Static Public Attributes inherited from fwAtoms::Base
static FWATOMS_API const std::string s_VERSION = "1"
 Defines fwAtoms version.
 
- Protected Member Functions inherited from fwAtoms::Base
 Base ()
 Constructor.
 

Detailed Description

Map is a container for mapping representation.

For exemple, this metadata is used to bind :

  • std::map
  • ::boost::unordered_map
  • fwData::Graph (a part)
  • boost graph

Definition at line 31 of file Map.hpp.

Member Typedef Documentation

typedef MapType::const_iterator fwAtoms::Map::const_iterator

boost_foreach/stl compatibility

Definition at line 53 of file Map.hpp.

typedef MapType::const_reverse_iterator fwAtoms::Map::const_reverse_iterator

boost_foreach/stl compatibility

Definition at line 55 of file Map.hpp.

typedef MapType::iterator fwAtoms::Map::iterator

boost_foreach/stl compatibility

Definition at line 52 of file Map.hpp.

typedef MapType::key_type fwAtoms::Map::key_type

boost_foreach/stl compatibility

Definition at line 49 of file Map.hpp.

typedef MapType::mapped_type fwAtoms::Map::mapped_type

boost_foreach/stl compatibility

Definition at line 50 of file Map.hpp.

typedef MapType::reverse_iterator fwAtoms::Map::reverse_iterator

boost_foreach/stl compatibility

Definition at line 54 of file Map.hpp.

typedef MapType::size_type fwAtoms::Map::size_type

boost_foreach/stl compatibility

Definition at line 56 of file Map.hpp.

typedef MapType::value_type fwAtoms::Map::value_type

boost_foreach/stl compatibility

Definition at line 51 of file Map.hpp.

Constructor & Destructor Documentation

fwAtoms::Map::Map ( ::fwAtoms::Base::Key  key)
inline

Constructor.

Parameters
keyPrivate construction key

Definition at line 63 of file Map.hpp.

Member Function Documentation

IteratorType fwAtoms::Map::begin ( )
inline

Provide an iterator on the first element.

Returns
An iterator on the first element, end() if map is empty.

Definition at line 97 of file Map.hpp.

ConstIteratorType fwAtoms::Map::begin ( ) const
inline

Provide a const iterator on the first element.

Returns
An iterator on the first element, end() if map is empty.

Definition at line 106 of file Map.hpp.

bool fwAtoms::Map::empty ( ) const
inline

test if the map is empty

Returns
true if empty

Definition at line 137 of file Map.hpp.

MapType::const_iterator fwAtoms::Map::find ( const std::string &  key) const
inline

find an element in the map

Parameters
keythe key
Returns
an iterator on value pointed by key if exist, else return Map.end()

Definition at line 156 of file Map.hpp.

std::pair<IteratorType, bool> fwAtoms::Map::insert ( const std::string &  key,
const Base::sptr &  value 
)
inline

Insert a new value in the map.

Parameters
keythe key, if exist the oldest value is erased.
valuethe new value

Definition at line 79 of file Map.hpp.

Base::sptr fwAtoms::Map::operator[] ( const std::string &  key)
inline

Access to a member with [].

Parameters
keya key in the map
Returns
the value associated with the key or an empty base if the key is not in the map.

Definition at line 167 of file Map.hpp.

size_t fwAtoms::Map::size ( ) const
inline

retrieve size of map

Returns
the map size

Definition at line 88 of file Map.hpp.


The documentation for this class was generated from the following files: