46#undef CLEAR_LOCAL_DATA
63 d_starting_row_number = s.d_starting_row_number;
64 d_ending_row_number = s.d_ending_row_number;
65 d_row_stride = s.d_row_stride;
68 for (
const auto &row :
71 auto dest = make_unique<D4SeqRow>();
72 for (
const auto &basetype : *row) {
74 dest->push_back(basetype->ptr_duplicate());
80 d_copy_clauses = s.d_copy_clauses;
115static inline void delete_bt(
BaseType *bt_ptr) {
delete bt_ptr; }
117static inline void delete_rows(
D4SeqRow *bt_row_ptr) {
118 for_each(bt_row_ptr->begin(), bt_row_ptr->end(), delete_bt);
176 else if (filter && d_clauses && d_clauses->value()) {
181 else if (!filter || !d_clauses) {
189 }
while (!eof && !done);
218 DBG(cerr << __PRETTY_FUNCTION__ <<
" BEGIN" << endl);
226 DBG(cerr <<
"read_sequence_values() - Adding row" << endl);
227 auto row = make_unique<D4SeqRow>();
230 DBG(cerr <<
":serialize() - reading data for " << (*i)->type_name() <<
" " << (*i)->name() << endl);
232 DBG(cerr <<
"Reading child sequence values for " << (*i)->name() << endl);
234 d4s->read_sequence_values(filter);
235 d4s->d_copy_clauses =
false;
236 row->push_back(d4s->ptr_duplicate());
237 d4s->d_copy_clauses =
true;
238 row->back()->set_read_p(
true);
241 row->push_back(
var->ptr_duplicate());
245 row->back()->set_read_p(
true);
252 DBG(cerr <<
" read_sequence_values() - Row completed" << endl);
257 DBGN(cerr << __PRETTY_FUNCTION__ <<
" END added " <<
d_values.size() << endl);
280 DBGN(cerr << __PRETTY_FUNCTION__ <<
" BEGIN" << endl);
292 for (
auto &
var : *row) {
293 var->serialize(m, dmr, filter);
297 DBGN(cerr << __PRETTY_FUNCTION__ <<
" END" << endl);
305 for (int64_t i = 0; i <
d_length; ++i) {
306 auto row = make_unique<D4SeqRow>();
308 var->deserialize(um, dmr);
309 row->push_back(
var->ptr_duplicate());
340virtual void set_row_number_constraint(
int start,
int stop,
int stride) {
344 d_starting_row_number = start;
345 d_row_stride = stride;
346 d_ending_row_number = stop;
370 auto elem = find_if(row->begin(), row->end(), [
name](
const BaseType *btp) { return btp->name() == name; });
372 return (elem != row->end()) ? *elem :
nullptr;
385 if (i >= row->size())
393 out <<
"\n" << space << row <<
": ";
408 while (j < elements && !bt_ptr) {
419 while (j < elements) {
443 for (
int i = 0; i < rows; ++i) {
471 strm <<
DapIndent::LMarg <<
"Sequence::dump - (" << (
void *)
this <<
")" << endl;
479 strm <<
DapIndent::LMarg <<
"starting row #: " << d_starting_row_number << endl;
481 strm <<
DapIndent::LMarg <<
"ending row #: " << d_ending_row_number << endl;
#define malformed_expr
(400)
The basic data type for the DODS DAP types.
virtual string type_name() const
Returns the type of the class instance as a string.
virtual string name() const
Returns the name of the class instance.
virtual bool read_p()
Has this variable been read?
virtual Type type() const
Returns the type of the class instance.
virtual void print_val(FILE *out, string space="", bool print_decl_p=true)
Prints the value of the variable.
int element_count(bool leaves=false) override
Count the members of constructor types.
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 print_decl(ostream &out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false) override
Print an ASCII representation of the variable structure.
void set_read_p(bool state) override
Set the 'read_p' property for the Constructor and its members.
std::vector< BaseType * > d_vars
bool read() override
Read the elements of Constructor marked for transmission.
Constructor & operator=(const Constructor &rhs)
Constructor(const string &name, const Type &type, bool is_dap4=false)
void dump(ostream &strm) const override
dumps information about this object
List of DAP4 Filter Clauses.
virtual D4SeqRow * row_value(size_t row)
Get a whole row from the sequence.
virtual bool read_next_instance(bool filter)
Read the next instance of the sequence While the rest of the variables' read() methods are assumed to...
BaseType * ptr_duplicate() override
D4Sequence(const string &n)
The Sequence constructor.
int length() const override
The number of elements in a Sequence object.
virtual void print_one_row(ostream &out, int row, string space, bool print_row_num=false)
D4FilterClauseList & clauses()
Access the filter clauses for this D4Sequence.
virtual void print_val_by_rows(ostream &out, string space="", bool print_decl_p=true, bool print_row_numbers=true)
void set_length(int64_t count) override
bool serialize(ConstraintEvaluator &, DDS &, Marshaller &, bool) override
Move data to the net, then remove them from the object.
void m_duplicate(const D4Sequence &s)
bool deserialize(UnMarshaller &, DDS *, bool) override
Receive data from the net.
void dump(ostream &strm) const override
dumps information about this object
void print_val(ostream &out, string space="", bool print_decl_p=true) override
Prints the value of the variable.
void intern_data() override
Read data into this variable.
void read_sequence_values(bool filter)
Read a Sequence's value into memory.
virtual BaseType * var_value(size_t row, const string &name)
Get the BaseType pointer to the named variable of a given row.
D4Sequence & operator=(const D4Sequence &rhs)
void clear_local_data() override
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiv...
virtual void put_count(int64_t count)
Read data from the stream made by D4StreamMarshaller.
static ostream & LMarg(ostream &strm)
A class for error processing.
top level DAP object to house generic methods
vector< BaseType * > D4SeqRow