i6engine  1.0
attributeMap.h File Reference
#include <map>
#include <string>
#include <type_traits>
#include "i6engine/utils/Exceptions.h"
#include "boost/lexical_cast.hpp"
#include "boost/archive/text_iarchive.hpp"
#include "boost/archive/text_oarchive.hpp"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  i6e::api::detail::hasInsertInMap< T >
 
struct  i6e::api::detail::hasInsertInMap< T >::SFINAE< U, const >
 
struct  i6e::api::detail::constructible_from< type, Args >
 

Namespaces

 i6e
 
 i6e::api
 
 i6e::api::detail
 

Typedefs

typedef std::map< std::string, std::string > i6e::api::attributeMap
 

Functions

template<typename T >
std::enable_if< std::is_enum< T >::value &&!std::is_fundamental< T >::value, void >::type i6e::api::parseAttribute (attributeMap::const_iterator it, T &value)
 converts a string to enum value More...
 
template<typename T >
std::enable_if<!std::is_enum< T >::value &&!std::is_fundamental< T >::value &&detail::constructible_from< T, const std::string & >::value, void >::type i6e::api::parseAttribute (attributeMap::const_iterator it, T &value)
 converts a string to a class using T(const std::string &) constructor More...
 
template<typename T >
std::enable_if<!std::is_enum< T >::value &&!std::is_fundamental< T >::value &&!detail::constructible_from< T, const std::string & >::value, void >::type i6e::api::parseAttribute (attributeMap::const_iterator it, T &value)
 converts a string to a class using boost::serialization (used if no T(const std::string &) constructor is available) More...
 
template<typename T >
std::enable_if<!std::is_enum< T >::value &&std::is_fundamental< T >::value, void >::type i6e::api::parseAttribute (attributeMap::const_iterator it, T &value)
 converts a string to a fundamental type using boost::lexical_cast More...
 
template<typename T >
std::enable_if< std::is_enum< T >::value &&!std::is_fundamental< T >::value, void >::type i6e::api::writeAttribute (attributeMap &params, const std::string &entry, const T &value)
 writes into an attributeMap More...
 
template<bool Required, typename T >
std::enable_if< Required, void >::type i6e::api::parseAttribute (const attributeMap &params, const std::string &entry, T &value)
 parses a value from attribute map into a variable with possibility to throw exception, if entry not available More...
 
template<bool Required, typename T >
std::enable_if<!Required, void >::type i6e::api::parseAttribute (const attributeMap &params, const std::string &entry, T &value)
 parses an optional value from attribute map into a variable More...
 
template<typename T >
std::enable_if<!std::is_enum< T >::value &&!std::is_fundamental< T >::value &&!std::is_same< T, std::string >::value &&detail::hasInsertInMap< T >::value, void >::type i6e::api::writeAttribute (attributeMap &params, const std::string &entry, T value)
 writes a class providing the method insertInMap More...
 
template<typename T >
std::enable_if<!std::is_enum< T >::value &&!std::is_fundamental< T >::value &&(std::is_same< T, std::string >::value||std::is_same< const char, typename std::remove_pointer< T >::type >::value), void >::type i6e::api::writeAttribute (attributeMap &params, const std::string &entry, T value)
 writes a string as is More...
 
template<typename T >
std::enable_if<!std::is_enum< T >::value &&std::is_fundamental< T >::value, void >::type i6e::api::writeAttribute (attributeMap &params, const std::string &entry, T value)
 writes a fundamental type to the map using std::to_string More...
 
template<typename T >
std::enable_if<!std::is_enum< T >::value &&!std::is_fundamental< T >::value &&!std::is_same< T, std::string >::value &&!std::is_same< const char, typename std::remove_pointer< T >::type >::value &&!detail::hasInsertInMap< T >::value, void >::type i6e::api::writeAttribute (attributeMap &params, const std::string &entry, T value)
 writes a class not providing the method insertInMap, so it uses boost::serialization to convert to a string More...