BlackCat_Tensors
A GPU-supported autograd and linear algebra library, designed for neural network construction
Public Member Functions | List of all members
bc::utility::Any_Map Class Reference

Any_Map stores a buck of std::shared_ptr<void>. More...

#include <any_map.h>

Public Member Functions

template<class K , class V >
bool contains (Any_Key< K, V > key) const
 
template<class K , class V >
auto & operator[] (Any_Key< K, V > key)
 
template<class K , class V >
auto & at (Any_Key< K, V > key)
 
template<class K , class V , class... DefaultArgs>
auto & get (Any_Key< K, V > key, DefaultArgs &&... args)
 
template<class K , class V >
auto & get (Any_Key< K, V > key, V &&value)
 
template<class K , class V , class... Args>
auto emplace (Any_Key< K, V > key, Args &&... args)
 
int empty () const
 
int size () const
 
int max_size () const
 
auto begin () const
 
auto end () const
 
auto begin ()
 
auto end ()
 
auto cbegin ()
 
auto cend ()
 

Detailed Description

Any_Map stores a buck of std::shared_ptr<void>.

Elements are retrieved through:

myMap[Any_Key<K, V>()]

It is recommended to use "Name" with Any_Key to emulate constexpr-strings

myMap[Any_Key<Name<'K','E','Y'>, ValueType>]

Once CUDA supporst C++17 (which supports constexpr strings as template args) we will switch Any_Key to simply being a <String, ValueType>.

The operator[] is a template argument, which enables casting to the correct type without any dynamic checks. This results in efficient access to 'any' type within a pseudo-heterogeneous container.

Member Function Documentation

◆ at()

template<class K , class V >
auto& bc::utility::Any_Map::at ( Any_Key< K, V >  key)
inline

◆ begin() [1/2]

auto bc::utility::Any_Map::begin ( ) const
inline

◆ begin() [2/2]

auto bc::utility::Any_Map::begin ( )
inline

◆ cbegin()

auto bc::utility::Any_Map::cbegin ( )
inline

◆ cend()

auto bc::utility::Any_Map::cend ( )
inline

◆ contains()

template<class K , class V >
bool bc::utility::Any_Map::contains ( Any_Key< K, V >  key) const
inline

◆ emplace()

template<class K , class V , class... Args>
auto bc::utility::Any_Map::emplace ( Any_Key< K, V >  key,
Args &&...  args 
)
inline

◆ empty()

int bc::utility::Any_Map::empty ( ) const
inline

◆ end() [1/2]

auto bc::utility::Any_Map::end ( ) const
inline

◆ end() [2/2]

auto bc::utility::Any_Map::end ( )
inline

◆ get() [1/2]

template<class K , class V , class... DefaultArgs>
auto& bc::utility::Any_Map::get ( Any_Key< K, V >  key,
DefaultArgs &&...  args 
)
inline

◆ get() [2/2]

template<class K , class V >
auto& bc::utility::Any_Map::get ( Any_Key< K, V >  key,
V &&  value 
)
inline

◆ max_size()

int bc::utility::Any_Map::max_size ( ) const
inline

◆ operator[]()

template<class K , class V >
auto& bc::utility::Any_Map::operator[] ( Any_Key< K, V >  key)
inline

◆ size()

int bc::utility::Any_Map::size ( ) const
inline

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