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> 57 #define INPUT_CATCH(ExceptionType, AddressEITag, input_accessor) \ 58 catch (ExceptionType &e ) { \ 59 e << AddressEITag(input_accessor.address_string()); \ 82 <<
". Can not construct Iterator<T> with C++ type T=" << EI_CPPRequiredType::qval <<
";\n" 83 <<
"can not convert Type: " << EI_InputType::qval <<
" to: " << EI_RequiredType::qval
88 DECLARE_EXCEPTION( ExcAccessorForNullStorage, <<
"Can not create " << EI_AccessorName::val <<
" from StorageNull.");
92 DECLARE_EXCEPTION( ExcAddressNullPointer, <<
"NULL pointer in " << EI_ParamName::val <<
" parameter.");
117 operator int()
const {
return val_;}
118 operator unsigned int()
const {
return val_;}
127 operator int()
const {
return this->
val_;}
128 operator unsigned int()
const {
return this->
val_;}
129 operator string()
const {
return this->sel_.int_to_name(this->
val_); }
214 std::shared_ptr<Address> down(
unsigned int idx)
const;
222 return data_->actual_storage_;
230 std::string make_full_address()
const;
320 inline const Ret val(
const string &key)
const;
327 inline const Ret val(
const string &key,
const Ret default_val)
const;
354 inline bool opt_val(
const string &key, Ret &
value)
const;
366 EI_Address ei_address()
const ;
371 string address_string()
const;
376 virtual string input_type_name();
384 void set_address(
const Address &address);
430 string input_type_name()
override;
498 EI_Address ei_address()
const ;
503 string address_string()
const;
512 template<
class Type,
class... Arguments>
513 const std::shared_ptr<Type> factory(Arguments... arguments)
const;
588 template <
class ValueType>
599 inline unsigned int size()
const;
606 template <
class Container>
607 void copy_to(Container &out)
const;
619 EI_Address ei_address()
const ;
624 string address_string()
const;
664 template<
class T,
class Enable =
void>
686 inline bool operator != (
const IteratorBase &that)
const;
691 inline operator bool()
const;
696 inline unsigned int idx()
const;
701 const Address &get_address()
const;
753 :
IteratorBase(address, index), type_( type_check_and_convert(type))
770 inline OutputType *operator ->()
const;
803 template<
class T,
class Enable >
805 class some_nonexisting_type;
841 if (val >= std::numeric_limits<T>::min() &&
842 val <= std::numeric_limits<T>::max() ) {
845 THROW( ExcInputMessage()
846 << EI_Message(
"Error in input file at address " + a.
make_full_address() +
".\nValue out of bounds.") );
static constexpr bool value
UnitSI operator*(const UnitSI &a, const UnitSI &b)
Product of two units.
bool operator==(const Null &, const Null &)
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.