GEOS
Classes | Namespaces | Macros | Typedefs
StdContainerWrappers.hpp File Reference
#include <vector>
#include <map>
#include <unordered_map>
#include <memory>
#include <iostream>

Go to the source code of this file.

Classes

class  geos::mapType< TKEY, TVAL, SORTED >
 Base template for ordered and unordered maps. More...
 
class  geos::mapBase< TKEY, TVAL, SORTED >
 Base template for ordered and unordered maps. More...
 

Namespaces

 geos
 

Macros

#define USE_STD_CONTAINER_BOUNDS_CHECKING   false
 Compile-time flag that enables or disables runtime bounds checking in GEOS container wrappers.
 

Typedefs

template<typename T , typename Allocator = std::allocator< T >>
using geos::stdVector = internal::StdVectorWrapper< T, Allocator, USE_STD_CONTAINER_BOUNDS_CHECKING >
 
template<typename Key , typename T , typename Compare = std::less< Key >, typename Allocator = std::allocator< std::pair< const Key, T > >>
using geos::stdMap = internal::StdMapWrapper< std::map< Key, T, Compare, Allocator >, USE_STD_CONTAINER_BOUNDS_CHECKING >
 
template<typename Key , typename T , typename Hash = std::hash< Key >, typename KeyEqual = std::equal_to< Key >, typename Allocator = std::allocator< std::pair< const Key, T > >>
using geos::stdUnorderedMap = internal::StdMapWrapper< std::unordered_map< Key, T, Hash, KeyEqual, Allocator >, USE_STD_CONTAINER_BOUNDS_CHECKING >
 

Detailed Description

Warning
: It is prohibited to use std::map or std::unordered_map in the geos repos.

Usage

There are two ways to declare a map or unordered_map:

  1. stdMap / stdUnorderedMap:
    • These types replace std::map with an overridden operator[] for bounds checking.
    • We cannot use the operator[] for the insertion.
  2. geos::map / geos::unordered_map:
    • Use these types to ensure the compatibility with the geos packing, as stdMap is not yet compatible.

Definition in file StdContainerWrappers.hpp.