Flow123d  release_1.8.2-1603-g0109a2b
type_base.hh
Go to the documentation of this file.
1 /*!
2  *
3  * Copyright (C) 2015 Technical University of Liberec. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License version 3 as published by the
7  * Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12  *
13  *
14  * @file type_base.hh
15  * @brief
16  */
17 
18 #ifndef TYPE_BASE_HH_
19 #define TYPE_BASE_HH_
20 
21 #include <limits>
22 #include <ios>
23 #include <set>
24 #include <map>
25 #include <vector>
26 #include <string>
27 #include <iomanip>
28 
29 #include <boost/type_traits.hpp>
30 #include <boost/tokenizer.hpp>
31 #include <boost/shared_ptr.hpp>
32 #include <boost/make_shared.hpp>
33 #include <boost/algorithm/string.hpp>
34 
35 #include "system/global_defs.h"
36 #include "system/system.hh"
37 #include "system/exceptions.hh"
38 #include "system/file_path.hh"
39 
40 
41 
42 
43 namespace Input {
44 
45 namespace Type {
46 
47 
48 
49 using namespace std;
50 
51 /**
52  * Declaration of common exceptions and error info types.
53  */
54 TYPEDEF_ERR_INFO( EI_KeyName, const string );
55 
56 TYPEDEF_ERR_INFO( EI_DefaultStr, const string);
57 TYPEDEF_ERR_INFO( EI_TypeName, const string);
58 DECLARE_EXCEPTION( ExcWrongDefault, << "Default value " << EI_DefaultStr::qval
59  << " do not match type: " << EI_TypeName::qval << ";\n"
60  << "During declaration of the key: " << EI_KeyName::qval );
61 
62 
63 
64 
65 /**
66  * @brief Base of classes for declaring structure of the input data.
67  *
68  * Provides methods and class members common to all types. Namely, the type name, finished status (nontrivial only
69  * for types with complex initialization - Record, AbstractRecosd, Selection), attributes, data of generic types
70  * and output of the documentation.
71  *
72  * @ingroup input_types
73  */
74 class TypeBase {
75 public:
76  /// Type returned by content_hash methods.
77  typedef std::size_t TypeHash;
78 
79  /// String stored in JSON format.
80  typedef std::string json_string;
81  /// Defines map of Input::Type attributes.
83 
84  /// Defines pairs of (name, Input::Type), that are used for replace of parameters in generic types.
85  typedef std::pair< std::string, std::shared_ptr<TypeBase> > ParameterPair;
86  /// Define vector of parameters passed to the overloaded make_instance method.
88 
89  /// Defines map of used parameters
91  /// Return type of make_instance methods, contains instance of generic type and map of used parameters
92  typedef std::pair< std::shared_ptr<TypeBase>, ParameterMap > MakeInstanceReturnType;
93 
94 
95  /**
96  * @brief Returns true if the type is fully specified and ready for read access.
97  *
98  * For Record and Array types this say nothing about child types referenced in particular type object.
99  * In particular for Record and Selection, it returns true after @p finish() method is called.
100  */
101  virtual bool is_finished() const
102  {return true;}
103 
104  /**
105  * @brief Returns true if the type is closed.
106  */
107  virtual bool is_closed() const
108  {return true;}
109 
110  /// Returns an identification of the type. Useful for error messages.
111  virtual string type_name() const { return "TypeBase"; }
112  /// Returns an identification of the class. Useful for output of the documentation.
113  virtual string class_name() const { return "TypeBase"; }
114 
115  /**
116  * @brief Returns string with Type extensive documentation.
117  *
118  * We need this to pass Type description at throw points since the Type object can be deallocated during stack
119  * unrolling so it is not good idea to pass pointer. Maybe we can pass smart pointers. Actually this method is
120  * used in various exceptions in json_to_storage.
121  *
122  * TODO: Some old note on this topic:
123  * !!! how to pass instance of descendant of TypeBase through EI -
124  * - can not pass it directly since TypeBase is not copyconstructable
125  * - can not use shared_ptr for same reason
126  * - can not use C pointers since the referred object can be temporary
127  * solutions:
128  * - consistently move TypeBase to Pimpl design
129  * - provide virtual function make_copy, that returns valid shared_ptr
130  *
131  */
132  string desc() const;
133 
134 
135 
136  /**
137  * @brief Comparison of types.
138  *
139  * It compares kind of type (Integer, Double, String, Record, ..), for complex types it also compares names.
140  * For arrays compare subtypes.
141  */
142  virtual bool operator==(const TypeBase &other) const
143  { return typeid(*this) == typeid(other); }
144 
145  /// Comparison of types.
146  bool operator!=(const TypeBase & other) const
147  { return ! (*this == other); }
148 
149  /// Destructor
150  virtual ~TypeBase();
151 
152 
153 
154  /**
155  * @brief Finishes all types registered in type repositories.
156  *
157  * Finish must be executed in suitable order
158  * 1) finish of Instance types, generic Abstract and generic Record types
159  * 2) finish of non-generic Abstract and non-generic Record types
160  * 3) finish of the other types
161  */
162  static void lazy_finish();
163 
164 
165  /**
166  * @brief Finish method. Finalize construction of "Lazy types": Record, Selection, Abstract and generic type.
167  *
168  * These input types are typically defined by means of static generating methods, whose allows initialization
169  * any of other input types. Since e.g. a Record can link to other input types through its keys at the
170  * initialization phase. But some setting (e.g. add descendants to Abstract) can't be done in initialization
171  * phase. Therefore, the remaining part of initialization can be done later, in finalization phase, typically
172  * from main(), by calling the method finish().
173  *
174  * Finish of generic types can be different of other Input::Types (e. g. for Record) and needs set @p is_generic
175  * to true.
176  */
177  virtual bool finish(bool is_generic = false)
178  { return true; };
179 
180  /**
181  * @brief Hash of the type specification.
182  *
183  * Provides unique id computed from its content (definition) so that same types have same hash.
184  *
185  * Hash is counted using type, name and other class members specific for descendants.
186  */
187  virtual TypeHash content_hash() const =0;
188 
189  /**
190  * @brief Format given hash for output.
191  *
192  * Use hex format and double quotas.
193  */
194  static std::string hash_str(TypeHash hash);
195 
196  /// Format the hash of this type.
197  inline std::string hash_str() const {
198  return hash_str(content_hash());
199  }
200 
201  /**
202  * Create instance of generic type.
203  *
204  * Replace parameters in input tree by type stored in @p vec.
205  */
206  virtual MakeInstanceReturnType make_instance(ParameterVector vec = ParameterVector()) =0;
207 
208  /// Indicates if type is marked with flag @p root_of_generic_subtree_
210  return root_of_generic_subtree_;
211  }
212 
213 protected:
214 
215  /// The default constructor.
216  TypeBase();
217 
218  /// Copy constructor.
219  TypeBase(const TypeBase& other);
220 
221  /**
222  * @brief Add attribute of given @p name to attribute map.
223  *
224  * Parameter @p val must contain valid JSON string.
225  */
226  void add_attribute_(std::string name, json_string val);
227 
228 
229 
230  /**
231  * @brief The type of hash values used in associative array that translates key names to indices in Record and Selection.
232  *
233  * For simplicity, we currently use whole strings as "hash".
234  */
235  typedef string KeyHash;
236 
237  /// Hash function.
238  inline static KeyHash key_hash(const string &str) {
239  return (str);
240  }
241 
242  /**
243  * @brief Check that a @p key is valid identifier.
244  *
245  * I.e. consists only of valid characters, that are lower-case letters, digits and underscore,
246  * we allow identifiers starting with a digit, but it is discouraged since it slows down parsing of the input file.
247  */
248  static bool is_valid_identifier(const string& key);
249 
250  /// Check if @p str is valid JSON string
251  bool validate_json(json_string str) const;
252 
253  /// Create JSON output from @p parameter_map formatted as value of attribute.
254  json_string print_parameter_map_to_json(ParameterMap parameter_map) const;
255 
256  /**
257  * JSON format of the vector of parameter names. Used for generic composed types.
258  * TODO: use ParameterVector instead of ParameterMap and merge this method with the previous one.
259  */
260  json_string print_parameter_map_keys_to_json(ParameterMap param_map) const;
261 
262  /**
263  * Extract and set attributes from the ParameterMap containing parameters of the subtree.
264  * Used in implementations of the make_instance method.
265  */
266  void set_generic_attributes(ParameterMap param_map);
267 
268  /**
269  * Copy attributes to the instance of the generic type. Remove all internal attributes starting with '_'.
270  */
271  void copy_attributes(attribute_map other_attributes);
272 
273 
274  /// map of type attributes (e. g. input_type, name etc.)
275  std::shared_ptr<attribute_map> attributes_;
276 
277  /// flag is true if type should be root of generic subtree
279 
280  /// hash string of generic type if type is derived, or empty string
282 
283  /// map of parameters if type is part of generic subtree
284  ParameterMap parameter_map_;
285 
286  friend class Array;
287  friend class Record;
288  friend class OutputBase;
289 };
290 
291 /**
292  * @brief For convenience we provide also redirection operator for output documentation of Input:Type classes.
293  */
294 std::ostream& operator<<(std::ostream& stream, const TypeBase& type);
295 
296 
297 class Record;
298 class Selection;
299 
300 
301 /**
302  * @brief Class for declaration of inputs sequences.
303  *
304  * The type is fully specified after its constructor is called. All elements of the Array has same type, however you
305  * can use elements of Abstract.
306  *
307  * If you not disallow Array size 1, the input reader will try to convert any other type
308  * on input into array with one element, e.g.
309  @code
310  int_array=1 # is equivalent to
311  int_array=[ 1 ]
312  @endcode
313  *
314  * @ingroup input_types
315  */
316 class Array : public TypeBase {
317  friend class OutputBase;
318 
319 protected:
320 
321  /**
322  * @brief Actual data of the Array.
323  */
324  class ArrayData {
325  public:
326 
327  /// Constructor
328  ArrayData(unsigned int min_size, unsigned int max_size)
329  : lower_bound_(min_size), upper_bound_(max_size), finished(false)
330  {}
331  /// Finishes initialization of the ArrayData.
332  bool finish(bool is_generic = false);
333  /// Type of Array
334  std::shared_ptr<TypeBase> type_of_values_;
335  /// Minimal size of Array
336  unsigned int lower_bound_;
337  /// Maximal size of Array
338  unsigned int upper_bound_;
339  /// Flag specified if Array is finished
340  bool finished;
341 
342  };
343 
344 public:
345  /**
346  * @brief Constructor with a @p type of array items given as pure reference.
347  *
348  * In this case \p type has to by descendant of \p TypeBase different from 'complex' types
349  * @p Record and @p Selection. You can also specify minimum and maximum size of the array.
350  */
351  template <class ValueType>
352  Array(const ValueType &type, unsigned int min_size=0, unsigned int max_size=std::numeric_limits<unsigned int>::max() );
353 
354  /**
355  * @brief Constructor with a shared pointer @p type of array.
356  */
357  Array(std::shared_ptr<TypeBase> type, unsigned int min_size=0, unsigned int max_size=std::numeric_limits<unsigned int>::max() );
358 
359  /**
360  * @brief Implements @p TypeBase::content_hash.
361  *
362  * Hash is calculated by type name, bounds, hash of stored type and hash of attributes.
363  */
364  TypeHash content_hash() const override;
365 
366  /// Finishes initialization of the Array type because of lazy evaluation of type_of_values.
367  bool finish(bool is_generic = false) override;
368 
369  /// Override @p Type::TypeBase::is_finished.
370  bool is_finished() const override {
371  return data_->finished; }
372 
373  /// Getter for the type of array items.
374  inline const TypeBase &get_sub_type() const {
375  return *data_->type_of_values_; }
376 
377  /// Checks size of particular array.
378  inline bool match_size(unsigned int size) const {
379  return size >=data_->lower_bound_ && size<=data_->upper_bound_; }
380 
381  /**
382  * @brief Implements @p Type::TypeBase::type_name.
383  *
384  * Name has form \p array_of_'subtype_name'.
385  */
386  string type_name() const override;
387  /// Override @p Type::TypeBase::class_name.
388  string class_name() const override { return "Array"; }
389 
390  /// @brief Implements @p Type::TypeBase::operator== Compares also subtypes.
391  bool operator==(const TypeBase &other) const override;
392 
393  /// Implements @p TypeBase::make_instance.
395 
396  /**
397  * @brief Create deep copy of Array.
398  *
399  * Copy all data stored in shared pointers etc.
400  */
401  Array deep_copy() const;
402 
403 protected:
404 
405  /// Handle to the actual array data.
406  std::shared_ptr<ArrayData> data_;
407 private:
408  /// Forbids default constructor in order to prevent empty data_.
409  Array();
410 };
411 
412 
413 
414 /**
415  * @brief Base of all scalar types.
416  *
417  * @ingroup input_types
418  */
419 class Scalar : public TypeBase {};
420 
421 
422 /**
423  * @brief Class for declaration of the input of type Bool.
424  *
425  * String names of boolean values are \p 'true' and \p 'false'.
426  *
427  * @ingroup input_types
428  */
429 class Bool : public Scalar {
430 public:
431  /// Constructor.
433  {}
434 
435  /// Implements @p TypeBase::content_hash.
436  TypeHash content_hash() const override;
437 
438 
439  /**
440  * @brief Implements @p Type::TypeBase::type_name.
441  *
442  * Name has form \p Bool.
443  */
444  string type_name() const override;
445  /// Override @p Type::TypeBase::class_name.
446  string class_name() const override { return "Bool"; }
447 
448  /// Implements @p TypeBase::make_instance.
450 };
451 
452 
453 /**
454  * @brief Class for declaration of the integral input data.
455  *
456  * The data are stored in an \p signed \p int variable. You can specify bounds for the valid input data.
457  *
458  * @ingroup input_types
459  */
460 class Integer : public Scalar {
461  friend class OutputBase;
462 
463 public:
464  /**
465  * @brief Constructor.
466  *
467  * You can also specify minimum and maximum value.
468  */
469  Integer(int lower_bound=std::numeric_limits<int>::min(), int upper_bound=std::numeric_limits<int>::max())
470  : lower_bound_(lower_bound), upper_bound_(upper_bound)
471  {}
472 
473  /**
474  * @brief Implements @p TypeBase::content_hash.
475  *
476  * Hash is calculated by type name and bounds.
477  */
478  TypeHash content_hash() const override;
479 
480  /**
481  * @brief Check valid value of Integer.
482  *
483  * Returns true if the given integer value conforms to the Type::Integer bounds.
484  */
485  bool match(std::int64_t value) const;
486 
487  /**
488  * @brief Implements @p Type::TypeBase::type_name.
489  *
490  * Name has form \p Integer.
491  */
492  string type_name() const override;
493  /// Override @p Type::TypeBase::class_name.
494  string class_name() const override { return "Integer"; }
495 
496  /// Implements @p TypeBase::make_instance.
498 private:
499 
500  std::int64_t lower_bound_; ///< Minimal value of Integer.
501  std::int64_t upper_bound_; ///< Maximal value of Integer.
502 
503 };
504 
505 
506 /**
507  * @brief Class for declaration of the input data that are floating point numbers.
508  *
509  * The data are stored in an \p double variable. You can specify bounds for the valid input data.
510  *
511  * @ingroup input_types
512  */
513 class Double : public Scalar {
514  friend class OutputBase;
515 
516 public:
517  /**
518  * @brief Constructor.
519  *
520  * You can also specify minimum and maximum value.
521  */
522  Double(double lower_bound= -std::numeric_limits<double>::max(), double upper_bound=std::numeric_limits<double>::max())
523  : lower_bound_(lower_bound), upper_bound_(upper_bound)
524  {}
525 
526  /**
527  * @brief Implements @p TypeBase::content_hash.
528  *
529  * Hash is calculated by type name and bounds.
530  */
531  TypeHash content_hash() const override;
532 
533  /// Returns true if the given integer value conforms to the Type::Double bounds.
534  bool match(double value) const;
535 
536  /**
537  * @brief Implements @p Type::TypeBase::type_name.
538  *
539  * Name has form \p Double.
540  */
541  string type_name() const override;
542  /// Override @p Type::TypeBase::class_name.
543  string class_name() const override { return "Double"; }
544 
545  /// Implements @p TypeBase::make_instance.
547 private:
548 
549  double lower_bound_; ///< Minimal value of Integer.
550  double upper_bound_; ///< Maximal value of Integer.
551 
552 };
553 
554 
555 
556 /**
557  * @brief Class for declaration of the input data that are in string format.
558  *
559  * Just for consistency, but is essentially same as Scalar.
560  *
561  * @ingroup input_types
562  */
563 class String : public Scalar {
564 public:
565  /**
566  * @brief Implements @p Type::TypeBase::type_name.
567  *
568  * Name has form \p String.
569  */
570  virtual string type_name() const override;
571  /// Override @p Type::TypeBase::class_name.
572  string class_name() const override { return "String"; }
573 
574  /// Implements @p TypeBase::content_hash.
575  TypeHash content_hash() const override;
576 
577  /// Particular descendants can check validity of the string.
578  virtual bool match(const string &value) const;
579 
580  /// Implements @p TypeBase::make_instance.
581  virtual MakeInstanceReturnType make_instance(std::vector<ParameterPair> vec = std::vector<ParameterPair>()) override;
582 };
583 
584 
585 /**
586  * @brief Class for declaration of the input data that are file names.
587  *
588  * We strictly distinguish filenames for input and output files.
589  *
590  * @ingroup input_types
591  */
592 class FileName : public String {
593 public:
594 
595  /// Implements @p TypeBase::content_hash.
596  TypeHash content_hash() const override;
597 
598  /**
599  * @brief The factory function for declaring type FileName for input files.
600  */
601  static FileName input()
602  { return FileName(::FilePath::input_file); }
603 
604  /**
605  * @brief The factory function for declaring type FileName for input files.
606  */
607  static FileName output()
608  { return FileName(::FilePath::output_file); }
609 
610  /**
611  * @brief Implements @p Type::TypeBase::type_name.
612  *
613  * Name has form \p FileName_input or \p FileName_output
614  */
615  string type_name() const override;
616  /// Override @p Type::TypeBase::class_name.
617  string class_name() const override { return "FileName"; }
618 
619  /// Comparison of types.
620  bool operator==(const TypeBase &other) const
621  { return typeid(*this) == typeid(other) &&
622  (type_== static_cast<const FileName *>(&other)->get_file_type() );
623  }
624 
625  /// Checks relative output paths.
626  bool match(const string &str) const;
627 
628 
629  /**
630  * @brief Returns type of the file input/output.
631  */
633  return type_;
634  }
635 
636  /// Implements @p TypeBase::make_instance.
638 
639 
640 
641 private:
642  /// The type of file (input or output).
644 
645  /// Forbids default constructor.
646  FileName() {}
647 
648  /// Forbids direct construction.
649  FileName(enum ::FilePath::FileType type)
650  : type_(type)
651  {}
652 
653 };
654 
655 } // closing namespace Type
656 } // closing namespace Input
657 
658 
659 
660 
661 
662 #endif /* TYPE_BASE_HH_ */
Bool()
Constructor.
Definition: type_base.hh:432
string class_name() const override
Override Type::TypeBase::class_name.
Definition: type_base.hh:617
string class_name() const override
Override Type::TypeBase::class_name.
Definition: type_base.hh:572
std::int64_t lower_bound_
Minimal value of Integer.
Definition: type_base.hh:500
Base of classes for declaring structure of the input data.
Definition: type_base.hh:74
string class_name() const override
Override Type::TypeBase::class_name.
Definition: type_base.hh:494
virtual bool finish(bool is_generic=false)
Finish method. Finalize construction of "Lazy types": Record, Selection, Abstract and generic type...
Definition: type_base.hh:177
bool is_root_of_generic_subtree()
Indicates if type is marked with flag root_of_generic_subtree_.
Definition: type_base.hh:209
virtual bool is_closed() const
Returns true if the type is closed.
Definition: type_base.hh:107
virtual bool operator==(const TypeBase &other) const
Comparison of types.
Definition: type_base.hh:142
bool operator==(const TypeBase &other) const
Comparison of types.
Definition: type_base.hh:620
std::string hash_str() const
Format the hash of this type.
Definition: type_base.hh:197
bool root_of_generic_subtree_
flag is true if type should be root of generic subtree
Definition: type_base.hh:278
virtual string class_name() const
Returns an identification of the class. Useful for output of the documentation.
Definition: type_base.hh:113
TYPEDEF_ERR_INFO(EI_KeyName, const string)
Class for declaration of the input of type Bool.
Definition: type_base.hh:429
FileType
Possible types of file.
Definition: file_path.hh:50
std::pair< std::shared_ptr< TypeBase >, ParameterMap > MakeInstanceReturnType
Return type of make_instance methods, contains instance of generic type and map of used parameters...
Definition: type_base.hh:92
string class_name() const override
Override Type::TypeBase::class_name.
Definition: type_base.hh:446
virtual bool is_finished() const
Returns true if the type is fully specified and ready for read access.
Definition: type_base.hh:101
unsigned int upper_bound_
Maximal size of Array.
Definition: type_base.hh:338
::FilePath::FileType type_
The type of file (input or output).
Definition: type_base.hh:643
Base abstract class for output description of the Input::Type tree.
Definition: type_output.hh:58
Double(double lower_bound=-std::numeric_limits< double >::max(), double upper_bound=std::numeric_limits< double >::max())
Constructor.
Definition: type_base.hh:522
Base of all scalar types.
Definition: type_base.hh:419
static KeyHash key_hash(const string &str)
Hash function.
Definition: type_base.hh:238
virtual string type_name() const
Returns an identification of the type. Useful for error messages.
Definition: type_base.hh:111
Class for declaration of the input data that are file names.
Definition: type_base.hh:592
std::shared_ptr< attribute_map > attributes_
map of type attributes (e. g. input_type, name etc.)
Definition: type_base.hh:275
Class for declaration of the integral input data.
Definition: type_base.hh:460
ArrayData(unsigned int min_size, unsigned int max_size)
Constructor.
Definition: type_base.hh:328
Class for declaration of inputs sequences.
Definition: type_base.hh:316
double upper_bound_
Maximal value of Integer.
Definition: type_base.hh:550
ParameterMap parameter_map_
map of parameters if type is part of generic subtree
Definition: type_base.hh:284
string KeyHash
The type of hash values used in associative array that translates key names to indices in Record and ...
Definition: type_base.hh:235
std::shared_ptr< ArrayData > data_
Handle to the actual array data.
Definition: type_base.hh:406
bool operator==(const Null &, const Null &)
Global macros to enhance readability and debugging, general constants.
Class for declaration of the input data that are floating point numbers.
Definition: type_base.hh:513
static FileName input()
The factory function for declaring type FileName for input files.
Definition: type_base.hh:601
std::map< std::string, TypeHash > ParameterMap
Defines map of used parameters.
Definition: type_base.hh:90
std::int64_t upper_bound_
Maximal value of Integer.
Definition: type_base.hh:501
std::map< std::string, json_string > attribute_map
Defines map of Input::Type attributes.
Definition: type_base.hh:82
bool match_size(unsigned int size) const
Checks size of particular array.
Definition: type_base.hh:378
std::pair< std::string, std::shared_ptr< TypeBase > > ParameterPair
Defines pairs of (name, Input::Type), that are used for replace of parameters in generic types...
Definition: type_base.hh:85
bool is_finished() const override
Override Type::TypeBase::is_finished.
Definition: type_base.hh:370
bool operator!=(const TypeBase &other) const
Comparison of types.
Definition: type_base.hh:146
FileName()
Forbids default constructor.
Definition: type_base.hh:646
TypeHash generic_type_hash_
hash string of generic type if type is derived, or empty string
Definition: type_base.hh:281
::FilePath::FileType get_file_type() const
Returns type of the file input/output.
Definition: type_base.hh:632
static FileName output()
The factory function for declaring type FileName for input files.
Definition: type_base.hh:607
std::shared_ptr< TypeBase > type_of_values_
Type of Array.
Definition: type_base.hh:334
Actual data of the Array.
Definition: type_base.hh:324
const TypeBase & get_sub_type() const
Getter for the type of array items.
Definition: type_base.hh:374
DECLARE_EXCEPTION(ExcWrongDefault,<< "Default value "<< EI_DefaultStr::qval<< " do not match type: "<< EI_TypeName::qval<< ";\n"<< "During declaration of the key: "<< EI_KeyName::qval)
double lower_bound_
Minimal value of Integer.
Definition: type_base.hh:549
std::string json_string
String stored in JSON format.
Definition: type_base.hh:80
std::ostream & operator<<(std::ostream &stream, const TypeBase &type)
For convenience we provide also redirection operator for output documentation of Input:Type classes...
Definition: type_base.cc:169
bool finished
Flag specified if Array is finished.
Definition: type_base.hh:340
Record type proxy class.
Definition: type_record.hh:171
string class_name() const override
Override Type::TypeBase::class_name.
Definition: type_base.hh:543
string class_name() const override
Override Type::TypeBase::class_name.
Definition: type_base.hh:388
Integer(int lower_bound=std::numeric_limits< int >::min(), int upper_bound=std::numeric_limits< int >::max())
Constructor.
Definition: type_base.hh:469
unsigned int lower_bound_
Minimal size of Array.
Definition: type_base.hh:336
Class for declaration of the input data that are in string format.
Definition: type_base.hh:563
std::size_t TypeHash
Type returned by content_hash methods.
Definition: type_base.hh:77
std::vector< ParameterPair > ParameterVector
Define vector of parameters passed to the overloaded make_instance method.
Definition: type_base.hh:87
Template for classes storing finite set of named values.
FileName(enum::FilePath::FileType type)
Forbids direct construction.
Definition: type_base.hh:649