15 #include "dcParameter.h" 16 #include "dcArrayParameter.h" 17 #include "hashGenerator.h" 19 #include "dcTypedef.h" 29 _has_fixed_byte_size =
false;
30 _has_fixed_structure =
false;
31 _num_nested_fields = -1;
42 _typedef(copy._typedef)
71 as_parameter()
const {
81 as_simple_parameter() {
91 as_simple_parameter()
const {
101 as_class_parameter() {
111 as_class_parameter()
const {
121 as_switch_parameter() {
131 as_switch_parameter()
const {
141 as_array_parameter() {
151 as_array_parameter()
const {
198 output(ostream &out,
bool brief)
const {
203 output_instance(out, brief,
"", name,
"");
212 write(ostream &out,
bool brief,
int indent_level)
const {
227 const string &prename,
const string &name,
228 const string &postname)
const {
229 indent(out, indent_level);
230 output_instance(out, brief, prename, name, postname);
231 output_keywords(out);
233 if (!brief && _number >= 0) {
234 out <<
" // field " << _number;
247 const string &name,
const string &postname)
const {
249 if (!prename.empty() || !name.empty() || !postname.empty()) {
250 out <<
" " << prename << name << postname;
262 const string &prename,
const string &name,
263 const string &postname)
const {
264 indent(out, indent_level)
266 if (!prename.empty() || !name.empty() || !postname.empty()) {
267 out <<
" " << prename << name << postname;
269 output_keywords(out);
271 if (!brief && _number >= 0) {
272 out <<
" // field " << _number;
virtual void generate_hash(HashGenerator &hashgen) const
Accumulates the properties of this type into the hash.
This represents a single typedef declaration in the dc file.
void output_typedef_name(ostream &out, bool brief, const string &prename, const string &name, const string &postname) const
Formats the instance like output_instance, but uses the typedef name instead.
This represents a class (or struct) object used as a parameter itself.
A single field of a Distributed Class, either atomic or molecular.
This is the most fundamental kind of parameter type: a single number or string, one of the DCSubatomi...
void set_typedef(const DCTypedef *dtypedef)
Records the DCTypedef object that generated this parameter.
const string & get_name() const
Returns the name of this field, or empty string if the field is unnamed.
This represents a switch object used as a parameter itself, which packs the appropriate fields of the...
void write_typedef_name(ostream &out, bool brief, int indent_level, const string &prename, const string &name, const string &postname) const
Formats the instance like write_instance, but uses the typedef name instead.
virtual DCParameter * append_array_specification(const DCUnsignedIntRange &size)
Returns the type represented by this_type[size].
Represents the type specification for a single parameter within a field specification.
This represents an array of some other kind of object, meaning this parameter type accepts an arbitra...
int get_num_keywords() const
Returns the number of keywords in the list.
const string & get_name() const
Returns the name of this typedef.
This class generates an arbitrary hash number from a sequence of ints.
virtual void write_instance(ostream &out, bool brief, int indent_level, const string &prename, const string &name, const string &postname) const
Formats the parameter in the C++-like dc syntax as a typename and identifier.
const DCTypedef * get_typedef() const
If this type has been referenced from a typedef, returns the DCTypedef instance, or NULL if the type ...
void generate_hash(HashGenerator &hashgen) const
Accumulates the properties of these keywords into the hash.