Falaise  4.0.1
SuperNEMO Software Toolkit
Namespaces | Typedefs | Functions
property_reader.h File Reference

Convenience functions for reading datatools::properties. More...

#include <exception>
#include <string>
#include <vector>
#include <bayeux/datatools/properties.h>
#include <boost/mpl/contains.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/utility/enable_if.hpp>

Go to the source code of this file.

Namespaces

 falaise
 
 falaise::config
 
 falaise::config::type_check_visitor
 Functions for visiting a property item and checking its type is valid.
 
 falaise::config::type_check_visitor::detail
 

Typedefs

typedef std::logic_error falaise::config::WrongType
 
typedef std::logic_error falaise::config::MissingKey
 
typedef boost::mpl::vector< int, double, bool, std::string, std::vector< int >, std::vector< double >, std::vector< bool >, std::vector< std::string > > falaise::config::AllowedTypes
 List of types that can be stored in and read from datatools::properties. More...
 

Functions

bool falaise::config::type_check_visitor::detail::visit_impl (const datatools::properties &p, const std::string &key, int)
 
bool falaise::config::type_check_visitor::detail::visit_impl (const datatools::properties &p, const std::string &key, double)
 
bool falaise::config::type_check_visitor::detail::visit_impl (const datatools::properties &p, const std::string &key, bool)
 
bool falaise::config::type_check_visitor::detail::visit_impl (const datatools::properties &p, const std::string &key, std::string)
 
bool falaise::config::type_check_visitor::detail::visit_impl (const datatools::properties &p, const std::string &key, std::vector< int >)
 
bool falaise::config::type_check_visitor::detail::visit_impl (const datatools::properties &p, const std::string &key, std::vector< double >)
 
bool falaise::config::type_check_visitor::detail::visit_impl (const datatools::properties &p, const std::string &key, std::vector< bool >)
 
bool falaise::config::type_check_visitor::detail::visit_impl (const datatools::properties &p, const std::string &key, std::vector< std::string >)
 
template<typename T >
bool falaise::config::type_check_visitor::visit (const datatools::properties &p, const std::string &key)
 
template<typename T >
falaise::config::getRequiredValue (const datatools::properties &p, const std::string &key)
 
template<typename T >
falaise::config::getValueOrDefault (const datatools::properties &p, const std::string &key, T defaultValue)
 

Detailed Description

Convenience functions for reading datatools::properties.

The interface provided by datatools::properties often requires significant boilerplate code to check for and extract values associated with keys. The functions here help to minimize this and assist in binding a struct to a properties definition