51#include "D4AttributeType.h"
52#include "D4Attributes.h"
54#include "InternalErr.h"
57#include "dods-datatypes.h"
118class BaseType :
public DapObj {
135 D4Attributes *d_attributes;
143 bool d_is_synthesized;
146 void m_duplicate(
const BaseType &bt);
149 typedef stack<BaseType *> btp_stack;
152 BaseType(
const string &n,
const Type &t,
bool is_dap4 =
false);
153 BaseType(
const string &n,
const string &d,
const Type &t,
bool is_dap4 =
false);
155 BaseType(
const BaseType ©_from);
156 ~BaseType()
override;
158 virtual string toString();
160 virtual void transform_to_dap4(D4Group *root, Constructor *container);
161 virtual std::vector<BaseType *> *transform_to_dap2(AttrTable *parent_attr_table);
163 void dump(ostream &strm)
const override;
165 BaseType &operator=(
const BaseType &rhs);
181 virtual bool is_dap4()
const {
return d_is_dap4; }
182 virtual void set_is_dap4(
const bool v) { d_is_dap4 = v; }
192 virtual string name()
const;
193 virtual void set_name(
const string &n);
194 virtual std::string FQN()
const;
196 virtual Type type()
const;
197 virtual void set_type(
const Type &t);
200 virtual string dataset()
const;
235 virtual bool is_simple_type()
const;
236 virtual bool is_vector_type()
const;
237 virtual bool is_constructor_type()
const;
239 virtual bool synthesized_p();
240 virtual void set_synthesized_p(
bool state);
242 virtual int element_count(
bool leaves =
false);
244 virtual bool read_p();
245 virtual void set_read_p(
bool state);
247 virtual bool send_p();
248 virtual void set_send_p(
bool state);
250 virtual AttrTable &get_attr_table();
251 virtual void set_attr_table(
const AttrTable &at);
254 virtual D4Attributes *attributes();
255 virtual void set_attributes(D4Attributes *);
256 virtual void set_attributes_nocopy(D4Attributes *);
258 virtual bool is_in_selection();
259 virtual void set_in_selection(
bool state);
261 virtual void set_parent(
BaseType *parent);
262 virtual BaseType *get_parent()
const;
266 virtual void transfer_attributes(AttrTable *at);
302 virtual BaseType *
var(
const string &name =
"",
bool exact_match =
true, btp_stack *s =
nullptr);
303 virtual BaseType *
var(
const string &name, btp_stack &s);
306 virtual void add_var_nocopy(
BaseType *bt,
Part part = nil);
310 virtual bool check_semantics(
string &msg,
bool all =
false);
312 virtual bool ops(
BaseType *b,
int op);
313 virtual bool d4_ops(
BaseType *b,
int op);
315 virtual unsigned int width(
bool constrained =
false)
const;
317 virtual int64_t
width_ll(
bool constrained =
false)
const;
319 virtual void print_decl(FILE *out,
string space =
" ",
bool print_semi =
true,
bool constraint_info =
false,
320 bool constrained =
false);
322 virtual void print_xml(FILE *out,
string space =
" ",
bool constrained =
false);
324 virtual void print_decl(ostream &out,
string space =
" ",
bool print_semi =
true,
bool constraint_info =
false,
325 bool constrained =
false);
327 virtual void print_xml(ostream &out,
string space =
" ",
bool constrained =
false);
329 virtual void print_xml_writer(
XMLWriter &xml,
bool constrained =
false);
331 virtual void print_dap4(
XMLWriter &xml,
bool constrained =
false);
386 virtual unsigned int val2buf(
void *val,
bool reuse =
false) = 0;
527 virtual void print_val(FILE *out,
string space =
"",
bool print_decl_p =
true);
543 virtual void print_val(ostream &out,
string space =
"",
bool print_decl_p =
true) = 0;
546 virtual bool is_dap4_projected(std::vector<string> &projected_dap4_inventory);
Evaluate a constraint expression.
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.
libdap base object for common functionality of libdap objects
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
virtual void set_length(int64_t)
Set the number of elements for this variable. use -1 to indicate nothing set.
virtual BaseType * ptr_duplicate()=0
Type
Identifies the data type.
virtual int64_t length_ll() const
Get the number of elements in this variable This version of the function deprecates length() which is...
virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false)
Receive data from the net.
virtual string type_name() const
Returns the type of the class instance as a string.
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=nullptr)
Returns a pointer to a member of a constructor class.
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 int length() const
How many elements are in this variable? Uses -1 in places.
virtual void intern_data(ConstraintEvaluator &eval, DDS &dds)
virtual int64_t width_ll(bool constrained=false) const
Return the number of bytes needed to hold the array data.
virtual unsigned int buf2val(void **val)=0
Reads the class data.
virtual void set_length_ll(int64_t)
Set the number of elements in this variable This version of the function deprecates set_length() whic...
virtual unsigned int width(bool constrained=false) const
Returns the width of the data, in bytes.
virtual void compute_checksum(Crc32 &checksum)=0
include the data for this variable in the checksum DAP4 includes a checksum with every data response....
virtual void print_val(FILE *out, string space="", bool print_decl_p=true)
Prints the value of the variable.
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 void clear_local_data()
The basic data type for the DODS DAP types. */.
virtual unsigned int val2buf(void *val, bool reuse=false)=0
Loads class data.