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_;}
114 operator string()
const {
return this->sel_.int_to_name(this->
val_); }
174 && root_storage_ == actual_storage_
176 delete root_storage_;
205 std::shared_ptr<Address> down(
unsigned int idx)
const;
213 return data_->actual_storage_;
221 std::string make_full_address()
const;
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;
357 EI_Address ei_address()
const ;
362 string address_string()
const;
367 virtual string input_type_name();
375 void set_address(
const Address &address);
421 string input_type_name()
override;
489 EI_Address ei_address()
const ;
494 string address_string()
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;
610 EI_Address ei_address()
const ;
615 string address_string()
const;
655 template<
class T,
class Enable =
void>
673 : address_(address), index_(index)
679 inline bool operator != (
const IteratorBase &that)
const;
684 inline operator bool()
const;
689 inline unsigned int idx()
const;
747 :
IteratorBase(address, index), type_( type_check_and_convert(type))
764 inline OutputType *operator ->()
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.");
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.") );
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.