pflib v3.0.0-rc1-25-gb91774e
Pretty Fine HGCROC Interaction Library
All Classes Namespaces Files Functions Variables Typedefs Pages
NoCopyMap< Key, Val > Class Template Reference

A non-copyable mapping. More...

#include <register_maps_types.h>

Inheritance diagram for NoCopyMap< Key, Val >:
[legend]
Collaboration diagram for NoCopyMap< Key, Val >:
[legend]

Public Types

using Mapping = std::map<Key,Val>
 

Public Member Functions

 NoCopyMap (const NoCopyMap &)=delete
 
NoCopyMapoperator= (const NoCopyMap &)=delete
 
 NoCopyMap (const Mapping &contents)
 Constructor necessary to support a simpler definition syntax.
 
- Public Member Functions inherited from std::map< Key, Val >
Val begin (Val... args)
 
Val erase (Val... args)
 
Val insert (Val... args)
 
Val swap (Val... args)
 
Val end (Val... args)
 
Val emplace_hint (Val... args)
 
Val key_comp (Val... args)
 
Val cbegin (Val... args)
 
Val count (Val... args)
 
Val find (Val... args)
 
Val map (Val... args)
 
Val crbegin (Val... args)
 
Val at (Val... args)
 
Val upper_bound (Val... args)
 
Val rbegin (Val... args)
 
Val crend (Val... args)
 
Val size (Val... args)
 
Val operator= (Val... args)
 
Val ~map (Val... args)
 
Val value_comp (Val... args)
 
Val empty (Val... args)
 
Val lower_bound (Val... args)
 
Val cend (Val... args)
 
Val max_size (Val... args)
 
Val rend (Val... args)
 
Val get_allocator (Val... args)
 
Val clear (Val... args)
 
Val equal_range (Val... args)
 
Val emplace (Val... args)
 
Val operator[] (Val... args)
 

Additional Inherited Members

- Public Attributes inherited from std::map< Key, Val >
Key keys
 STL member.
 
Val elements
 STL member.
 

Detailed Description

template<typename Key, typename Val>
class NoCopyMap< Key, Val >

A non-copyable mapping.

This is helpful for our Look Up Tables (LUTs) since we want to define them once and then just pass them around without copying their large size.

Always retrieve constant references of these types, for example

const auto& my_handle = get_lut();

Constructor & Destructor Documentation

◆ NoCopyMap()

template<typename Key , typename Val >
NoCopyMap< Key, Val >::NoCopyMap ( const Mapping & contents)
inline

Constructor necessary to support a simpler definition syntax.

using MyLUT = NoCopyMap<Key,Val>;
const MyLUT EXAMPLE = NoCopyMap::Mapping({
{key, val},
// etc...
});
A non-copyable mapping.
Definition register_maps_types.h:91

I tried playing around with std::initializer_list but I couldn't get it to work and since the headers where these LUTs are defined are written by a script anyways, I decided to leave the boilerplate in.


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