Mapper  0.9.0
API documentation
Public Member Functions | List of all members
OpenOrienteering::MapColorMap Class Reference

MapColorMap provides a mapping from one map color to another. More...

#include <map_color.h>

Public Member Functions

 MapColorMap ()
 Constructs a new MapColorMap. More...
 
int size () const
 Returns the size, i.e. More...
 
void clear ()
 Clears the user-defined key-value pairs. More...
 
bool contains (const MapColor *key) const
 Returns true if there is a user-defined value for the key color. More...
 
const MapColorvalue (const MapColor *key) const
 Returns the mapped value for the key color. More...
 
const MapColoroperator[] (const MapColor *key) const
 Returns the mapped value for the key color. More...
 
const MapColor *& operator[] (const MapColor *key)
 Returns a reference to pointer to the mapped value for the key color. More...
 

Detailed Description

MapColorMap provides a mapping from one map color to another.

In addition to explicitly user-defined key-value pairs of colors, it will (in const contexts) map colors with reserved priorities to themselves, assuming that there is only a single static instance of these colors.

Constructor & Destructor Documentation

◆ MapColorMap()

OpenOrienteering::MapColorMap::MapColorMap ( )
inline

Constructs a new MapColorMap.

Member Function Documentation

◆ clear()

void OpenOrienteering::MapColorMap::clear ( )
inline

Clears the user-defined key-value pairs.

◆ contains()

bool OpenOrienteering::MapColorMap::contains ( const MapColor key) const
inline

Returns true if there is a user-defined value for the key color.

◆ operator[]() [1/2]

const MapColor * OpenOrienteering::MapColorMap::operator[] ( const MapColor key) const
inline

Returns the mapped value for the key color.

Same as value().

Returns the user-defined value for the key color if it is defined. Otherwise, if the key color's priority is from the RESERVED domain, returns key. Otherwise returns nullptr.

◆ operator[]() [2/2]

const MapColor *& OpenOrienteering::MapColorMap::operator[] ( const MapColor key)
inline

Returns a reference to pointer to the mapped value for the key color.

If a user-defined mapped value does not exist yet, a default- constructed mapped value is created first.

◆ size()

int OpenOrienteering::MapColorMap::size ( ) const
inline

Returns the size, i.e.

the number of user-defined key-value pairs.

◆ value()

const MapColor * OpenOrienteering::MapColorMap::value ( const MapColor key) const
inline

Returns the mapped value for the key color.

Returns the user-defined value for the key color if it is defined. Otherwise, if the key color's priority is from the RESERVED domain, returns key. Otherwise returns nullptr.


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