Vita
individual.cc
Go to the documentation of this file.
1
13#include "kernel/individual.h"
14
15namespace
16{
17
21static const int print_format_index = std::ios_base::xalloc();
22
26static const int long_form_index = std::ios_base::xalloc();
27
28} // unnamed namespace
29
30namespace vita
31{
32
33// **********************
34// * PRINTING SUBSYSTEM *
35// **********************
36namespace out
37{
42bool long_form_flag(std::ostream &o)
43{
44 return o.iword(long_form_index);
45}
46
52{
53 return static_cast<print_format_t>(o.iword(print_format_index));
54}
55
56std::ostream &operator<<(std::ostream &o, print_format pf)
57{
58 o.iword(print_format_index) = pf.t_;
59 return o;
60}
61
67std::ostream &c_language(std::ostream &o)
68{
69 o.iword(print_format_index) = c_language_f;
70 return o;
71}
72
78std::ostream &cpp_language(std::ostream &o)
79{
80 o.iword(print_format_index) = cpp_language_f;
81 return o;
82}
83
89std::ostream &mql_language(std::ostream &o)
90{
91 o.iword(print_format_index) = mql_language_f;
92 return o;
93}
94
100std::ostream &python_language(std::ostream &o)
101{
102 o.iword(print_format_index) = python_language_f;
103 return o;
104}
105
112std::ostream &dump(std::ostream &o)
113{
114 o.iword(print_format_index) = dump_f;
115 return o;
116}
117
124std::ostream &graphviz(std::ostream &o)
125{
126 o.iword(print_format_index) = graphviz_f;
127 return o;
128}
129
137std::ostream &in_line(std::ostream &o)
138{
139 o.iword(print_format_index) = in_line_f;
140 return o;
141}
142
154std::ostream &list(std::ostream &o)
155{
156 o.iword(print_format_index) = list_f;
157 return o;
158}
159
165std::ostream &tree(std::ostream &o)
166{
167 o.iword(print_format_index) = tree_f;
168 return o;
169}
170
176std::ostream &long_form(std::ostream &o)
177{
178 o.iword(long_form_index) = true;
179 return o;
180}
181
187std::ostream &short_form(std::ostream &o)
188{
189 o.iword(long_form_index) = false;
190 return o;
191}
192
193} // namespace out
194
195} // namespace vita
print_format_t
Rendering format used to print an individual.
Definition: environment.h:37
print_format_t print_format_flag(std::ostream &o)
Definition: individual.cc:51
std::ostream & graphviz(std::ostream &o)
Used to print a graph, in dot language, representing the individual.
Definition: individual.cc:124
std::ostream & python_language(std::ostream &o)
Used to print the content of an individual in python-language format.
Definition: individual.cc:100
std::ostream & cpp_language(std::ostream &o)
Used to print the content of an individual in cpp-language format.
Definition: individual.cc:78
std::ostream & long_form(std::ostream &o)
Enable printing of every detail of the individual.
Definition: individual.cc:176
bool long_form_flag(std::ostream &o)
Definition: individual.cc:42
std::ostream & list(std::ostream &o)
Used to print a human readable representation of the individual.
Definition: individual.cc:154
std::ostream & in_line(std::ostream &o)
Used to print the individual on a single line.
Definition: individual.cc:137
std::ostream & tree(std::ostream &o)
Used to print the individual as a tree structure.
Definition: individual.cc:165
std::ostream & c_language(std::ostream &o)
Used to print the content of an individual in c-language format.
Definition: individual.cc:67
std::ostream & short_form(std::ostream &o)
Hide secondary details of the individual.
Definition: individual.cc:187
std::ostream & dump(std::ostream &o)
Used to print the complete content of an individual.
Definition: individual.cc:112
std::ostream & mql_language(std::ostream &o)
Used to print the content of an individual in MQL-language format.
Definition: individual.cc:89
Contains flags and manipulators to control the output format of individuals.
The main namespace for the project.
std::ostream & operator<<(std::ostream &o, hash_t h)
Mainly useful for debugging / testing.
Definition: cache_hash.cc:56