25 #ifndef INPUT_INTERFACE_HH_
26 #define INPUT_INTERFACE_HH_
32 #include <boost/type_traits.hpp>
33 #include <boost/mpl/if.hpp>
34 #include <boost/static_assert.hpp>
67 <<
". Can not construct Iterator<T> with C++ type T=" << EI_CPPRequiredType::qval <<
";\n"
68 <<
"can not convert Type: " << EI_InputType::qval <<
" to: " << EI_RequiredType::qval
73 DECLARE_EXCEPTION( ExcAccessorForNullStorage, <<
"Can not create " << EI_AccessorName::val <<
" from StorageNull.");
77 DECLARE_EXCEPTION( ExcAddressNullPointer, <<
"NULL pointer in " << EI_ParamName::val <<
" parameter.");
102 operator int()
const {
return val_;}
103 operator unsigned int()
const {
return val_;}
112 operator int()
const {
return this->
val_;}
113 operator unsigned int()
const {
return this->
val_;}
205 std::shared_ptr<Address>
down(
unsigned int idx)
const;
213 return data_->actual_storage_;
228 boost::shared_ptr<AddressData>
data_;
311 inline const Ret
val(
const string &key)
const;
318 inline const Ret
val(
const string &key,
const Ret default_val)
const;
345 inline bool opt_val(
const string &key, Ret &value)
const;
503 template<
class Type,
class... Arguments>
504 const std::shared_ptr<Type>
factory(Arguments... arguments)
const;
579 template <
class ValueType>
590 inline unsigned int size()
const;
597 template <
class Container>
598 void copy_to(Container &out)
const;
655 template<
class T,
class Enable =
void>
684 inline operator bool()
const;
689 inline unsigned int idx()
const;
797 template<
class T,
class Enable >
799 class some_nonexisting_type;
800 static_assert( std::is_same<T, some_nonexisting_type>::value,
"Wrong TypeDispatch type.");
804 struct TypeDispatch<T, typename boost::enable_if<boost::is_enum<T> >::type> {
829 struct TypeDispatch<T, typename boost::enable_if<boost::is_integral<T> >::type> {
835 if (val >= std::numeric_limits<T>::min() &&
836 val <= std::numeric_limits<T>::max() ) {
839 THROW( ExcInputMessage()
840 << EI_Message(
"Error in input file at address " + a.
make_full_address() +
".\nValue out of bounds.") );
854 struct TypeDispatch<T, typename boost::enable_if<boost::is_float<T> >::type> {
Dedicated class for storing path to input and output files.
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.