In file Structure.h:

class Structure : public BaseType

Holds a structure (aggregate) type.

Inheritance:


Public Methods

Structure(const string &n = "")
The Structure constructor.
Structure(const Structure &rhs)
The Structure copy constructor
virtual unsigned int val2buf(void *val, bool reuse = false)
Returns the size of the structure
virtual unsigned int buf2val(void **val)
Returns the size of the structure
virtual BaseType* var(const string &name, bool exact_match = true)
Returns a pointer to the specified Structure element
virtual void add_var(BaseType *bt, Part p = nil)
Adds an element to a Structure
Pix first_var()
Returns the pseudo-index (Pix) of the first structure element
void next_var(Pix &p)
Increments the input index to point to the next element in the structure
BaseType* var(Pix p)
Returns a pointer to the {\it p}th element
virtual void print_all_vals(ostream& os, XDR *src, DDS *dds, string space = "", bool print_decl_p = true)
Prints the Structure and all elements of any Sequences contained within

Inherited from BaseType:

Public Methods

virtual BaseType* ptr_duplicate()
string name() const
void set_name(const string &n)
Type type() const
void set_type(const Type &t)
string type_name() const
bool is_simple_type()
bool is_vector_type()
bool is_constructor_type()
virtual int element_count(bool leaves = false)
bool synthesized_p()
void set_synthesized_p(bool state)
bool read_p()
virtual void set_read_p(bool state)
bool send_p()
virtual void set_send_p(bool state)
xdrproc_t xdr_coder()
virtual unsigned int width()
virtual bool read(const string &dataset, int &error)
virtual bool serialize(const string &dataset, DDS &dds, XDR *sink, bool ce_eval = true)
virtual bool deserialize(XDR *source, DDS *dds, bool reuse = false)
virtual void print_decl(ostream &os, string space = " ", bool print_semi = true, bool constraint_info = false, bool constrained = false)
virtual void print_val(ostream &os, string space = "", bool print_decl_p = true)
virtual bool check_semantics(string &msg, bool all = false)
virtual bool ops(BaseType *b, int op, const string &dataset)

Documentation

This data type is used to hold a collection of related data types, in a manner roughly corresponding to a C structure. The member types can be simple or compound types, and can include other Structures. The DODS structure is defined as a singly-linked list. This means that Structure elements can be accessed either by name, with the #var()# function, or by their position in the list, either with the overloaded version of #var()#, or the combination of the #first_var()# and #next_var()# functions. The #val2buf()# and #buf2val()# functions only return the size of the structure. To read parts of a DODS Structure into an application program, use the #buf2val()# function of the element of the Structure in question. Note that the predicate-setting functions #set_send_p()# and #set_read_p()# set their flags for the Structure as well as for each of the Structure's member elements. Similar to C, you can refer to members of Structure elements with a ``.'' notation. For example, if the Structure has a member Structure called ``Tom'' and Tom has a member Float32 called ``shoe\_size'', then you can refer to Tom's shoe size as ``Tom.shoe\_size''.
Structure(const string &n = "")
The Structure constructor requires only the name of the variable to be created. The name may be omitted, which will create a nameless variable. This may be adequate for some applications.
Parameters:
n - A string containing the name of the variable to be created.

Structure(const Structure &rhs)
The Structure copy constructor

virtual unsigned int val2buf(void *val, bool reuse = false)
Returns the size of the structure

virtual unsigned int buf2val(void **val)
Returns the size of the structure

virtual BaseType* var(const string &name, bool exact_match = true)
Returns a pointer to the specified Structure element

virtual void add_var(BaseType *bt, Part p = nil)
Adds an element to a Structure

Pix first_var()
Returns the pseudo-index (Pix) of the first structure element

void next_var(Pix &p)
Increments the input index to point to the next element in the structure

BaseType* var(Pix p)
Returns a pointer to the {\it p}th element

virtual void print_all_vals(ostream& os, XDR *src, DDS *dds, string space = "", bool print_decl_p = true)
Prints the Structure and all elements of any Sequences contained within.
See Also:
Sequence::print_all_vals


This class has no child classes.

alphabetic index hierarchy of classes


generated by doc++