18 #ifndef TYPE_OUTPUT_HH_
19 #define TYPE_OUTPUT_HH_
31 namespace Input {
namespace Type {
class Parameter; } }
32 namespace Input {
namespace Type {
class Selection; } }
74 virtual ostream&
print(ostream& stream) = 0;
98 void get_array_sizes(
Array array,
unsigned int &lower ,
unsigned int &upper );
100 const string & get_record_description(
const Record *rec);
102 const string & get_abstract_description(
const Abstract *a_rec);
104 void get_integer_bounds(
Integer integer,
int &lower ,
int &upper );
106 void get_double_bounds(
Double dbl,
double &lower ,
double &upper );
108 void get_parent_vec(
Record rec,
std::vector< std::shared_ptr<Abstract> > &parent_vec);
110 void get_array_type(
Array array, std::shared_ptr<TypeBase> &arr_type);
114 const string & get_selection_description(
const Selection *sel);
116 void get_adhoc_parent_name(
const AdHocAbstract *a_rec,
string &parent_name);
124 void print_generic(ostream& stream,
const TypeBase *type);
127 void print_base(ostream& stream,
const TypeBase *type);
131 virtual void print_impl(ostream& stream,
const Record *type) = 0;
133 virtual void print_impl(ostream& stream,
const Array *type) = 0;
135 virtual void print_impl(ostream& stream,
const Abstract *type) = 0;
137 virtual void print_impl(ostream& stream,
const AdHocAbstract *type) = 0;
139 virtual void print_impl(ostream& stream,
const Selection *type) = 0;
141 virtual void print_impl(ostream& stream,
const Integer *type) = 0;
143 virtual void print_impl(ostream& stream,
const Double *type) = 0;
145 virtual void print_impl(ostream& stream,
const Bool *type) = 0;
147 virtual void print_impl(ostream& stream,
const String *type) = 0;
149 virtual void print_impl(ostream& stream,
const FileName *type) = 0;
151 virtual void print_impl(ostream& stream,
const Parameter *type) = 0;
161 void write_description(std::ostream& stream,
const string& str,
unsigned int padding,
unsigned int hash_count = 1);
167 void write_default_value(std::ostream& stream,
Default dft);
169 void clear_processed_types();
176 bool was_written(std::size_t hash);
180 static const unsigned int padding_size = 4;
217 ostream&
print(ostream& stream)
override;
219 void print_impl(ostream& stream,
const Record *type);
220 void print_impl(ostream& stream,
const Array *type);
221 void print_impl(ostream& stream,
const Abstract *type);
223 void print_impl(ostream& stream,
const Selection *type);
224 void print_impl(ostream& stream,
const Integer *type);
225 void print_impl(ostream& stream,
const Double *type);
226 void print_impl(ostream& stream,
const Bool *type);
227 void print_impl(ostream& stream,
const String *type);
228 void print_impl(ostream& stream,
const FileName *type);
229 void print_impl(ostream& stream,
const Parameter *type);
259 ostream&
print(ostream& stream)
override;
264 std::string escape_description(std::string desc);
272 void print_type_header(ostream& stream,
const TypeBase *type);
274 void print_impl(ostream& stream,
const Record *type);
275 void print_impl(ostream& stream,
const Array *type);
276 void print_impl(ostream& stream,
const Abstract *type);
278 void print_impl(ostream& stream,
const Selection *type);
279 void print_impl(ostream& stream,
const Integer *type);
280 void print_impl(ostream& stream,
const Double *type);
281 void print_impl(ostream& stream,
const Bool *type);
282 void print_impl(ostream& stream,
const String *type);
283 void print_impl(ostream& stream,
const FileName *type);
284 void print_impl(ostream& stream,
const Parameter *type);
288 void print_abstract_record_keys(ostream& stream,
const Abstract *type);
291 void print_program_info(ostream& stream);
294 void print_full_hash(ostream& stream);