27#define _constructor_h 1
44 void m_duplicate(
const Constructor &s);
47 std::vector<BaseType *> d_vars;
49 BaseType *m_leaf_match(
const string &name, btp_stack *s =
nullptr);
50 BaseType *m_exact_match(
const string &name, btp_stack *s =
nullptr);
52 Constructor(
const string &name,
const Type &type,
bool is_dap4 =
false) :
BaseType(name, type, is_dap4) {}
53 Constructor(
const string &name,
const string &
dataset,
const Type &type,
bool is_dap4 =
false)
56 Constructor(
const Constructor ©_from) :
BaseType(copy_from) { m_duplicate(copy_from); }
59 typedef std::vector<BaseType *>::const_iterator Vars_citer;
60 typedef std::vector<BaseType *>::iterator Vars_iter;
61 typedef std::vector<BaseType *>::reverse_iterator Vars_riter;
63 Constructor() =
delete;
65 ~Constructor()
override {
66 for (
auto var : d_vars)
70 Constructor &operator=(
const Constructor &rhs) {
73 BaseType::operator=(rhs);
78 void transform_to_dap4(
D4Group *root, Constructor *dest)
override;
80 std::string FQN()
const override;
82 int element_count(
bool leaves =
false)
override;
84 void set_send_p(
bool state)
override;
87 unsigned int width(
bool constrained =
false)
const override;
88 int64_t
width_ll(
bool constrained =
false)
const override;
91 BaseType *
var(
const string &name,
bool exact_match =
true, btp_stack *s =
nullptr)
override;
95 BaseType *
var(
const string &n, btp_stack &s)
override;
110 const vector<BaseType *> &
variables()
const {
return d_vars; }
117 virtual void del_var(
const string &name);
118 virtual void del_var(Vars_iter i);
120 bool read()
override;
134 unsigned int val2buf(
void *,
bool)
override {
135 throw InternalErr(__FILE__, __LINE__,
"Never use this method; see the programmer's guide documentation.");
137 unsigned int buf2val(
void **)
override {
138 throw InternalErr(__FILE__, __LINE__,
"Never use this method; see the programmer's guide documentation.");
145 void print_decl(ostream &out,
string space =
" ",
bool print_semi =
true,
bool constraint_info =
false,
146 bool constrained =
false)
override;
148 void print_xml(ostream &out,
string space =
" ",
bool constrained =
false)
override;
150 void print_dap4(XMLWriter &xml,
bool constrained =
false)
override;
152 void print_xml_writer(XMLWriter &xml,
bool constrained =
false)
override;
154 void print_decl(FILE *out,
string space =
" ",
bool print_semi =
true,
bool constraint_info =
false,
155 bool constrained =
false)
override;
156 void print_xml(FILE *out,
string space =
" ",
bool constrained =
false)
override;
158 void print_val(FILE *out,
string space =
"",
bool print_decl_p =
true)
override;
159 void print_val(ostream &out,
string space =
"",
bool print_decl_p =
true)
override;
161 bool check_semantics(
string &msg,
bool all =
false)
override;
163 void transfer_attributes(AttrTable *at)
override;
164 static AttrTable *make_dropped_vars_attr_table(vector<BaseType *> *dropped_vars);
166 void dump(ostream &strm)
const override;
Evaluate a constraint expression.
Vars_iter get_vars_iter(int i)
BaseType * var(const string &name, bool exact_match=true, btp_stack *s=nullptr) override
btp_stack no longer needed; use back pointers (BaseType::get_parent())
void set_var_index(BaseType *bt, int i)
Set the ith element of d_vars to a variable object.
void add_var(BaseType *bt, Part part=nil) override
void print_xml(ostream &out, string space=" ", bool constrained=false) override
void set_read_p(bool state) override
Set the 'read_p' property for the Constructor and its members.
bool is_dap4_projected(std::vector< std::string > &inventory) override
bool read() override
Read the elements of Constructor marked for transmission.
void set_in_selection(bool state) override
Set the in_selection property.
void add_var_nocopy(BaseType *bt, Part part=nil) override
const vector< BaseType * > & variables() const
unsigned int width(bool constrained=false) const override
BaseType * get_var_index(int i)
virtual bool is_linear()
Check to see whether this variable can be printed simply.
virtual void del_var(const string &name)
Remove an element from a Constructor.
void dump(ostream &strm) const override
dumps information about this object
int64_t width_ll(bool constrained=false) const override
Get the width of the Constructor's fields.
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiv...
Read data from the stream made by D4StreamMarshaller.
A class for software fault reporting.
abstract base class used to marshal/serialize dap data objects
abstract base class used to unmarshall/deserialize dap data objects
top level DAP object to house generic methods
Type
Identifies the data type.
virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false)
Receive data from the net.
virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true)
Move data to the net, then remove them from the object.
virtual void intern_data(ConstraintEvaluator &eval, DDS &dds)
virtual void compute_checksum(Crc32 &checksum)=0
include the data for this variable in the checksum DAP4 includes a checksum with every data response....
Part
Names the parts of multi-section constructor data types.
virtual string dataset() const
Returns the name of the dataset used to create this instance.
virtual unsigned int val2buf(void *val, bool reuse=false)=0
Loads class data.