Horizon Official Technical Documentation
map_cache Struct Reference

#include <MapCache.hpp>

+ Collaboration diagram for map_cache:

Public Member Functions

mapcache_headergetHeader ()
 
void setHeader (mapcache_header &header)
 
void addMap (map_data &data)
 
void removeMap (std::string &name)
 
boost::optional< map_datagetMap (std::string name)
 
std::size_t getMapCount ()
 

Public Attributes

std::map< std::string, map_datamaps
 

Private Attributes

mapcache_header _header {}
 

Member Function Documentation

◆ addMap()

void map_cache::addMap ( map_data data)
inline
88{ maps.insert(std::make_pair(data.info.name, data)); }
std::map< std::string, map_data > maps
Definition: MapCache.hpp:109
map_info info
Definition: MapCache.hpp:79
char name[12]
Definition: MapCache.hpp:64

References map_data::info, maps, and map_info::name.

◆ getHeader()

mapcache_header & map_cache::getHeader ( )
inline
85{ return _header; }
mapcache_header _header
Definition: MapCache.hpp:112

References _header.

◆ getMap()

boost::optional< map_data > map_cache::getMap ( std::string  name)
inline
98 {
99 auto it = maps.find(name);
100
101 if (it != maps.end())
102 return boost::optional<map_data>(it->second);
103
104 return boost::optional<map_data>();
105 }

References maps.

◆ getMapCount()

std::size_t map_cache::getMapCount ( )
inline
107{ return maps.size(); }

References maps.

◆ removeMap()

void map_cache::removeMap ( std::string &  name)
inline
90 {
91 auto it = maps.find(name);
92
93 if (it != maps.end())
94 maps.erase(it);
95 }

References maps.

◆ setHeader()

void map_cache::setHeader ( mapcache_header header)
inline
86{ _header = header; }

References _header.

Member Data Documentation

◆ _header

mapcache_header map_cache::_header {}
private

Referenced by getHeader(), and setHeader().

◆ maps

std::map<std::string, map_data> map_cache::maps

Referenced by addMap(), getMap(), getMapCount(), and removeMap().


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