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_); }
189 && root_storage_ == actual_storage_
191 delete root_storage_;
220 std::shared_ptr<Address> down(
unsigned int idx)
const;
228 return data_->actual_storage_;
236 std::string make_full_address()
const;
326 inline const Ret val(
const string &key)
const;
333 inline const Ret val(
const string &key,
const Ret default_val)
const;
360 inline bool opt_val(
const string &key, Ret &
value)
const;
372 EI_Address ei_address()
const ;
377 string address_string()
const;
382 virtual string input_type_name();
390 void set_address(
const Address &address);
436 string input_type_name()
override;
504 EI_Address ei_address()
const ;
509 string address_string()
const;
518 template<
class Type,
class... Arguments>
519 const std::shared_ptr<Type> factory(Arguments... arguments)
const;
594 template <
class ValueType>
605 inline unsigned int size()
const;
612 template <
class Container>
613 void copy_to(Container &out)
const;
625 EI_Address ei_address()
const ;
630 string address_string()
const;
670 template<
class T,
class Enable =
void>
688 : address_(address), index_(index)
694 inline bool operator != (
const IteratorBase &that)
const;
699 inline operator bool()
const;
704 inline unsigned int idx()
const;
762 :
IteratorBase(address, index), type_( type_check_and_convert(type))
779 inline OutputType *operator ->()
const;
812 template<
class T,
class Enable >
814 class some_nonexisting_type;
850 if (val >= std::numeric_limits<T>::min() &&
851 val <= std::numeric_limits<T>::max() ) {
854 THROW( ExcInputMessage()
855 << 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.