25 #ifndef INPUT_INTERFACE_HH_ 26 #define INPUT_INTERFACE_HH_ 33 #include <type_traits> 64 #define INPUT_CATCH(ExceptionType, AddressEITag, input_accessor) \ 65 catch (ExceptionType &e ) { \ 66 e << AddressEITag(input_accessor.address_string()); \ 89 <<
". Can not construct Iterator<T> with C++ type T=" << EI_CPPRequiredType::qval <<
";\n" 90 <<
"can not convert Type: " << EI_InputType::qval <<
" to: " << EI_RequiredType::qval
95 DECLARE_EXCEPTION( ExcAccessorForNullStorage, <<
"Can not create " << EI_AccessorName::val <<
" from StorageNull.");
99 DECLARE_EXCEPTION( ExcAddressNullPointer, <<
"NULL pointer in " << EI_ParamName::val <<
" parameter.");
124 operator int()
const {
return val_;}
125 operator unsigned int()
const {
return val_;}
134 operator int()
const {
return this->
val_;}
135 operator unsigned int()
const {
return this->
val_;}
136 operator string()
const {
return this->sel_.int_to_name(this->
val_); }
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>
692 inline bool operator != (
const IteratorBase &that)
const;
697 inline operator bool()
const;
702 inline unsigned int idx()
const;
707 const Address &get_address()
const;
759 :
IteratorBase(address, index), type_( type_check_and_convert(type))
776 inline OutputType *operator ->()
const;
809 template<
class T,
class Enable >
811 class some_nonexisting_type;
847 if (val >= std::numeric_limits<T>::min() &&
848 val <= std::numeric_limits<T>::max() ) {
851 THROW( ExcInputMessage()
852 << EI_Message(
"Error in input file at address " + a.
make_full_address() +
".\nValue out of bounds.") );
866 struct TypeDispatch<T, typename
std::enable_if<std::is_floating_point<T>::value >::type> {
arma::Mat< Type >::template fixed< resRows, resCols > operator*(const Mat< Type, resRows, commonDimension > &a, const Mat< Type, commonDimension, resCols > &b)
static constexpr bool value
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.