NEST main@caf0ae8
 
Loading...
Searching...
No Matches
dictionary.h File Reference
#include <concepts>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <variant>
#include <vector>
#include "config.h"
#include "exceptions.h"
#include "logging.h"
Include dependency graph for dictionary.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  DictionarySchemaBuilder< Scalars >
 Add a set of standard datatypes to any_type variant. More...
 
class  AnyVector
 Vector of any_type. More...
 
struct  EmptyList
 Datatype to allow empty Python lists to be represented without defaulting to a datatype. More...
 
class  Dictionary
 Dictionary class for interface to Python and C++ API. More...
 
struct  DictEntry_
 Represent value in dictionary entry with access information. More...
 
class  dictionary_
 A Python-like dictionary_, based on std::map. More...
 

Namespaces

namespace  nest
 Namespace for the NEST simulation kernel.
 

Concepts

concept  Integer
 A concept for "integer integers", excluding bool and char.
 
concept  DictionaryEntryType
 A concept for data types that can be stored in a Dictionary as any_type .
 

Typedefs

using DictionarySchema = DictionarySchemaBuilder< double, long, bool, std::string, Dictionary >
 Basic scalar data types, strings and dictionaries to be included in variant.
 
using any_type = DictionarySchema::VariantType< std::shared_ptr< nest::NodeCollection >, std::vector< std::vector< double > >, std::vector< std::vector< std::vector< double > > >, std::vector< std::vector< std::vector< long > > >, std::shared_ptr< nest::Parameter >, AnyVector, nest::VerbosityLevel, EmptyList >
 Complete any_type by adding specific data types.
 

Functions

std::ostream & operator<< (std::ostream &os, const EmptyList &)
 Print EmptyList.
 
std::ostream & operator<< (std::ostream &os, const std::monostate &)
 Print std::monostate as "None".
 
std::ostream & operator<< (std::ostream &os, const AnyVector &av)
 Print AnyVector.
 
std::ostream & operator<< (std::ostream &os, const Dictionary &dict)
 Print Dictionary.
 
template<typename T >
std::string pretty_typename ()
 Return typename boost-prettified if available, otherwise as returned by typename().
 
std::string get_typename (const any_type &operand)
 Return typename of operand.
 
std::string get_dict_typenames (const Dictionary &dict)
 Return multi-line string displaying dictionary content.
 
template<>
std::vector< double > dictionary_::cast_value_< std::vector< double > > (const any_type &value, const std::string &key) const
 Specialization that allows passing long or empty vectors where double vectors are expected.
 
template<>
std::vector< std::string > dictionary_::cast_value_< std::vector< std::string > > (const any_type &value, const std::string &key) const
 Specialization that allows passing empty lists where a list of strings is expected.
 

Function Documentation

◆ dictionary_::cast_value_< std::vector< double > >()

template<>
std::vector< double > dictionary_::cast_value_< std::vector< double > > ( const any_type &  value,
const std::string &  key 
) const

Specialization that allows passing long or empty vectors where double vectors are expected.

Note
This specialization forwards to cast_vector_value_<double>, but is required explicitly, because, e.g., get() calls 0cast_value_() directly even if the argument is a vector.

◆ dictionary_::cast_value_< std::vector< std::string > >()

template<>
std::vector< std::string > dictionary_::cast_value_< std::vector< std::string > > ( const any_type &  value,
const std::string &  key 
) const

Specialization that allows passing empty lists where a list of strings is expected.