69 DBG(cerr <<
"Copying structure: " <<
name() << endl);
72 DBG(cerr <<
"Copying field: " << (*i)->name() << endl);
117 delete btp ; btp = 0;
148 j += (*j)->element_count(leaves);
160 linear = linear && dynamic_cast<Structure*>((*i))->
is_linear();
162 linear = linear && (*i)->is_simple_type();
172 (*i)->set_send_p(state);
182 (*i)->set_read_p(state);
197 (*i)->set_in_selection(state);
209 dynamic_cast<Sequence&>(**i).set_leaf_sequence(++level);
211 dynamic_cast<Structure&>(**i).set_leaf_sequence(level);
226 "The BaseType parameter cannot be null.");
235 _vars.push_back(btp);
245 if ((*i)->name() == n) {
288 DBG(cerr <<
"Structure::intern_data: " <<
name() << endl);
293 if ((*i)->send_p()) {
294 (*i)->intern_data(eval, dds);
316 if ((*i)->send_p()) {
317 (*i)->serialize(eval, dds, m,
false);
328 (*i)->deserialize(um, dds, reuse);
364 return m_exact_match(n, s);
366 return m_leaf_match(n, s);
375 BaseType *btp = m_exact_match(name, &s);
379 return m_leaf_match(name, &s);
388 if ((*i)->name() ==
name) {
390 DBG(cerr <<
"Pushing " << this->
name() << endl);
391 s->push(static_cast<BaseType *>(
this));
395 if ((*i)->is_constructor_type()) {
399 DBG(cerr <<
"Pushing " << this->
name() << endl);
400 s->push(static_cast<BaseType *>(
this));
412 Structure::m_exact_match(
const string &name,
btp_stack *s)
415 DBG(cerr <<
"Looking at " << (*i)->name() <<
" in: " << *i
417 if ((*i)->name() ==
name) {
418 DBG(cerr <<
"Found " << (*i)->name() <<
" in: " 421 DBG(cerr <<
"Pushing " << this->
name() << endl);
422 s->push(static_cast<BaseType *>(
this));
428 string::size_type dot_pos = name.find(
".");
429 if (dot_pos != string::npos) {
430 string aggregate = name.substr(0, dot_pos);
431 string field = name.substr(dot_pos + 1);
435 DBG(cerr <<
"Descending into " << agg_ptr->
name() << endl);
437 DBG(cerr <<
"Pushing " << this->
name() << endl);
438 s->push(static_cast<BaseType *>(
this));
440 return agg_ptr->
var(field,
true, s);
455 fprintf(out,
" = ") ;
460 i++, (void)(i !=
_vars.end() && fprintf(out,
", "))) {
461 (*i)->print_val(out,
"",
false);
467 fprintf(out,
";\n") ;
481 i++, (void)(i !=
_vars.end() && out <<
", ")) {
482 (*i)->print_val(out,
"",
false);
505 if (!(*i)->check_semantics(msg,
true)) {
528 << (
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?
string name() const
Returns the name of the class instance.
abstract base class used to unmarshall/deserialize dap data objects
virtual void intern_data(ConstraintEvaluator &eval, DDS &dds)
Structure & operator=(const Structure &rhs)
virtual BaseType * ptr_duplicate()
Part
Names the parts of multi-section constructor data types.
bool unique_names(vector< BaseType *> l, const string &var_name, const string &type_name, string &msg)
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)
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.
bool eval_selection(DDS &dds, const string &dataset)
Evaluate a boolean-valued constraint expression. This is main method for the evaluator ans is called ...
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 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 unsigned int buf2val(void **val)
Never call this.
virtual void dump(ostream &strm) const
dumps information about this object
virtual void del_var(const string &name)
std::vector< BaseType * >::const_iterator Vars_citer
virtual BaseType * ptr_duplicate()=0
string www2id(const string &in, const string &escape, const string &except)
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.
string type_name() const
Returns the type of the class instance as a string.
virtual bool is_linear()
Check to see whether this variable can be printed simply.
virtual void dump(ostream &strm) const
dumps information about this object
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 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
string dataset() const
Returns the name of the dataset used to create this instance.
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.