25 #ifndef INPUT_INTERFACE_HH_ 26 #define INPUT_INTERFACE_HH_ 33 #include <type_traits> 63 #define INPUT_CATCH(ExceptionType, AddressEITag, input_accessor) \ 64 catch (ExceptionType &e ) { \ 65 e << AddressEITag(input_accessor.address_string()); \ 88 <<
". Can not construct Iterator<T> with C++ type T=" << EI_CPPRequiredType::qval <<
";\n" 89 <<
"can not convert Type: " << EI_InputType::qval <<
" to: " << EI_RequiredType::qval
94 DECLARE_EXCEPTION( ExcAccessorForNullStorage, <<
"Can not create " << EI_AccessorName::val <<
" from StorageNull.");
98 DECLARE_EXCEPTION( ExcAddressNullPointer, <<
"NULL pointer in " << EI_ParamName::val <<
" parameter.");
123 operator int()
const {
return val_;}
124 operator unsigned int()
const {
return val_;}
133 operator int()
const {
return this->
val_;}
134 operator unsigned int()
const {
return this->
val_;}
135 operator string()
const {
return this->sel_.int_to_name(this->
val_); }
219 std::shared_ptr<Address> down(
unsigned int idx)
const;
227 return data_->actual_storage_;
235 std::string make_full_address()
const;
325 inline const Ret val(
const string &key)
const;
332 inline const Ret val(
const string &key,
const Ret default_val)
const;
359 inline bool opt_val(
const string &key, Ret &
value)
const;
371 EI_Address ei_address()
const ;
376 string address_string()
const;
381 virtual string input_type_name();
389 void set_address(
const Address &address);
435 string input_type_name()
override;
503 EI_Address ei_address()
const ;
508 string address_string()
const;
517 template<
class Type,
class... Arguments>
518 const std::shared_ptr<Type> factory(Arguments... arguments)
const;
593 template <
class ValueType>
604 inline unsigned int size()
const;
611 template <
class Container>
612 void copy_to(Container &out)
const;
624 EI_Address ei_address()
const ;
629 string address_string()
const;
669 template<
class T,
class Enable =
void>
691 inline bool operator != (
const IteratorBase &that)
const;
696 inline operator bool()
const;
701 inline unsigned int idx()
const;
706 const Address &get_address()
const;
758 :
IteratorBase(address, index), type_( type_check_and_convert(type))
775 inline OutputType *operator ->()
const;
808 template<
class T,
class Enable >
810 class some_nonexisting_type;
846 if (val >= std::numeric_limits<T>::min() &&
847 val <= std::numeric_limits<T>::max() ) {
850 THROW( ExcInputMessage()
851 << EI_Message(
"Error in input file at address " + a.
make_full_address() +
".\nValue out of bounds.") );
865 struct TypeDispatch<T, typename
std::enable_if<std::is_floating_point<T>::value >::type> {
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.