70 DBG(cerr <<
"Copying structure: " <<
name() << endl);
73 DBG(cerr <<
"Copying field: " << (*i)->name() << endl);
118 delete btp ; btp = 0;
149 j += (*j)->element_count(leaves);
161 linear = linear && dynamic_cast<Structure*>((*i))->
is_linear();
163 linear = linear && (*i)->is_simple_type();
173 (*i)->set_send_p(state);
183 (*i)->set_read_p(state);
198 (*i)->set_in_selection(state);
210 dynamic_cast<Sequence&>(**i).set_leaf_sequence(++level);
212 dynamic_cast<Structure&>(**i).set_leaf_sequence(level);
227 "The BaseType parameter cannot be null.");
236 _vars.push_back(btp);
250 "The BaseType parameter cannot be null.");
264 if ((*i)->name() == n) {
320 sz += (*i)->width(constrained);
323 sz += (*i)->width(constrained);
334 DBG(cerr <<
"Structure::intern_data: " <<
name() << endl);
339 if ((*i)->send_p()) {
340 (*i)->intern_data(eval, dds);
362 if ((*i)->send_p()) {
368 (*i)->serialize(eval, dds, sm,
false);
371 cerr << (*i)->name() <<
": " << sm.
get_checksum() << endl;
373 (*i)->serialize(eval, dds, m,
false);
385 (*i)->deserialize(um, dds, reuse);
421 return m_exact_match(n, s);
423 return m_leaf_match(n, s);
432 BaseType *btp = m_exact_match(name, &s);
436 return m_leaf_match(name, &s);
442 Structure::m_leaf_match(
const string &name, btp_stack *s)
445 if ((*i)->name() ==
name) {
447 DBG(cerr <<
"Pushing " << this->
name() << endl);
448 s->push(static_cast<BaseType *>(
this));
452 if ((*i)->is_constructor_type()) {
453 BaseType *btp = (*i)->var(name,
false, s);
456 DBG(cerr <<
"Pushing " << this->
name() << endl);
457 s->push(static_cast<BaseType *>(
this));
469 Structure::m_exact_match(
const string &name, btp_stack *s)
472 DBG(cerr <<
"Looking at " << (*i)->name() <<
" in: " << *i
474 if ((*i)->name() ==
name) {
475 DBG(cerr <<
"Found " << (*i)->name() <<
" in: "
478 DBG(cerr <<
"Pushing " << this->
name() << endl);
479 s->push(static_cast<BaseType *>(
this));
485 string::size_type dot_pos = name.find(
".");
486 if (dot_pos != string::npos) {
487 string aggregate = name.substr(0, dot_pos);
488 string field = name.substr(dot_pos + 1);
492 DBG(cerr <<
"Descending into " << agg_ptr->name() << endl);
494 DBG(cerr <<
"Pushing " << this->
name() << endl);
495 s->push(static_cast<BaseType *>(
this));
497 return agg_ptr->var(field,
true, s);
512 fprintf(out,
" = ") ;
517 i++, (void)(i !=
_vars.end() && fprintf(out,
", "))) {
518 (*i)->print_val(out,
"",
false);
524 fprintf(out,
";\n") ;
538 i++, (void)(i !=
_vars.end() && out <<
", ")) {
539 (*i)->print_val(out,
"",
false);
562 if (!(*i)->check_semantics(msg,
true)) {
585 << (
void *)
this <<
")" << endl ;
virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true)
Move data to the net.
virtual bool read_p()
Has this variable been read?
abstract base class used to unmarshall/deserialize dap data objects
virtual void intern_data(ConstraintEvaluator &eval, DDS &dds)
Structure & operator=(const Structure &rhs)
virtual void add_var_nocopy(BaseType *bt, Part part=nil)
virtual BaseType * ptr_duplicate()
Part
Names the parts of multi-section constructor data types.
virtual BaseType * var(const string &name, bool exact_match=true, btp_stack *s=0)
Returns a pointer to a member of a constructor class.
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.
std::vector< BaseType * > _vars
std::vector< BaseType * >::iterator Vars_iter
Structure(const string &n)
void _duplicate(const Structure &s)
virtual void add_var(BaseType *bt, Part part=nil)
virtual void reset_checksum()
Holds a structure (aggregate) type.
virtual void set_in_selection(bool state)
virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false)
Receive data from the net.
stack< BaseType * > btp_stack
virtual void set_parent(BaseType *parent)
virtual void set_leaf_sequence(int level=1)
Traverse Structure, set Sequence leaf nodes.
virtual void set_in_selection(bool state)
Set the in_selection property.
A class for software fault reporting.
string dataset() const
Returns the name of the dataset used to create this instance.
bool eval_selection(DDS &dds, const string &dataset)
Evaluate a boolean-valued constraint expression. This is main method for the evaluator ans is called ...
string type_name() const
Returns the type of the class instance as a string.
virtual string get_checksum()
virtual void set_send_p(bool state)
virtual unsigned int width()
Returns the size of the class instance data.
virtual void set_read_p(bool state)
Sets the value of the read_p property.
virtual int element_count(bool leaves=false)
Count the members of constructor types.
virtual unsigned int val2buf(void *val, bool reuse=false)
Never call this.
virtual void dump(ostream &strm) const
dumps information about this object
virtual unsigned int buf2val(void **val)
Never call this.
virtual void del_var(const string &name)
string name() const
Returns the name of the class instance.
std::vector< BaseType * >::const_iterator Vars_citer
virtual BaseType * ptr_duplicate()=0
string www2id(const string &in, const string &escape, const string &except)
BaseType(const string &n, const Type &t)
The BaseType constructor.
Evaluate a constraint expression.
static ostream & LMarg(ostream &strm)
The basic data type for the DODS DAP types.
abstract base class used to marshal/serialize dap data objects
virtual void print_decl(ostream &out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false)
Print an ASCII representation of the variable structure.
virtual bool is_linear()
Check to see whether this variable can be printed simply.
bool unique_names(vector< BaseType * > l, const string &var_name, const string &type_name, string &msg)
virtual void print_val(FILE *out, string space="", bool print_decl_p=true)
Prints the value of the variable.
virtual void set_send_p(bool state)
virtual void dump(ostream &strm) const
dumps information about this object
marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using XDR ...
virtual void set_read_p(bool state)
Sets the value of the read_p property.
virtual bool read()
simple implementation of reat that iterates through vars and calls read on them
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.