|
libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
|
top level DAP object to house generic methods More...
Classes | |
| class | AlarmHandler |
| class | Ancillary |
| class | Array |
| A multidimensional array of identical data types. More... | |
| class | AttrTable |
| Contains the attributes for a dataset. More... | |
| class | BaseTypeFactory |
| class | Byte |
| Holds a single byte. More... | |
| struct | ce_parser_arg |
| class | ChildLocker |
| class | chunked_inbuf |
| class | chunked_istream |
| class | chunked_ostream |
| A C++ stream class for chunked data. This class uses the chunked_outbuf class to provide for chunked binary serialization of data as specified by DAP4. Information to be serialized is broken into 'chunks' that are no more than 2^24 bytes in length. Each chunk is prefixed by a 4 byte header that indicates the type of chunk and size (number of bytes in the chunk body). There are three types of chunk: Data; End; and Error. In normal operation, a DAP4 data document/response is serialized as a sequence of DATA chunks followed by one END chunk (which may be zero bytes in length). If, during serialization, an error is detected, the currently buffered (but not sent) data are discarded and an ERROR chunk is sent with an error message. More... | |
| class | chunked_outbuf |
| output buffer for a chunked stream This performs buffered output encoding the data in the stream using the simple chunking protocol defined for DAP4's binary data transmission. Each block of data is prefixed by four bytes: A CHUNK TYPE byte followed by three bytes that are the CHUNK SIZE. There are three CHUNK TYPES: data, end and error, indicated by the code values 0x00, 0x01 and 0x02. The size of a chunk is limited to 2^24 data bytes + 4 bytes for the chunk header. More... | |
| struct | Clause |
| Holds a fragment of a constraint expression. More... | |
| class | Connect |
| Holds information about the link from a DAP2 client to a dataset. More... | |
| class | ConstraintEvaluator |
| Evaluate a constraint expression. More... | |
| class | Constructor |
| class | D4AsyncUtil |
| class | D4Attribute |
| class | D4Attributes |
| class | D4BaseTypeFactory |
| class | D4CEScanner |
| class | D4Connect |
| class | D4ConstraintEvaluator |
| class | D4Dimension |
| class | D4Dimensions |
| class | D4Enum |
| Holds a DAP4 enumeration. More... | |
| class | D4EnumDef |
| class | D4EnumDefs |
| class | D4FilterClause |
| DAP4 filter clauses. More... | |
| class | D4FilterClauseList |
| List of DAP4 Filter Clauses. More... | |
| class | D4FunctionEvaluator |
| class | D4FunctionScanner |
| class | D4Group |
| class | D4Map |
| class | D4Maps |
| class | D4Opaque |
| class | D4ParserSax2 |
| class | D4RValue |
| class | D4RValueList |
| class | D4StreamMarshaller |
| Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiver-makes-right scheme. This code adds checksums to the stream and uses the xdr library to encode real values if the underlying representation is not IEEE 754. It also supports computing the checksum only. More... | |
| class | D4StreamUnMarshaller |
| Read data from the stream made by D4StreamMarshaller. More... | |
| class | DapIndent |
| class with static methods to help with indentation of debug information. More... | |
| class | DapObj |
| libdap base object for common functionality of libdap objects More... | |
| class | DapXmlNamspaces |
| class | DAS |
| Hold attribute data for a DAP2 dataset. More... | |
| class | DataDDS |
| Holds a DAP2 DDS. More... | |
| class | DDS |
| class | DDXParseFailed |
| class | DDXParser |
| class | DMR |
| class | Error |
| A class for error processing. More... | |
| class | EventHandler |
| class | Float32 |
| Holds a 32-bit floating point value. More... | |
| class | Float64 |
| Holds a 64-bit (double precision) floating point value. More... | |
| class | HTTPCacheInterruptHandler |
| class | HTTPCacheResponse |
| class | HTTPCacheTable |
| class | HTTPConnect |
| class | HTTPResponse |
| class | Int16 |
| Holds a 16-bit signed integer value. More... | |
| class | Int32 |
| Holds a 32-bit signed integer. More... | |
| class | Int64 |
| Holds a64-bit signed integer. More... | |
| class | Int8 |
| Holds an 8-bit signed integer value. More... | |
| class | InternalErr |
| A class for software fault reporting. More... | |
| class | Keywords |
| class | Locker |
| class | Marshaller |
| abstract base class used to marshal/serialize dap data objects More... | |
| class | MarshallerThread |
| struct | parser_arg |
| Pass parameters by reference to a parser. More... | |
| class | PipeResponse |
| Encapsulate a response. This class provides special treatment for 'stream pipes.' It arranges to close them using pclose() instead of fclose(). More... | |
| class | RCReader |
| class | Regex |
| Regular expression matching. More... | |
| class | Resource |
| Associate a rule with an ancillary resource. More... | |
| class | Response |
| class | ResponseTooBigErr |
| class | rvalue |
| class | ServerFunction |
| class | ServerFunctionsList |
| class | SignalHandler |
| class | SignalHandlerRegisteredErr |
| class | StdinResponse |
| Encapsulate a response read from stdin. More... | |
| class | Str |
| Holds character string data. More... | |
| class | Structure |
| Holds a structure (aggregate) type. More... | |
| class | UInt16 |
| Holds an unsigned 16-bit integer. More... | |
| class | UInt32 |
| Holds a 32-bit unsigned integer. More... | |
| class | UInt64 |
| Holds a 64-bit unsigned integer. More... | |
| class | UnMarshaller |
| abstract base class used to unmarshall/deserialize dap data objects More... | |
| class | Url |
| Holds an Internet address (URL). More... | |
| class | XDRFileMarshaller |
| marshaller that knows how to marshall/serialize dap data objects to a file using XDR More... | |
| class | XDRFileUnMarshaller |
| unmarshaller that knows how to unmarshall/deserialize dap objects using XDR from a file More... | |
| class | XDRStreamMarshaller |
| Marshaller that knows how serialize dap data objects to a C++ iostream using XDR. More... | |
| class | XDRStreamUnMarshaller |
| unmarshaller that knows how to unmarshall/deserialize dap objects using XDR from a file More... | |
| class | XDRUtils |
| class | XMLWriter |
Typedefs | |
| typedef vector< BaseType * > | BaseTypeRow |
| typedef std::vector< dods_byte > * | byte_arg_list |
| typedef BaseType *(* | D4Function) (D4RValueList *, DMR &) |
| typedef vector< BaseType * > | D4SeqRow |
| typedef vector< D4SeqRow * > | D4SeqValues |
| typedef uint8_t | dods_byte |
| typedef int64_t | dods_enum |
| typedef float | dods_float32 |
| typedef double | dods_float64 |
| typedef int16_t | dods_int16 |
| typedef int32_t | dods_int32 |
| typedef int64_t | dods_int64 |
| typedef int8_t | dods_int8 |
| typedef uint16_t | dods_uint16 |
| typedef uint32_t | dods_uint32 |
| typedef uint64_t | dods_uint64 |
| typedef int | ErrorCode |
| An enumerated type for common errors. | |
| typedef std::vector< dods_float32 > * | float32_arg_list |
| typedef std::vector< dods_float64 > * | float64_arg_list |
| typedef std::vector< dods_int16 > * | int16_arg_list |
| typedef std::vector< dods_int32 > * | int32_arg_list |
| typedef std::vector< rvalue * > | rvalue_list |
| typedef std::vector< rvalue * >::const_iterator | rvalue_list_citer |
| typedef std::vector< rvalue * >::iterator | rvalue_list_iter |
| typedef vector< BaseTypeRow * > | SequenceValues |
| typedef void | Sigfunc(int) |
| typedef std::vector< dods_uint16 > * | uint16_arg_list |
| typedef std::vector< dods_uint32 > * | uint32_arg_list |
Enumerations | |
| enum | AttrType { Attr_unknown , Attr_container , Attr_byte , Attr_int16 , Attr_uint16 , Attr_int32 , Attr_uint32 , Attr_float32 , Attr_float64 , Attr_string , Attr_url , Attr_other_xml , Attr_int8 , Attr_uint8 , Attr_int64 , Attr_uint64 , Attr_enum , Attr_opaque } |
| enum | CacheDisconnectedMode { DISCONNECT_NONE = 0 , DISCONNECT_NORMAL = 1 , DISCONNECT_EXTERNAL = 2 } |
| enum | DAPVersion { DAP_2_0 , DAP_3_2 , DAP_4_0 } |
| enum | EncodingType { unknown_enc , deflate , x_plain , gzip , binary } |
| The type of encoding used on the current stream. More... | |
| enum | ObjectType { unknown_type , dods_das , dods_dds , dods_data , dods_ddx , dods_data_ddx , dods_error , web_error , dap4_dmr , dap4_data , dap4_error } |
| The type of object in the stream coming from the data server. More... | |
| enum | Part { nil , array , maps } |
| Names the parts of multi-section constructor data types. More... | |
| enum | RejectReasonCode { TIME , UNAVAILABLE , PRIVILEGES , OTHER } |
| enum | Response { Unknown_Response , DAS_Response , DDS_Response , DataDDS_Response , DDX_Response , DataDDX_Response , BLOB_Response , Version_Response } |
| Common functions for DODS server filter programs. More... | |
| enum | Type { dods_null_c , dods_byte_c , dods_int16_c , dods_uint16_c , dods_int32_c , dods_uint32_c , dods_float32_c , dods_float64_c , dods_str_c , dods_url_c , dods_structure_c , dods_array_c , dods_sequence_c , dods_grid_c , dods_char_c , dods_int8_c , dods_uint8_c , dods_int64_c , dods_uint64_c , dods_enum_c , dods_opaque_c , dods_group_c } |
| Identifies the data type. More... | |
Functions | |||||
| string | add_space_encoding (const string &s) | ||||
| virtual void | add_var (BaseType *bt, Part part=nil) | ||||
| virtual void | add_var_nocopy (BaseType *bt, Part part=nil) | ||||
| void | append_long_to_string (long val, int base, string &str_val) | ||||
| rvalue_list * | append_rvalue_list (rvalue_list *rvals, rvalue *rv) | ||||
| virtual D4Attributes * | attributes () | ||||
| string | AttrType_to_String (const AttrType at) | ||||
| int64_t | buf2val_ll (void **val) | ||||
| BaseType ** | build_btp_args (const rvalue_list *args, DDS &dds) | ||||
| string | char2ASCII (string s, const string escape="%[0-7][0-9a-fA-F]") | ||||
| int | check_byte (const char *val) | ||||
| Is the value a valid byte? | |||||
| int | check_float32 (const char *val) | ||||
| int | check_float64 (const char *val) | ||||
| int | check_float64 (const char *val, double &v) | ||||
| int | check_int16 (const char *val) | ||||
| int | check_int32 (const char *val) | ||||
| int | check_int32 (const char *val, int &v) | ||||
| int | check_int64 (const char *val) | ||||
| virtual bool | check_semantics (string &msg, bool all=false) | ||||
| int | check_uint16 (const char *val) | ||||
| int | check_uint32 (const char *val) | ||||
| int | check_uint32 (const char *val, unsigned int &v) | ||||
| int | check_uint64 (const char *val) | ||||
| int | check_url (const char *val) | ||||
| Is the value a valid URL? | |||||
| D4FilterClauseList & | clauses () | ||||
| Access the filter clauses for this D4Sequence. | |||||
| virtual void | clear_local_data () | ||||
| The basic data type for the DODS DAP types. */. | |||||
| void | close_temp (FILE *s, const string &name) | ||||
| template<class T1, class T2> | |||||
| bool | Cmp (int op, T1 v1, T2 v2) | ||||
| string | D2type_name (Type t) | ||||
| Returns the type of the class instance as a string. Supports all DAP2 types and not the DAP4-only types. Also returns Url (DAP2) and not "URL" (DAP4) for the URL type. | |||||
| virtual bool | d4_ops (BaseType *b, int op) | ||||
| string | D4AttributeTypeToString (D4AttributeType at) | ||||
| D4RValue * | D4RValueFactory (std::string cpps) | ||||
| Build an appropriate RValue. | |||||
| string | D4type_name (Type t) | ||||
| Returns the type of the class instance as a string. Supports all DAP4 types and not the DAP2-only types. Also returns URL (DAP4) and not "Url" (DAP2) for the URL type. | |||||
| virtual string | dataset () const | ||||
| Returns the name of the dataset used to create this instance. | |||||
| virtual void | dataset_constraint (DDS &dds, ConstraintEvaluator &eval, FILE *out, bool ce_eval=true) const | ||||
| virtual void | dataset_constraint (DDS &dds, ConstraintEvaluator &eval, ostream &out, bool ce_eval=true) const | ||||
| virtual void | dataset_constraint_ddx (DDS &dds, ConstraintEvaluator &eval, ostream &out, const string &boundary, const string &start, bool ce_eval=true) const | ||||
| string | date_time_str (time_t *calendar, bool local) | ||||
| bool | dir_exists (const string &dir) | ||||
| DODSFilter () | |||||
| DODSFilter (int argc, char *argv[]) | |||||
| DODSFilter constructor. | |||||
| bool | double_eq (double lhs, double rhs, double epsilon=1.0e-5) | ||||
| void | downcase (string &s) | ||||
| void | dump (ostream &strm) const override | ||||
| virtual int | element_count (bool leaves=false) | ||||
| string | esc2underscore (string s) | ||||
| string | escape_double_quotes (string source) | ||||
| string | escattr (string s) | ||||
| string | escattr_xml (string s) | ||||
| virtual void | establish_timeout (FILE *stream) const | ||||
| virtual void | establish_timeout (ostream &stream) const | ||||
| double * | extract_double_array (Array *a) | ||||
| void | extract_double_array (Array *a, vector< double > &dest) | ||||
| double | extract_double_value (BaseType *arg) | ||||
| string | extract_string_argument (BaseType *arg) | ||||
| void | fillConstructorAttrTable (AttrTable *at, BaseType *bt) | ||||
| Recursive helper function for Building DAS entries for Constructor types. | |||||
| virtual std::string | FQN () const | ||||
| virtual void | functional_constraint (BaseType &var, DDS &dds, ConstraintEvaluator &eval, FILE *out) const | ||||
| virtual void | functional_constraint (BaseType &var, DDS &dds, ConstraintEvaluator &eval, ostream &out) const | ||||
| virtual string | get_action () const | ||||
| virtual BaseType * | get_ancestor () | ||||
| virtual AttrTable & | get_attr_table () | ||||
| char * | get_buf () | ||||
| Holds a one-dimensional collection of DAP2 data types. | |||||
| virtual string | get_cache_dir () const | ||||
| Get the cache directory. | |||||
| virtual string | get_ce () const | ||||
| Get the constraint expression. | |||||
| virtual string | get_cgi_version () const | ||||
| vector< BaseType * > & | get_compound_buf () | ||||
| AttrType | get_dap2_AttrType (D4AttributeType d4_type) | ||||
| virtual time_t | get_das_last_modified_time (const string &anc_location="") const | ||||
| virtual time_t | get_data_last_modified_time (const string &anc_location="") const | ||||
| virtual time_t | get_dataset_last_modified_time () const | ||||
| virtual string | get_dataset_name () const | ||||
| virtual string | get_dataset_version () const | ||||
| Get the version information for the dataset. | |||||
| virtual time_t | get_dds_last_modified_time (const string &anc_location="") const | ||||
| string | get_dims_decl (Array &a) | ||||
| double | get_float64 (const char *val) | ||||
| int | get_hash (const string &url) | ||||
| int | get_int32 (const char *val) | ||||
| long long | get_int64 (const char *val) | ||||
| virtual BaseType * | get_parent () const | ||||
| virtual time_t | get_request_if_modified_since () const | ||||
| virtual Response | get_response () const | ||||
| vector< string > & | get_str () | ||||
| string | get_temp_file (FILE *&stream) | ||||
| int | get_timeout () const | ||||
| Type | get_type (const char *name) | ||||
| unsigned int | get_uint32 (const char *val) | ||||
| unsigned long long | get_uint64 (const char *val) | ||||
| virtual string | get_URL () const | ||||
| Get the dataset name. | |||||
| virtual unsigned int | get_value_capacity () const | ||||
| virtual uint64_t | get_value_capacity_ll () const | ||||
| bool | has_dap2_attributes (AttrTable &a) | ||||
| bool | has_dap2_attributes (BaseType *btp) | ||||
| string | hexstring (unsigned char val) | ||||
| string | id2www (string in, const string &allowable) | ||||
| string | id2www_ce (string in, const string &allowable) | ||||
| string | id2xml (string in, const string ¬_allowed) | ||||
| void | initialize () | ||||
| void | initialize (int argc, char *argv[]) | ||||
| virtual bool | is_conditional () const | ||||
| Is this request conditional? | |||||
| virtual bool | is_constructor_type () const | ||||
| Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable. | |||||
| bool | is_constructor_type (Type t) | ||||
| Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable. | |||||
| virtual bool | is_dap4 () const | ||||
| bool | is_host_big_endian () | ||||
| Does this host use big-endian byte order? | |||||
| virtual bool | is_in_selection () | ||||
| Is this variable part of the current selection? | |||||
| bool | is_integer_type (Type t) | ||||
| bool | is_keyword (string id, const string &keyword) | ||||
| bool | is_quoted (const string &s) | ||||
| virtual bool | is_simple_type () const | ||||
| Returns true if the instance is a numeric, string or URL type variable. | |||||
| bool | is_simple_type (Type t) | ||||
| Returns true if the instance is a numeric, string or URL type variable. | |||||
| virtual bool | is_vector_type () const | ||||
| Returns true if the instance is a vector (i.e., array) type variable. | |||||
| bool | is_vector_type (Type t) | ||||
| Returns true if the instance is a vector (i.e., array) type variable. | |||||
| virtual int | length () const | ||||
| How many elements are in this variable? Uses -1 in places. | |||||
| virtual int64_t | length_ll () const | ||||
| Get the number of elements in this variable This version of the function deprecates length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that a Vector/Array holds no values yet (as opposed to zero values). For types not derived from Vector, there is always one element. | |||||
| const char * | libdap_name () | ||||
| const char * | libdap_root () | ||||
| const char * | libdap_version () | ||||
| string | long_to_string (long val, int base) | ||||
| rvalue_list * | make_rvalue_list (rvalue *rv) | ||||
| string | munge_error_message (string msg) | ||||
| virtual string | name () const | ||||
| string | octal_to_hex (const string &octal_digits) | ||||
| string | octstring (unsigned char val) | ||||
| virtual bool | ops (BaseType *b, int op) | ||||
| void | parse_error (const char *msg, const int line_num, const char *context) | ||||
| virtual void | print_dap4 (XMLWriter &xml, bool constrained=false) | ||||
| virtual void | print_decl (FILE *out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false) | ||||
| virtual void | print_decl (ostream &out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false) | ||||
| virtual void | print_one_row (ostream &out, int row, string space, bool print_row_num=false) | ||||
| virtual void | print_usage () const | ||||
| Print usage information for a filter program. | |||||
| virtual void | print_val_by_rows (ostream &out, string space="", bool print_decl_p=true, bool print_row_numbers=true) | ||||
| void | print_var_das (ostream &out, BaseType *bt, string indent="") | ||||
| virtual void | print_xml (FILE *out, string space=" ", bool constrained=false) | ||||
| virtual void | print_xml (ostream &out, string space=" ", bool constrained=false) | ||||
| virtual void | print_xml_writer (XMLWriter &xml, bool constrained=false) | ||||
| virtual int | process_options (int argc, char *argv[]) | ||||
| virtual BaseType * | prototype () const | ||||
| string | prune_spaces (const string &name) | ||||
| virtual BaseType * | ptr_duplicate ()=0 | ||||
| virtual bool | read () | ||||
| 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 return the entire variable in one call (modulo enhancements of the library to support streaming large variables), this class assumes that the underlying data store is returning data from a table of unknown size. Thus, D4Sequence::read() is assumed to return one instance (or element or row) of the sequence per call and return true when the EOF (end of the sequence) is reached. | |||||
| virtual bool | read_p () | ||||
| Has this variable been read? | |||||
| string | remove_quotes (const string &s) | ||||
| string | remove_space_encoding (const string &s) | ||||
| virtual void | reserve_value_capacity () | ||||
| virtual void | reserve_value_capacity (unsigned int numElements) | ||||
| virtual void | reserve_value_capacity_ll () | ||||
| virtual void | reserve_value_capacity_ll (uint64_t numElements) | ||||
| virtual void | reserve_value_capacity_ll_byte (uint64_t numBytes) | ||||
| virtual D4SeqRow * | row_value (size_t row) | ||||
| Get a whole row from the sequence. | |||||
| void | save_str (std::string &dst, const char *src, const int) | ||||
| Save a string to a temporary variable during the parse. | |||||
| virtual void | send_das (DAS &das, const string &anc_location="", bool with_mime_headers=true) const | ||||
| virtual void | send_das (FILE *out, DAS &das, const string &anc_location="", bool with_mime_headers=true) const | ||||
| Transmit a DAS. | |||||
| virtual void | send_das (ostream &out, DAS &das, const string &anc_location="", bool with_mime_headers=true) const | ||||
| Transmit a DAS. | |||||
| virtual void | send_data (DDS &dds, ConstraintEvaluator &eval, FILE *data_stream, const string &anc_location="", bool with_mime_headers=true) const | ||||
| Transmit a DDS. | |||||
| virtual void | send_data (DDS &dds, ConstraintEvaluator &eval, ostream &data_stream, const string &anc_location="", bool with_mime_headers=true) const | ||||
| Transmit data. | |||||
| virtual void | send_data_ddx (DDS &dds, ConstraintEvaluator &eval, ostream &data_stream, const string &start, const string &boundary, const string &anc_location="", bool with_mime_headers=true) const | ||||
| Transmit data. | |||||
| virtual void | send_dds (DDS &dds, ConstraintEvaluator &eval, bool constrained=false, const string &anc_location="", bool with_mime_headers=true) const | ||||
| virtual void | send_dds (FILE *out, DDS &dds, ConstraintEvaluator &eval, bool constrained=false, const string &anc_location="", bool with_mime_headers=true) const | ||||
| virtual void | send_dds (ostream &out, DDS &dds, ConstraintEvaluator &eval, bool constrained=false, const string &anc_location="", bool with_mime_headers=true) const | ||||
| virtual void | send_ddx (DDS &dds, ConstraintEvaluator &eval, FILE *out, bool with_mime_headers=true) const | ||||
| virtual void | send_ddx (DDS &dds, ConstraintEvaluator &eval, ostream &out, bool with_mime_headers=true) const | ||||
| virtual bool | send_p () | ||||
| Should this variable be sent? | |||||
| virtual void | send_version_info () const | ||||
| Send version information back to the client program. | |||||
| void | set_array_using_double (Array *dest, double *src, int src_len) | ||||
| virtual void | set_attr_table (const AttrTable &at) | ||||
| virtual void | set_ce (string _ce) | ||||
| virtual void | set_cgi_version (string version) | ||||
| virtual void | set_dataset_name (const string _dataset) | ||||
| virtual void | set_in_selection (bool state) | ||||
| virtual void | set_is_dap4 (const bool v) | ||||
| virtual void | set_length (int64_t) | ||||
| Set the number of elements for this variable. use -1 to indicate nothing set. | |||||
| virtual void | set_length_ll (int64_t) | ||||
| Set the number of elements in this variable This version of the function deprecates set_length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that the Vector/Array holds no values. | |||||
| virtual void | set_name (const string &n) | ||||
| virtual void | set_parent (BaseType *parent) | ||||
| virtual BaseType * | set_prototype (BaseType *btp) | ||||
| Change the Vector/Array element type. | |||||
| virtual void | set_read_p (bool state) | ||||
| virtual void | set_response (const string &r) | ||||
| virtual void | set_send_p (bool state) | ||||
| virtual void | set_synthesized_p (bool state) | ||||
| void | set_timeout (int timeout=0) | ||||
| virtual void | set_type (const Type &t) | ||||
| virtual void | set_URL (const string &url) | ||||
| virtual void | set_value (D4SeqValues &values) | ||||
| Set the internal value. The 'values' of a D4Sequence is a vector of vectors of BaseType* objects. Using this method does not perform a deep copy; the BaseType*s are copied so the caller should not free them. Note that this does set d_length but the read_p flag for the BaseTypes should all be set to keep the serializer from trying to read each of them. | |||||
| virtual bool | set_value (dods_byte *val, int sz) | ||||
| virtual bool | set_value (dods_float32 *val, int sz) | ||||
| virtual bool | set_value (dods_float64 *val, int sz) | ||||
| virtual bool | set_value (dods_int16 *val, int sz) | ||||
| virtual bool | set_value (dods_int32 *val, int sz) | ||||
| virtual bool | set_value (dods_int64 *val, int sz) | ||||
| virtual bool | set_value (dods_int8 *val, int sz) | ||||
| virtual bool | set_value (dods_uint16 *val, int sz) | ||||
| virtual bool | set_value (dods_uint32 *val, int sz) | ||||
| virtual bool | set_value (dods_uint64 *val, int sz) | ||||
| virtual bool | set_value (string *val, int sz) | ||||
| virtual bool | set_value (vector< dods_byte > &val, int sz) | ||||
| virtual bool | set_value (vector< dods_float32 > &val, int sz) | ||||
| virtual bool | set_value (vector< dods_float64 > &val, int sz) | ||||
| virtual bool | set_value (vector< dods_int16 > &val, int sz) | ||||
| virtual bool | set_value (vector< dods_int32 > &val, int sz) | ||||
| virtual bool | set_value (vector< dods_int64 > &val, int sz) | ||||
| virtual bool | set_value (vector< dods_int8 > &val, int sz) | ||||
| virtual bool | set_value (vector< dods_uint16 > &val, int sz) | ||||
| virtual bool | set_value (vector< dods_uint32 > &val, int sz) | ||||
| virtual bool | set_value (vector< dods_uint64 > &val, int sz) | ||||
| virtual bool | set_value (vector< string > &val, int sz) | ||||
| void | set_value_capacity (uint64_t l) | ||||
| virtual bool | set_value_ll (dods_byte *val, int64_t sz) | ||||
| virtual bool | set_value_ll (dods_float32 *val, int64_t sz) | ||||
| virtual bool | set_value_ll (dods_float64 *val, int64_t sz) | ||||
| virtual bool | set_value_ll (dods_int16 *val, int64_t sz) | ||||
| virtual bool | set_value_ll (dods_int32 *val, int64_t sz) | ||||
| virtual bool | set_value_ll (dods_int64 *val, int64_t sz) | ||||
| virtual bool | set_value_ll (dods_int8 *val, int64_t sz) | ||||
| virtual bool | set_value_ll (dods_uint16 *val, int64_t sz) | ||||
| virtual bool | set_value_ll (dods_uint32 *val, int64_t sz) | ||||
| virtual bool | set_value_ll (dods_uint64 *val, int64_t sz) | ||||
| virtual bool | set_value_ll (string *val, int64_t sz) | ||||
| virtual bool | set_value_ll (vector< dods_byte > &val, int64_t sz) | ||||
| virtual bool | set_value_ll (vector< dods_float32 > &val, int64_t sz) | ||||
| virtual bool | set_value_ll (vector< dods_float64 > &val, int64_t sz) | ||||
| virtual bool | set_value_ll (vector< dods_int16 > &val, int64_t sz) | ||||
| virtual bool | set_value_ll (vector< dods_int32 > &val, int64_t sz) | ||||
| virtual bool | set_value_ll (vector< dods_int64 > &val, int64_t sz) | ||||
| virtual bool | set_value_ll (vector< dods_int8 > &val, int64_t sz) | ||||
| virtual bool | set_value_ll (vector< dods_uint16 > &val, int64_t sz) | ||||
| virtual bool | set_value_ll (vector< dods_uint32 > &val, int64_t sz) | ||||
| virtual bool | set_value_ll (vector< dods_uint64 > &val, int64_t sz) | ||||
| virtual bool | set_value_ll (vector< string > &val, int64_t sz) | ||||
| virtual uint64_t | set_value_slice_from_row_major_vector (const Vector &rowMajorData, uint64_t startElement) | ||||
| void | set_vec (unsigned int i, BaseType *val) | ||||
| Sets element i to value val. | |||||
| void | set_vec_ll (uint64_t i, BaseType *val) | ||||
| void | set_vec_nocopy (unsigned int i, BaseType *val) | ||||
| Sets element i to value val. Set the ith element to val. Extend the vector if needed. | |||||
| void | set_vec_nocopy_ll (uint64_t i, BaseType *val) | ||||
| template<class T1, class T2> | |||||
| bool | StrCmp (int op, T1 v1, T2 v2) | ||||
| AttrType | String_to_AttrType (const string &s) | ||||
| D4AttributeType | StringToD4AttributeType (string s) | ||||
| virtual bool | synthesized_p () | ||||
| string | systime () | ||||
| virtual void | transfer_attributes (AttrTable *at) | ||||
| virtual Type | type () const | ||||
| virtual string | type_name () const | ||||
| Returns the type of the class instance as a string. | |||||
| string | type_name (Type t) | ||||
| string | unescape_double_quotes (string source) | ||||
| string | unescattr (string s) | ||||
| string | unhexstring (string s) | ||||
| bool | unique_names (vector< BaseType * > l, const string &var_name, const string &type_name, string &msg) | ||||
| string | unoctstring (string s) | ||||
| int64_t | val2buf_ll (void *val, bool reuse=false) | ||||
| virtual D4SeqValues | value () const | ||||
| Get the values for this D4Sequence This method returns a reference to the values held by the instance. You should make sure that the instance really holds values before calling it! Do not free the BaseType*s contained in the vector of vectors. | |||||
| virtual void | value (dods_byte *b) const | ||||
| virtual void | value (dods_float32 *b) const | ||||
| virtual void | value (dods_float64 *b) const | ||||
| virtual void | value (dods_int16 *b) const | ||||
| virtual void | value (dods_int32 *b) const | ||||
| virtual void | value (dods_int64 *b) const | ||||
| virtual void | value (dods_int8 *b) const | ||||
| virtual void | value (dods_uint16 *b) const | ||||
| virtual void | value (dods_uint32 *b) const | ||||
| virtual void | value (dods_uint64 *b) const | ||||
| virtual void | value (vector< string > &b) const | ||||
| virtual void | value (vector< unsigned int > *index, vector< string > &b) const | ||||
| virtual void | value (vector< unsigned int > *indices, dods_byte *b) const | ||||
| virtual void | value (vector< unsigned int > *indices, dods_float32 *b) const | ||||
| virtual void | value (vector< unsigned int > *indices, dods_float64 *b) const | ||||
| virtual void | value (vector< unsigned int > *indices, dods_int16 *b) const | ||||
| virtual void | value (vector< unsigned int > *indices, dods_int32 *b) const | ||||
| virtual void | value (vector< unsigned int > *indices, dods_int64 *b) const | ||||
| virtual void | value (vector< unsigned int > *indices, dods_int8 *b) const | ||||
| virtual void | value (vector< unsigned int > *indices, dods_uint16 *b) const | ||||
| virtual void | value (vector< unsigned int > *indices, dods_uint32 *b) const | ||||
| virtual void | value (vector< unsigned int > *indices, dods_uint64 *b) const | ||||
| virtual void | value_ll (vector< uint64_t > *index, vector< string > &b) const | ||||
| virtual void | value_ll (vector< uint64_t > *indices, dods_byte *b) const | ||||
| virtual void | value_ll (vector< uint64_t > *indices, dods_float32 *b) const | ||||
| virtual void | value_ll (vector< uint64_t > *indices, dods_float64 *b) const | ||||
| virtual void | value_ll (vector< uint64_t > *indices, dods_int16 *b) const | ||||
| virtual void | value_ll (vector< uint64_t > *indices, dods_int32 *b) const | ||||
| virtual void | value_ll (vector< uint64_t > *indices, dods_int64 *b) const | ||||
| virtual void | value_ll (vector< uint64_t > *indices, dods_int8 *b) const | ||||
| virtual void | value_ll (vector< uint64_t > *indices, dods_uint16 *b) const | ||||
| virtual void | value_ll (vector< uint64_t > *indices, dods_uint32 *b) const | ||||
| virtual void | value_ll (vector< uint64_t > *indices, dods_uint64 *b) const | ||||
| virtual D4SeqValues & | value_ref () | ||||
| Get the sequence values by reference This method returns a reference to the D4Sequence's values, eliminating the copy of all the pointers. For large sequences, that could be a substantial number of values (even though they are 'just' pointers). | |||||
| virtual BaseType * | var (const string &name, btp_stack &s) | ||||
| 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 BaseType * | var (unsigned int i) | ||||
| virtual BaseType * | var_ll (uint64_t i) | ||||
| virtual BaseType * | var_value (size_t row, const string &name) | ||||
| Get the BaseType pointer to the named variable of a given row. | |||||
| virtual BaseType * | var_value (size_t row, size_t i) | ||||
| Get the BaseType pointer to the $i^{th}$ variable of row. | |||||
| void | vec_resize (int l) | ||||
| void | vec_resize_ll (int64_t l) | ||||
| virtual unsigned int | width (bool constrained=false) const override | ||||
| Returns the width of the data, in bytes. | |||||
| virtual int64_t | width_ll (bool constrained=false) const override | ||||
| Return the number of bytes needed to hold the array data. | |||||
| string | www2id (const string &in, const string &escape, const string &except) | ||||
| string | xml2id (string in) | ||||
| virtual void | set_attributes (D4Attributes *) | ||||
| virtual void | set_attributes_nocopy (D4Attributes *) | ||||
Abstract Methods | |||||
| virtual unsigned int | buf2val (void **val)=0 | ||||
| Reads the class data. | |||||
| virtual unsigned int | val2buf (void *val, bool reuse=false)=0 | ||||
| Loads class data. | |||||
| virtual void | intern_data (ConstraintEvaluator &eval, DDS &dds) | ||||
| 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 void | compute_checksum (Crc32 &checksum)=0 | ||||
| include the data for this variable in the checksum DAP4 includes a checksum with every data response. This method adds the variable's data to that checksum. | |||||
| virtual void | intern_data () | ||||
| virtual void | serialize (D4StreamMarshaller &m, DMR &dmr, bool filter=false) | ||||
| The DAP4 serialization method. Serialize a variable's values for DAP4. This does not write the DMR persistent representation but does write that part of the binary data blob that holds a variable's data. Once a variable's data are serialized, that memory is reclaimed (by calling BaseType::clear_local_data()). | |||||
| virtual bool | deserialize (UnMarshaller &um, DDS *dds, bool reuse=false) | ||||
| Receive data from the net. | |||||
| virtual void | deserialize (D4StreamUnMarshaller &um, DMR &dmr) | ||||
| virtual void | print_val (FILE *out, string space="", bool print_decl_p=true) | ||||
| Prints the value of the variable. | |||||
| virtual void | print_val (ostream &out, string space="", bool print_decl_p=true)=0 | ||||
| Prints the value of the variable. | |||||
| virtual bool | is_dap4_projected (std::vector< string > &projected_dap4_inventory) | ||||
Accessors and Mutators for various properties. | |||||
| bool | is_hop_by_hop_header (const string &header) | ||||
Cache Index | |||||
These methods manage the cache's index file. Each cache holds an index file named | |||||
MIME Utilities | |||||
A collection of useful functions for writing MIME headers for OPeNDAP servers. The CGI utilities include a variety of functions useful to programmers developing OPeNDAP CGI filter programs. However, before jumping in and using these, look at the class ResponseBuilder. Always choose to use that class over these functions if you can. Many of these functions were used by the CGI programs that made up the first DAP server; all of those are deprecated and the ResponseBuilder class should be used instead. Some of the other functions are used by ResponseBuilder and the client-side parsing code that needs to identify MIME headers, boundaries, etc.
| |||||
| time_t | last_modified_time (const string &name) | ||||
| string | rfc822_date (const time_t t) | ||||
| bool | do_version (const string &script_ver, const string &dataset_ver) | ||||
| Send a version number. | |||||
| void | ErrMsgT (const string &Msgt) | ||||
| Logs an error message. | |||||
| string | name_path (const string &path) | ||||
| Returns the filename portion of a pathname. | |||||
| ObjectType | get_type (const string &value) | ||||
| ObjectType | get_description_type (const string &value) | ||||
| string | get_next_mime_header (FILE *in) | ||||
| string | get_next_mime_header (istream &in) | ||||
| void | parse_mime_header (const string &header, string &name, string &value) | ||||
| bool | is_boundary (const char *line, const string &boundary) | ||||
| string | read_multipart_boundary (FILE *in, const string &boundary) | ||||
| string | read_multipart_boundary (istream &in, const string &boundary) | ||||
| void | read_multipart_headers (FILE *in, const string &content_type, const ObjectType object_type, const string &cid) | ||||
| void | read_multipart_headers (istream &in, const string &content_type, const ObjectType object_type, const string &cid) | ||||
| string | cid_to_header_value (const string &cid) | ||||
| void | remove_mime_header (istream &in) | ||||
| Send a `Not Modified' response. | |||||
| bool | remove_mime_header (FILE *in) | ||||
MIME utility functions | |||||
These functions are used to create the MIME headers for a message from a server to a client. They are public but should not be called directly unless absolutely necessary. Use DODSFilter instead. NB: These functions actually write both the response status line and the header.
| |||||
| void | set_mime_text (FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) | ||||
| void | set_mime_text (ostream &strm, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) | ||||
| void | set_mime_text (ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol) | ||||
| void | set_mime_html (FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) | ||||
| void | set_mime_html (ostream &strm, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) | ||||
| void | set_mime_html (ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol) | ||||
| void | set_mime_binary (FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) | ||||
| void | set_mime_binary (ostream &strm, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) | ||||
| void | set_mime_binary (ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol) | ||||
| void | set_mime_multipart (ostream &strm, const string &boundary, const string &start, ObjectType type, const string &version, EncodingType enc, const time_t last_modified) | ||||
| void | set_mime_multipart (ostream &strm, const string &boundary, const string &start, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol, const string &url) | ||||
| void | set_mime_ddx_boundary (ostream &strm, const string &boundary, const string &cid, ObjectType type, EncodingType enc) | ||||
| void | set_mime_data_boundary (ostream &strm, const string &boundary, const string &cid, ObjectType type, EncodingType enc) | ||||
| void | set_mime_error (FILE *out, int code, const string &reason, const string &version) | ||||
| void | set_mime_error (ostream &strm, int code, const string &reason, const string &version) | ||||
| void | set_mime_not_modified (FILE *out) | ||||
| void | set_mime_not_modified (std::ostream &out) | ||||
parse_error | |||||
Generate error messages for the various parsers. parser_error() generates error messages for the various parsers used by libdap. There are two versions of the function, one which takes a const char *message and a const int line_num and writes the message and line number too stderr and a second which takes an additional parser_arg arg parameter and writes the error message into an Error object which is returned to the caller via the arg parameter.
| |||||
| void | parse_error (parser_arg *arg, const char *msg, const int line_num, const char *context) | ||||
| void | parse_error (const string &msg, const int line_num, const char *context) | ||||
Double to string conversion functions | |||||
Jose Garcia /** Conversions from double to a character representation which gets appended to a string. This function depends on the standard routine sprintf to convert a double to a textual representation which gets appended to the string 'str'.
| |||||
| void | append_double_to_string (const double &num, string &str) | ||||
| string | double_to_string (const double &num) | ||||
| string | path_to_filename (string path) | ||||
| int | glob (const char *c, const char *s) | ||||
| time_t | parse_time (const char *str, bool expand) | ||||
Security functions | |||||
| bool | size_ok (unsigned int sz, unsigned int nelem) | ||||
| sanitize the size of an array. Test for integer overflow when dynamically allocating an array. | |||||
| bool | pathname_ok (const string &path, bool strict) | ||||
| Does the string name a potentially valid pathname? Test the given pathname to verify that it is a valid name. We define this as: Contains only printable characters; and Is less then 256 characters. If strict is true, test that the pathname consists of only letters, digits, and underscore, dash and dot characters instead of the more general case where a pathname can be composed of any printable characters. | |||||
| string | dap_version () | ||||
| string | open_temp_fstream (ofstream &f, const string &name_template, const string &suffix) | ||||
Variables | |
| const string | c_dap40_namespace = "http://xml.opendap.org/ns/DAP/4.0#" |
| string | d_action |
| time_t | d_anc_das_lmt |
| time_t | d_anc_dds_lmt |
| string | d_anc_dir |
| string | d_anc_file |
| bool | d_bad_options |
| string | d_cache_dir |
| string | d_cgi_ver |
| bool | d_comp |
| bool | d_conditional_request |
| string | d_dap2ce |
| string | d_dataset |
| time_t | d_if_modified_since |
| string | d_program_name |
| Response | d_response |
| int | d_timeout |
| string | d_url |
| int | dods_keep_temps = 0 |
| const int | DODS_MAX_ARRAY = DODS_INT_MAX |
| const size_t | line_length = 1024 |
| const unsigned int | max_str_len = DODS_USHRT_MAX - 1 |
| const unsigned int | max_url_len = 255 |
| const string | usage |
| int | www_trace = 0 |
| int | www_trace_extensive = 0 |
get information using an iterator | |
| const string | double_quote = "\"" |
top level DAP object to house generic methods
Define this symbol iff we decide to include information about the byte order of the response (as sent from the server) so that the client can determine the correct CRC32 hash code. jhrg 1/4/16
| typedef vector< BaseType * > libdap::BaseTypeRow |
The type BaseTypeRow is used to store single rows of values in an instance of Sequence. Values are stored in instances of BaseType.
Definition at line 49 of file D4Sequence.h.
| typedef BaseType *(* libdap::D4Function) (D4RValueList *, DMR &) |
Definition at line 41 of file D4Function.h.
| typedef vector<BaseType *> libdap::D4SeqRow |
The type BaseTypeRow is used to store single rows of values in an instance of D4Sequence. Values are stored in instances of BaseType.
Definition at line 42 of file D4Sequence.h.
| typedef vector<D4SeqRow *> libdap::D4SeqValues |
This type holds all of the values of a D4Sequence.
Definition at line 45 of file D4Sequence.h.
| typedef uint8_t libdap::dods_byte |
Definition at line 20 of file dods-datatypes-static.h.
| typedef int64_t libdap::dods_enum |
Definition at line 33 of file dods-datatypes-static.h.
| typedef float libdap::dods_float32 |
Definition at line 24 of file dods-datatypes-static.h.
| typedef double libdap::dods_float64 |
Definition at line 22 of file dods-datatypes-static.h.
| typedef int16_t libdap::dods_int16 |
Definition at line 16 of file dods-datatypes-static.h.
| typedef int32_t libdap::dods_int32 |
Definition at line 12 of file dods-datatypes-static.h.
| typedef int64_t libdap::dods_int64 |
Definition at line 29 of file dods-datatypes-static.h.
| typedef int8_t libdap::dods_int8 |
Definition at line 27 of file dods-datatypes-static.h.
| typedef uint16_t libdap::dods_uint16 |
Definition at line 18 of file dods-datatypes-static.h.
| typedef uint32_t libdap::dods_uint32 |
Definition at line 14 of file dods-datatypes-static.h.
| typedef uint64_t libdap::dods_uint64 |
Definition at line 31 of file dods-datatypes-static.h.
| typedef int libdap::ErrorCode |
| typedef std::vector<rvalue*>::const_iterator libdap::rvalue_list_citer |
| typedef std::vector<rvalue*>::iterator libdap::rvalue_list_iter |
| typedef vector< BaseTypeRow * > libdap::SequenceValues |
This type holds all of the values of a Sequence.
Definition at line 52 of file D4Sequence.h.
| typedef void libdap::Sigfunc(int) |
Definition at line 37 of file SignalHandler.h.
| enum libdap::AttrType |
AttrType identifies the data types which may appear in an attribute table object.
Definition at line 78 of file AttrTable.h.
Disconnected Operation
The cache can be set to handle disconnected operation where it does not use the network to validate entries and does not attempt to load new documents. All requests that cannot be fulfilled by the cache will be returned with a "504 Gateway Timeout" response. There are two operational disconnected modes:
No network activity at all: Here it uses its own persistent cache to answer the request, if possible.
Forward all disconnected requests to a proxy cache: Here it uses the HTTP/1.1 cache-control header to indicate that the proxy should operate in disconnected mode.
Definition at line 46 of file HTTPCacheDisconnectedMode.h.
| enum libdap::DAPVersion |
Definition at line 32 of file DapXmlNamespaces.h.
| enum libdap::EncodingType |
The type of encoding used on the current stream.
libdap understands two types of encoding: x-plain and deflate, which correspond to plain uncompressed data and data compressed with zlib's LZW algorithm respectively.
enum EncodingType {
unknown_enc,
deflate,
x_plain,
gzip,
binary
};
Definition at line 47 of file EncodingType.h.
| enum libdap::ObjectType |
The type of object in the stream coming from the data server.
When a version 2.x or greater DAP data server sends an object, it may use the Content-Description header of the response to indicate the type of object contained in the response.
enum ObjectType { unknown_type, dods_das, dods_dds, dods_data, dods_ddx, dods_data_ddx, dods_error, web_error, dap4_dmr, dap4_data, dap4_error, };
Definition at line 57 of file ObjectType.h.
| enum libdap::Part |
| enum libdap::RejectReasonCode |
Definition at line 15 of file D4AsyncUtil.h.
| enum libdap::Response |
Common functions for DODS server filter programs.
When a DODS server receives a request from a DODS client, the server CGI script dispatches the request to one of several ``filter'' programs. Each filter is responsible for returning a different aspect of the dataset information: one is for data, one is for the dataset DDS, one is for the dataset DAS, and a fourth is for a usage message describing the server itself. Some installations may have additional optional filters.
The filter program receives a data request from the dispatch script. It receives its operating parameters from the command line, like any UNIX command, and it returns its output to standard output, which the httpd server packages up into a reply to the client.
This class contains some common functions for the filter programs used to make up the DODS data servers. The filter programs do not have to be called by a CGI program, but that is the normal mechanism by which they are invoked.
Add a test to make sure that the required arguments are given.
We need to rethink the ancillary file/directory stuff. I don't think it's ever been used...
class DODSFilter { public: /** Types of responses DODSFilter know about.
Definition at line 80 of file DODSFilter.h.
| enum libdap::Type |
Identifies the data type.
Type identifies the data type stored in a particular type class. All the DODS Data Access Protocol (DAP) types inherit from the BaseType class.
Add %20 space encoding.
Definition at line 76 of file AttrTable.cc.
| void libdap::append_double_to_string | ( | const double & | num, |
| string & | str ) |
| void libdap::append_long_to_string | ( | long | val, |
| int | base, | ||
| string & | str_val ) |
| rvalue_list * libdap::append_rvalue_list | ( | rvalue_list * | rvals, |
| rvalue * | rv ) |
Convert an AttrType to it's string representation.
| at | The Attribute Type. |
Definition at line 93 of file AttrTable.cc.
|
overridepure virtual |
Reads the class data.
Reads the class data into the memory referenced by val. The caller should either allocate enough storage to val to hold the class data or set *val to null. If *val is NULL, memory will be allocated by this function with new(). If the memory is allocated this way, the caller is responsible for deallocating that memory. Array and values for simple types are stored as C would store an array.
| val | A pointer to a pointer to the memory into which the class data will be copied. If the value pointed to is NULL, memory will be allocated to hold the data, and the pointer value modified accordingly. The calling program is responsible for deallocating the memory references by this pointer. |
Build an argument list suitable for calling a btp_func, bool_func, and so on. Since this takes an rvalue_list and not an rvalue, it is a function rather than a class member.
This function performs a common task but does not fit within the RValue class well. It is used by Clause and ce_expr.y.
| args | A list of RValue objects |
| dds | Use this DDS when evaluating functions |
| std::string libdap::cid_to_header_value | ( | const string & | cid | ) |
Given a Content-Id read from the DDX, return the value to look for in a MPM Content-Id header. This function downcases the CID to match the value returned by parse_mime_header.
| cid | The Content-Id read from the DDX |
| Error | if the CID does not start with the string "cid:" |
Definition at line 1008 of file mime_util.cc.
| D4FilterClauseList & libdap::D4Sequence::clauses | ( | ) |
Access the filter clauses for this D4Sequence.
When a filter is supplied with a DAP4 constraint, the expression is parsed and one or more D4FilterClause objects are built and stored in a D4FilterClauseList bound to the D4Sequence to be filtered.
Definition at line 328 of file D4Sequence.cc.
|
overridevirtual |
The basic data type for the DODS DAP types. */.
This defines the basic data type features for the DODS data access protocol (DAP) data types. All the DAP type classes (Float64, Array, etc.) subclass it. This class is an abstract one; no variables will ever be stored as BaseType instances, only as instances of its child classes.
These classes and their methods give a user the capacity to set up sophisticated data types. They do not provide sophisticated ways to access and use this data. On the server side, in many cases, the class instances will have no data in them at all until the serialize function is called to send data to the client. On the client side, most DAP application programs will unpack the data promptly into whatever local data structure the programmer deems the most useful.
In order to use these classes on the server side of a DAP client/server connection, you must write a read method for each of the data types you expect to encounter in the application. This function, whose purpose is to read data from a local source into the class instance data buffer, is called in serialize, when the data is about to be sent to the client. The read function may be called earlier, in the case of data subset requests (constraint expressions) whose evaluation requires it. (For example, the constraint expression ``a,b&b>c'' requires that c be read even though it will not be sent.)
For some data types, the read function must be aware of the constraints to be returned. These cautions are outlined where they occur.
class BaseType : public DapObj { private: string d_name; // name of the instance Type d_type; // instance's type string d_dataset; // name of the dataset used to create this BaseType
bool d_is_read; // true if the value has been read bool d_is_send; // Is the variable in the projection?
d_parent points to the Constructor or Vector which holds a particular variable. It is null for simple variables. The Vector and Constructor classes must maintain this variable. BaseType *d_parent;
Attributes for this variable. Added 05/20/03 jhrg AttrTable d_attr;
D4Attributes *d_attributes;
bool d_is_dap4; // True if this is a DAP4 variable, false ... DAP2
These are non-empty only for DAP4 variables. Added 9/27/12 jhrg
These were/are used for DAP2 CEs, but not for DAP4 ones bool d_in_selection; // Is the variable in the selection? bool d_is_synthesized; // true if the variable is synthesized
protected: void m_duplicate(const BaseType &bt);
public: typedef stack<BaseType *> btp_stack;
These ctors assume is_dap4 is false BaseType(const string &n, const Type &t, bool is_dap4 = false); BaseType(const string &n, const string &d, const Type &t, bool is_dap4 = false);
BaseType(const BaseType ©_from); ~BaseType() override;
virtual string toString();
virtual void transform_to_dap4(D4Group *root, Constructor *container); virtual std::vector<BaseType *> *transform_to_dap2(AttrTable *parent_attr_table);
void dump(ostream &strm) const override;
BaseType &operator=(const BaseType &rhs);
/** Remove any read or set data in the private data of the variable, setting read_p() to false. Used to clear any dynamically allocated storage that holds (potentially large) data. For the simple types, this no-op version is all that's needed. Vector and some other classes define a special version and have serialize() implementations that call it to free data as soon as possible after sending it.
Definition at line 179 of file BaseType.h.
| void libdap::close_temp | ( | FILE * | s, |
| const string & | name ) |
close temporary files - used here and in ~HTTPResponse
| s | |
| name |
Definition at line 760 of file HTTPConnect.cc.
| bool libdap::Cmp | ( | int | op, |
| T1 | v1, | ||
| T2 | v2 ) |
Compare two numerical types, both of which are either signed or unsigned. This class is one implementation of the comparison policy used by rops.
Definition at line 52 of file Operators.h.
|
overridepure virtual |
include the data for this variable in the checksum DAP4 includes a checksum with every data response. This method adds the variable's data to that checksum.
| checksum | A Crc32 instance that holds the current checksum. |
| string libdap::D4AttributeTypeToString | ( | D4AttributeType | at | ) |
Convert an AttrType to it's string representation.
| at | The Attribute Type. |
Definition at line 45 of file D4Attributes.cc.
| D4RValue * libdap::D4RValueFactory | ( | std::string | cpps | ) |
Build an appropriate RValue.
Look at the value in the string parameter and build an appropriate BaseType, use that as a constant and build an RValue. This can be used by the DAP4 parser directly to build the constants in filter clauses.
| cpps | The string argument read by the parser. |
Definition at line 197 of file D4RValue.cc.
| string libdap::dap_version | ( | ) |
|
virtual |
Returns the name of the dataset used to create this instance.
A dataset from which the data is to be read. The meaning of this string will vary among different types of data sources. It may be the name of a data file or an identifier used to read data from a relational database.
Definition at line 326 of file BaseType.cc.
| std::string libdap::date_time_str | ( | time_t * | calendar, |
| bool | local ) |
Given a time in seconds since midnight 1 Jan 1970, return the RFC 1123 date string. Example result string: Sun, 06 Nov 1994 08:49:37 GMT
| calendar | Time in seconds |
| local | If true, return the local time, if false return GMT. The default value is false. |
Definition at line 260 of file util_mit.cc.
|
overridevirtual |
|
overridevirtual |
Receive data from the net.
Receives data from the network connection identified by the source parameter. The data is put into the class data buffer according to the input dds.
This function is only used on the client side of the DODS client/server connection.
| um | An UnMarshaller that knows how to deserialize data types |
| dds | The Data Descriptor Structure object corresponding to this dataset. See The DODS User Manual for information about this structure. This would have been received from the server in an earlier transmission. |
| reuse | A boolean value, indicating whether the class internal data storage can be reused or not. If this argument is TRUE, the class buffer is assumed to be large enough to hold the incoming data, and it is not reallocated. If FALSE, new storage is allocated. If the internal buffer has not been allocated at all, this argument has no effect. |
| Error | when a problem reading from the UnMarshaller is found. |
Definition at line 206 of file D4Sequence.h.
| bool libdap::dir_exists | ( | const string & | dir | ) |
Send a version number.
This sends a formatted block of text to the client, containing version information about various aspects of the server. The arguments allow you to enclose version information about the filter program and the dataset in the message. Either argument (or both) may be omitted, in which case no script or dataset version information will be printed.
| script_ver | The version of the filter script executing this function. |
| dataset_ver | The version of the dataset. |
Definition at line 178 of file mime_util.cc.
| libdap::DODSFilter | ( | ) |
Make an empty instance. Use the set_*() methods to load with needed values. You must call at least set_dataset_name() or be requesting version information.
Definition at line 127 of file DODSFilter.h.
| libdap::DODSFilter::DODSFilter | ( | int | argc, |
| char * | argv[] ) |
DODSFilter constructor.
Create an instance of DODSFilter using the command line arguments passed by the CGI (or other) program. The default constructor is private; this and the copy constructor (which is just the default copy constructor) are the only way to create an instance of DODSFilter.
These are the valid options:
The name of the file on which the filter is to operate. Usually this would be the file whose data has been requested. In fact, this class can be specialized and any meaning can be associated to this string. It could be the name of a database, for example.
Specifies the type of response desired. The response is a string and must be one of DAS, DDS, DataDDS or Version. Note that Version returns version information in the body of the response and is useful for debugging, et cetera. Each response returns version information in an HTTP header for internal use by a client.
Send compressed data. Data are compressed using the deflate program.
This option specifies a non-blank constraint expression used to subsample a dataset.
Set the CGI/Server version to cgi-version. This is a way for the caller to set version information passed back to the client either as the response to a version request of in the response headers.
Specifies that ancillary data be sought in the ancdir directory. ancdir must end in '/'.
Specifies that ancillary data may be found in a file called ancfile.
Specify a directory to use if/when files are to be cached. Not all handlers support caching and each uses its own rules tailored to a specific file or data type.
Specifies a a timeout value in seconds. If the server runs longer than timeout seconds, an Error is returned to the client explaining that the request has timed out.
Indicates that the request is a conditional request; send a complete response if and only if the data has changed since time. If it has not changed since time, then send a 304 (Not Modified) response. The time parameter is the Last-Modified time from an If-Modified-Since condition GET request. It is given in seconds since the start of the Unix epoch (Midnight, 1 Jan 1970).
Definition at line 168 of file DODSFilter.cc.
|
inline |
| void libdap::downcase | ( | string & | s | ) |
| void libdap::ErrMsgT | ( | const string & | Msgt | ) |
Logs an error message.
Prints an error message in the httpd system log file, along with a time stamp and the client host name (or address).
Use this instead of the functions in liberrmsg.a in the programs run by the CGIs to report errors so those errors show up in HTTPD's log files.
Definition at line 209 of file mime_util.cc.
Rip through a string and replace all the double quotes with " sequences.
| source |
Definition at line 466 of file escaping.cc.
Return a string that has all the %<hex digit><hex digit> sequences replaced with underscores (`_').
| s | The string to transform |
return s; }
/** Escape non-printable characters and quotes from an HDF attribute.
| s | The attribute to modify. |
Definition at line 342 of file escaping.cc.
Escape non-printable characters and quotes from an HDF attribute.
| s | The attribute to modify. |
Definition at line 375 of file escaping.cc.
|
virtual |
Use values of this instance to establish a timeout alarm for the server. If the timeout value is zero, do nothing.
Definition at line 544 of file DODSFilter.cc.
|
virtual |
Definition at line 555 of file DODSFilter.cc.
| double * libdap::extract_double_array | ( | Array * | a | ) |
Given a pointer to an Array which holds a numeric type, extract the values and return in an array of doubles. This function allocates the array using 'new double[n]' so delete[] MUST be used when you are done the data.
| a | Extract value from this Array. |
Given a pointer to an Array which holds a numeric type, extract the values and return in an array of doubles. This function allocates the array using 'new double[n]' so delete[] MUST be used when you are done the data.
| a | Extract value from this Array. |
| dest | Put the values in this vector. A value-result parameter. |
| double libdap::extract_double_value | ( | BaseType * | arg | ) |
Recursive helper function for Building DAS entries for Constructor types.
| at | Add Constructor content to this Attribute table |
| bt | A pointer to a BaseType which may be an instance of Constructor. |
|
virtual |
Get the string name of the response to be returned.
Definition at line 417 of file DODSFilter.cc.
|
virtual |
Definition at line 638 of file BaseType.cc.
| char * libdap::get_buf | ( | ) |
Holds a one-dimensional collection of DAP2 data types.
Holds a one-dimensional array of DAP2 data types. This class takes two forms, depending on whether the elements of the vector are themselves simple or compound objects. This class contains common functionality for the List and Array classes, and should rarely be used directly.
When each element of the class is a simple data type, the Vector is implemented as a simple array of C types, rather than as an array of BaseType data types. A single private ``template'' BaseType instance (_var) is used to hold information in common to all the members of the array. The template is also used as a container to pass values back and forth to an application program, as in var().
If the elements of the vector are themselves compound data types, the array is stored as a vector of BaseType pointers (see the libdap class BaseTypePtrVec). The template is still used to hold information in common to all the members of the array, but is not used to pass information to and from the application program.
int d_length = -1; // number of elements in the vector BaseType *d_proto = nullptr; // element prototype for the Vector
_buf was a pointer to void; delete[] complained. 6/4/2001 jhrg char *d_buf = nullptr; // storage for cardinal data vector<string> d_str; // special storage for strings. jhrg 2/11/05 vector<BaseType *> d_compound_buf; // storage for data in compound types (e.g., Structure)
the number of elements we have allocated memory to store. This should be either the sizeof(buf)/width(bool constrained = false) for cardinal data or the capacity of d_str for strings or capacity of _vec. unsigned int d_capacity = 0; uint64_t d_capacity_ll = 0;
bool d_too_big_for_dap2 = false; /// Conditionally set to true in set_length_ll()
friend class MarshallerTest;
Made these template methods private because they can't be overridden anyways (because c++...) - ndp 08/14/2015 template <typename T> void value_worker(T *v) const; template <typename T> void value_ll_worker(T *v) const; template <typename T> void value_worker(vector<unsigned int> *indices, T *b) const; template <typename T> void value_ll_worker(vector<uint64_t> *indices, T *b) const;
template <typename T> bool set_value_worker(T *v, int sz); template <typename T> bool set_value_ll_worker(T *v, int64_t sz); template <typename T> bool set_value_worker(vector<T> &v, int sz); template <typename T> bool set_value_ll_worker(vector<T> &v, int64_t sz);
bool m_is_cardinal_type() const; int64_t m_create_cardinal_data_buffer_for_type(int64_t num_elements); void m_delete_cardinal_data_buffer(); template <class CardType> void m_set_cardinal_values_internal(const CardType *fromArray, int64_t num_elements);
This function copies the private members of Vector. void m_duplicate(const Vector &v);
public: Vector(const string &n, BaseType *v, const Type &t, bool is_dap4 = false); Vector(const string &n, const string &d, BaseType *v, const Type &t, bool is_dap4 = false); Vector(const Vector &rhs);
virtual ~Vector();
Vector &operator=(const Vector &rhs); FIXME BaseType *ptr_duplicate() = 0 override;
/** Provide access to internal data. Callers cannot delete this but can pass them to other methods.
|
virtual |
Get the cache directory.
The cache_dir is used to hold the cached .dds and .das files. By default, this returns an empty string (store cache files in current directory.
Definition at line 522 of file DODSFilter.cc.
|
virtual |
Get the constraint expression.
Return the entire constraint expression in a string. This includes both the projection and selection clauses, but not the question mark.
Definition at line 345 of file DODSFilter.cc.
|
virtual |
Set the CGI/Server version number. Servers use this when answering requests for version information. The version `number' should include both the name of the server (e.g., ff_dods) as well as the version number. Since this information is typically divined by configure, it's up to the executable to poke the correct value in using this method.
Note that the -v switch that this class understands is deprecated since it is usually called by Perl code. It makes more sense to have the actual C++ software set the version string.
| version | A version string for this server. */ void DODSFilter::set_cgi_version(string version) { d_cgi_ver = version; } |
/** Return the version information passed to the instance when it was created. This string is passed to the DODSFilter ctor using the -v option.
Definition at line 337 of file DODSFilter.cc.
| AttrType libdap::get_dap2_AttrType | ( | D4AttributeType | d4_type | ) |
Definition at line 265 of file D4Attributes.cc.
|
virtual |
Get the dataset's last modified time. This returns the time at which the dataset was last modified as defined by UNIX's notion of modification. This does not take into account the modification of an ancillary DAS or DDS. Time is given in seconds since the epoch (1 Jan 1970 00:00:00 GMT).
This method perform a simple check on the file named by the dataset given when the DODSFilter instance was created. If the dataset is not a filter, this method returns the current time. Servers which provide access to non-file-based data should subclass DODSFilter and supply a more suitable version of this method.
From the stat(2) man page: ``Traditionally, st_mtime is changed by mknod(2), utime(2), and write(2). The st_mtime is not changed for changes in owner, group, hard link count, or mode.''
/** Get the last modified time for the dataset's DAS. This time, given in seconds since the epoch (1 Jan 1970 00:00:00 GMT), is the greater of the datasets's and any ancillary DAS' last modified time.
| anc_location | A directory to search for ancillary files (in addition to the CWD). |
Definition at line 450 of file DODSFilter.cc.
|
virtual |
Get the last modified time to be used for a particular data request. This method should look at both the constraint expression and any ancillary files for this dataset. The implementation provided here returns the latest time returned by the get_dataset...(), get_das...() and get_dds...() methods and does not currently check the CE.
| anc_location | A directory to search for ancillary files (in addition to the CWD). |
Definition at line 490 of file DODSFilter.cc.
|
virtual |
Get the version information for the dataset.
To read version information that is specific to a certain dataset, override this method with an implementation that does what you want. By default, this returns an empty string.
Definition at line 382 of file DODSFilter.cc.
|
virtual |
Get the last modified time for the dataset's DDS. This time, given in seconds since the epoch (1 Jan 1970 00:00:00 GMT), is the greater of the datasets's and any ancillary DDS' last modified time.
Definition at line 467 of file DODSFilter.cc.
| ObjectType libdap::get_description_type | ( | const string & | value | ) |
This function returns the ObjectType value that matches the given string. Modified to include tests for the descriptions that use hyphens in addition to underscores. 8/1/08 jhrg
| value | Value from the HTTP response header |
Definition at line 309 of file mime_util.cc.
| int libdap::get_hash | ( | const string & | url | ) |
Compute the hash value for a URL.
| url |
Definition at line 98 of file HTTPCacheTable.cc.
| std::string libdap::get_next_mime_header | ( | FILE * | in | ) |
Read the next MIME header from the input stream and return it in a string object. This function consumes any leading whitespace before the next header. It returns an empty string when the blank line that separates the headers from the body is found. This function works for header and separator lines that use either a CRLF pair (the correct line ending) or just a newline (a common error).
| in | Read from this stream (FILE *) |
| Error | is thrown if no header or separator is found. |
Definition at line 777 of file mime_util.cc.
| std::string libdap::get_next_mime_header | ( | istream & | in | ) |
This function and its companion read the next MIME header from an input stream (or FILE*) and return it as a string. The stream pointer is updated to the next line of input. It returns an empty string when the blank line ending the MIME headers is found.
| in | Read the next header from the input stream |
Definition at line 808 of file mime_util.cc.
|
virtual |
Get the value of a conditional request's If-Modified-Since header. This value is used to determine if the request should get a full response or a Not Modified (304) response. The time is given in seconds since the Unix epoch (midnight, 1 Jan 1970). If no time was given with the request, this methods returns -1.
Definition at line 514 of file DODSFilter.cc.
|
virtual |
Get the enum name of the response to be returned.
Definition at line 414 of file DODSFilter.cc.
| string libdap::get_temp_file | ( | FILE *& | stream | ) |
Open a temporary file and return its name. This method opens a temporary file using get_tempfile_template(). The FILE* stream is opened for both reads and writes; if it already exists (highly unlikely), it is truncated. If used on Unix, it's the callers responsibility to unlink the named file so that when all descriptors to it are closed, it will be deleted. On Win32 platforms, this method pushes the name of the temporary file onto a vector which is used during object destruction to delete all the temporary files.
A private method.
| stream | A value-result parameter; the open file descriptor is returned via this parameter. |
| InternalErr | thrown if the FILE* could not be opened. |
Definition at line 723 of file HTTPConnect.cc.
| Type libdap::get_type | ( | const char * | name | ) |
| ObjectType libdap::get_type | ( | const string & | value | ) |
This function returns the ObjectType value that matches the given string. Modified to include tests for the descriptions that use hyphens in addition to underscores. 8/1/08 jhrg
Definition at line 300 of file mime_util.cc.
|
virtual |
Get the dataset name.
The ``dataset name'' is the filename or other string that the filter program will use to access the data. In some cases this will indicate a disk file containing the data. In others, it may represent a database query or some other exotic data access method.
void DODSFilter::set_dataset_name(const string ds) { d_dataset = www2id(ds, "%", "%20"); }
/** Get the URL. This returns the URL, minus the constraint originally sent to the server.
Definition at line 364 of file DODSFilter.cc.
|
virtual |
Return the capacity of the Vector in terms of number of elements of its data type that it can currently hold (i.e. not bytes). For example, this could be the size of the _buf array in bytes / sizeof(T) for the cardinal types T, or the capacity of the d_str vector if T is string or url type.
| int libdap::glob | ( | const char * | c, |
| const char * | s ) |
glob: match a string against a simple pattern
Understands the following patterns:
| c | The pattern |
| s | The string |
| bool libdap::has_dap2_attributes | ( | AttrTable & | a | ) |
| bool libdap::has_dap2_attributes | ( | BaseType * | btp | ) |
| string libdap::hexstring | ( | unsigned char | val | ) |
Definition at line 81 of file escaping.cc.
Replace characters that are not allowed in DAP2 identifiers.
-In the DAP itself, id2www() is called in:
-In the client code:
| in | Replace characters in this string. |
| allowable | The set of characters that are allowed in a URI. default: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+_/.\\*" |
Definition at line 143 of file escaping.cc.
Replace characters that are not allowed in WWW URLs using rules specific to Constraint Expressions. This has changed over time and now the only difference is that '*' is escaped by this function while it is not escaped by id2www().
| in | The string in which to replace characters. |
| allowable | The set of characters that are allowed in a URI. default: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+_/.\\" |
Definition at line 166 of file escaping.cc.
Replace characters that are not allowed in XML
| in | The string in which to replace characters. |
| not_allowed | The set of characters that are not allowed in XML. default: ><&'(single quote)"(double quote) |
Definition at line 253 of file escaping.cc.
|
protected |
Called when initializing a DODSFilter that's not going to be passed a command line arguments.
Definition at line 188 of file DODSFilter.cc.
|
protected |
Initialize. Specializations can call this once an empty DODSFilter has been created using the default constructor. Using a method such as this provides a way to specialize the process_options() method and then have that specialization called by the subclass' constructor.
This class and any class that specializes it should call this method in its constructor. Note that when this method is called, the object is not fully constructed.
| argc | The argument count |
| argv | The vector of char * argument strings. |
Definition at line 228 of file DODSFilter.cc.
|
overridevirtual |
Similar to using serialize() and deserialize() together in one object. Data are read as for serialize and those values are stored in the objects as deserialize() does but does not write and then read data to/from a stream.
This method is defined by the various data type classes. It calls the read() abstract method. Unlike serialize(), this method does not clear the memory use to hold the data values, so the caller should make sure to delete the DDS or the variable as soon as possible.
| eval | Use this as the constraint expression evaluator. |
| dds | The Data Descriptor Structure object corresponding to this dataset. See The DODS User Manual for information about this structure. |
Definition at line 200 of file D4Sequence.h.
| bool libdap::is_boundary | ( | const char * | line, |
| const string & | boundary ) |
Is this string the same as the MPM boundary value?
| line | The input to test |
| boundary | The complete boundary line to test for, excluding terminating characters. |
Definition at line 876 of file mime_util.cc.
|
virtual |
Is this request conditional?
Definition at line 315 of file DODSFilter.cc.
|
virtual |
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.
Definition at line 358 of file BaseType.cc.
| bool libdap::is_constructor_type | ( | Type | t | ) |
|
virtual |
Definition at line 181 of file BaseType.h.
| bool libdap::is_hop_by_hop_header | ( | const string & | header | ) |
Is the header a hop by hop header? If so, we're not supposed to store it in the cache. See RFC 2616, Section 13.5.1.
Definition at line 850 of file HTTPCache.cc.
| bool libdap::is_host_big_endian | ( | ) |
|
virtual |
Is this variable part of the current selection?
Does this variable appear in either the selection part or as a function argument in the current constrain expression. If this property is set (true) then implementations of the read() method should read this variable.
Definition at line 600 of file BaseType.cc.
| bool libdap::is_integer_type | ( | Type | t | ) |
Definition at line 161 of file parser-util.cc.
| bool libdap::is_quoted | ( | const string & | s | ) |
|
virtual |
Returns true if the instance is a numeric, string or URL type variable.
Definition at line 347 of file BaseType.cc.
| bool libdap::is_simple_type | ( | Type | t | ) |
Returns true if the instance is a numeric, string or URL type variable.
|
virtual |
Returns true if the instance is a vector (i.e., array) type variable.
Definition at line 352 of file BaseType.cc.
| bool libdap::is_vector_type | ( | Type | t | ) |
| time_t libdap::last_modified_time | ( | const string & | name | ) |
Get the last modified time. Assume name is a file and find its last modified time. If name is not a file, then return now as the last modified time.
| name | The name of a file. |
Definition at line 94 of file mime_util.cc.
|
overridevirtual |
How many elements are in this variable? Uses -1 in places.
Returns the number of elements in the vector. Note that some child classes of Vector use the length of -1 as a flag value.
Holds a sequence. */.
This is the interface for the class D4Sequence. A sequence contains a single set of variables, all at the same lexical level just like a Structure. Like a Structure, a D4Sequence may contain other compound types, including other D4Sequences. Unlike a Structure, a D4Sequence defines a pattern that is repeated N times for a sequence of N elements. It is useful to think of a D4Sequence as representing a table of values (like a relational database), with each row of the table corresponding to a D4Sequence instance.'' (This usage can be confusing, since instance'' also refers to a particular item of class D4Sequence.) For example:
D4Sequence {
String name;
Int32 age;
} person;
This represents a Sequence of ``person'' records, each instance of which contains a name and an age:
Fred 34
Ralph 23
Andrea 29
...
A D4Sequence can be arbitrarily long, which is to say that its length is not part of its declaration. A D4Sequence can contain other D4Sequences:
D4Sequence {
String name;
Int32 age;
D4Sequence {
String friend;
} friend_list;
} person;
Fred 34 Norman
Andrea
Ralph
Lisa
Ralph 23 Norman
Andrea
Lisa
Marth
Throckmorton
Helga
Millicent
Andrea 29 Ralph
Natasha
Norman
... .. ...
Internally, the D4Sequence is represented by a vector of vectors. The members of the outer vector are the members of the D4Sequence. This includes the nested D4Sequences, as in the above example.
Because the length of a D4Sequence is indeterminate, there are changes to the behavior of the functions to read this class of data. The read() function for D4Sequence must be written so that successive calls return values for successive rows of the D4Sequence.
Similar to a C structure, you refer to members of D4Sequence elements with a .'' notation. For example, if the D4Sequence has a member D4Sequence called Tom'' and Tom has a member Float32 called shoe_size'', you can refer to Tom's shoe size as Tom.shoe_size''.
class D4Sequence : public Constructor { private: This may be zero (nullptr) but the accessor (clauses()) allocates an instance if that is the case. D4FilterClauseList *d_clauses;
Use this to control if ptr_duplicate(), ..., copy the filter clauses. Because the values of a child sequence are held in copies of the Seq object they clauses will be bound to the 'master' instance will be copied but the copies will never be used. This field can be used to control that. ...purely an optimization. bool d_copy_clauses;
protected: This holds the values of the sequence. Values are stored in instances of BaseTypeRow objects which hold instances of BaseType.
Allow these values to be accessed by subclasses D4SeqValues d_values;
int64_t d_length; // How many elements are in the sequence; -1 if not currently known
void m_duplicate(const D4Sequence &s);
Specialize this if you have a data source that requires read() recursively call itself for child sequences. void read_sequence_values(bool filter);
friend class D4SequenceTest;
public: D4Sequence(const string &n); D4Sequence(const string &n, const string &d);
D4Sequence(const D4Sequence &rhs);
virtual ~D4Sequence();
D4Sequence &operator=(const D4Sequence &rhs);
BaseType *ptr_duplicate() override;
void clear_local_data() override;
/**
The number of elements in a Sequence object.
Definition at line 207 of file BaseType.h.
|
overridevirtual |
Get the number of elements in this variable This version of the function deprecates length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that a Vector/Array holds no values yet (as opposed to zero values). For types not derived from Vector, there is always one element.
Get the number of elements in this Vector/Array This version of the function deprecates length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that the Vector/Array holds no values yet (as opposed to zero values).
Definition at line 216 of file BaseType.h.
| const char * libdap::libdap_version | ( | ) |
Definition at line 446 of file escaping.cc.
| std::string libdap::name_path | ( | const string & | path | ) |
Returns the filename portion of a pathname.
Given a pathname, this function returns just the file name component of the path. That is, given /a/b/c/ralph.nc.das, it returns ralph.nc.
| path | A C-style simple string containing a pathname to be parsed. |
Definition at line 250 of file mime_util.cc.
Definition at line 236 of file escaping.cc.
| string libdap::octstring | ( | unsigned char | val | ) |
Definition at line 98 of file escaping.cc.
| string libdap::open_temp_fstream | ( | ofstream & | f, |
| const string & | name_template, | ||
| const string & | suffix ) |
Using the given template, open a temporary file using the given ofstream object. Uses mkstemp() in a 'safe' way.
| f | Value-result parameter |
| name_template | The template used to name the temporary file. The template has the form templateXXXXXX where the six Xs will be overwritten. |
| suffix | If present, the template is 'templateXXXXXX.suffix' |
| Error | if there is a problem. |
| void libdap::parse_error | ( | const char * | msg, |
| const int | line_num, | ||
| const char * | context ) |
Definition at line 115 of file parser-util.cc.
| void libdap::parse_error | ( | const string & | msg, |
| const int | line_num, | ||
| const char * | context ) |
Definition at line 140 of file parser-util.cc.
| void libdap::parse_error | ( | parser_arg * | arg, |
| const char * | msg, | ||
| const int | line_num, | ||
| const char * | context ) |
Definition at line 89 of file parser-util.cc.
Given a string that contains a MIME header line, parse it into the the header (name) and its value. Both are downcased.
| header | The input line, striped of the ending crlf pair |
| name | A value-result parameter that holds the header name |
| value | A value-result parameter that holds the header's value. |
Definition at line 848 of file mime_util.cc.
| time_t libdap::parse_time | ( | const char * | str, |
| bool | expand ) |
Parse a string in GMT format to a local time time_t representation Four formats are accepted: Wkd, 00 Mon 0000 00:00:00 GMT (rfc1123) Weekday, 00-Mon-00 00:00:00 GMT (rfc850) Wkd Mon 00 00:00:00 0000 GMT (ctime) 1*DIGIT (delta-seconds)
Copied from libwww. 09/19/02 jhrg
| str | The time string. |
| expand | If the time is given in delta seconds, adjust it to seconds since midnight 1 Jan 1970 if this is true. If false, simply convert the string to a time_t and return. The default value is true. |
Definition at line 144 of file util_mit.cc.
Get the filename part from a path. This function can be used to return a string that has the directory components stripped from a path. This is useful when building error message strings.
If WIN32 is defined, use '\' as the path separator, otherwise use '/' as the path separator.
| bool libdap::pathname_ok | ( | const string & | path, |
| bool | strict ) |
Does the string name a potentially valid pathname? Test the given pathname to verify that it is a valid name. We define this as: Contains only printable characters; and Is less then 256 characters. If strict is true, test that the pathname consists of only letters, digits, and underscore, dash and dot characters instead of the more general case where a pathname can be composed of any printable characters.
| path | The pathname to test |
| strict | Apply more restrictive tests (true by default) |
|
virtual |
Definition at line 394 of file D4Sequence.cc.
|
virtual |
Print usage information for a filter program.
This message is printed when the filter program is incorrectly invoked by the dispatch CGI. This is an error in the server installation or the CGI implementation, so the error message is written to stderr instead of stdout. A server's stderr messages show up in the httpd log file. In addition, an error object is sent back to the client program telling them that the server is broken.
Definition at line 578 of file DODSFilter.cc.
|
virtual |
Prints the value of the variable.
Prints the value of the variable, with its declaration. This function is primarily intended for debugging DODS applications. However, it can be overloaded and used to do some useful things. Take a look at the asciival and writeval clients, both of which overload this to output the values of variables in different ways.
| out | The output stream on which to print the value. |
| space | This value is passed to the print_decl() function, and controls the leading spaces of the output. |
| print_decl_p | A boolean value controlling whether the variable declaration is printed as well as the value. |
|
overridepure virtual |
Prints the value of the variable.
Prints the value of the variable, with its declaration. This function is primarily intended for debugging DODS applications. However, it can be overloaded and used to do some useful things. Take a look at the asciival and writeval clients, both of which overload this to output the values of variables in different ways.
| out | The output ostream on which to print the value. |
| space | This value is passed to the print_decl() function, and controls the leading spaces of the output. |
| print_decl_p | A boolean value controlling whether the variable declaration is printed as well as the value. |
|
virtual |
Definition at line 436 of file D4Sequence.cc.
|
protectedvirtual |
Processing the command line options passed to the filter is handled by this method so that specializations can change the options easily.
| argc | The argument count |
| argv | The vector of char * argument strings. |
Definition at line 254 of file DODSFilter.cc.
Removed spaces from the front of a URL and also from the front of the CE. This function assumes that there are no holes in both the URL and the CE. It will remove leading space, but not other spaces.
| name | The URL to process |
|
pure virtual |
Clone this instance. Allocate a new instance and copy *this into it. This method must perform a deep copy.
@note This method should \e not copy data values, but must copy all other fields in the object.
this. | std::string libdap::read_multipart_boundary | ( | FILE * | in, |
| const string & | boundary ) |
Read the next line of input and test to see if it is a multipart MIME boundary line. If the value of boundary is the default (an empty string) then just test that the line starts with "--". In either case, return the value of boundary just read.
| boundary | Value of the boundary to look for - optional |
| in | Read from this FILE* |
| Error | if no boundary was found. |
Definition at line 893 of file mime_util.cc.
Definition at line 904 of file mime_util.cc.
| void libdap::read_multipart_headers | ( | FILE * | in, |
| const string & | content_type, | ||
| const ObjectType | object_type, | ||
| const string & | cid ) |
Consume the Multipart MIME headers that prefix the DDX in a DataDDX response. The stream pointer is advanced to the start of the DDX. It might seem odd that this function both takes the value of the MPM boundary as a parameter and returns that value as a result, but this code can be used in two different situations. In one case, it is called on a partial document read from stdin and needs to return the value of boundary to the downstream DDX parser so that code can sense the end of the DDX. In the other case, this function is told the value of boundary and tests for it to ensure document correctness.
| in | Read from this stream |
| content_type | The expected value of the Content-Type header |
| object_type | The expected value of the Content-Description header |
| cid | The expected value of the Content-Id header - optional. |
| Error | if the boundary is not found or if any of the expected header values don't match. The optional values are tested only if they are given (the default values are not tested). |
Definition at line 935 of file mime_util.cc.
| void libdap::read_multipart_headers | ( | istream & | in, |
| const string & | content_type, | ||
| const ObjectType | object_type, | ||
| const string & | cid ) |
Definition at line 969 of file mime_util.cc.
|
virtual |
Read the next instance of the sequence While the rest of the variables' read() methods are assumed to return the entire variable in one call (modulo enhancements of the library to support streaming large variables), this class assumes that the underlying data store is returning data from a table of unknown size. Thus, D4Sequence::read() is assumed to return one instance (or element or row) of the sequence per call and return true when the EOF (end of the sequence) is reached.
For each call to read, the values for each of the sequence's members are expected to have been loaded into the member's BaseType variables; this method will copy them out and store then in the D4Sequence's internal storage. This method always returns the next instance that satisfies the CE when 'filter' is true.
| dmr | |
| eval | |
| filter |
Definition at line 169 of file D4Sequence.cc.
|
virtual |
Has this variable been read?
Returns true if the value(s) for this variable have been read from the data source, otherwise returns false. This method is used to determine when values need to be read using the read() method. When read_p() returns true, this library assumes that buf2val() (and other methods such as get_vec()) can be used to access the value(s) of a variable.
Definition at line 410 of file BaseType.cc.
| void libdap::remove_mime_header | ( | istream & | in | ) |
Send a `Not Modified' response.
Use this function to create a response signaling that the target of a conditional get has not been modified relative to the condition given in the request. This will have to be a date until the servers support ETags.
| out | Write the response to this FILE pointer. */ void set_mime_not_modified(FILE *out) { ostringstream oss; set_mime_not_modified(oss); fwrite(oss.str().data(), 1, oss.str().length(), out); } |
/** Use this function to create a response signaling that the target of a conditional get has not been modified relative to the condition given in the request. This will have to be a date until the servers support ETags.
Send a `Not Modified' response.
| strm | Write the response to this stream. */ void set_mime_not_modified(ostream &strm) { strm << "HTTP/1.0 304 NOT MODIFIED" << CRLF; const time_t t = time(0); strm << "Date: " << rfc822_date(t).c_str() << CRLF; strm << CRLF; } |
/** Read the input stream in and discard the MIME header. The MIME header is separated from the body of the document by a single blank line. If no MIME header is found, then the input stream is `emptied' and will contain nothing.
Read and discard the MIME header of the stream in.
return false; }
/** Used for test code; strip the leading MIME headers from a response.
| in |
Definition at line 1145 of file mime_util.cc.
Remove %20 space encoding
Definition at line 61 of file AttrTable.cc.
|
virtual |
|
virtual |
Allocate enough memory for the Vector to contain numElements data elements of the Vector's type. Must be used before set_value_slice_from_row_major_vector to ensure memory exists.
| numElements | the number of elements of the Vector's type to preallocate storage for. |
| if | the memory cannot be allocated |
|
virtual |
|
virtual |
Allocate enough memory for the Vector to contain numElements data elements of the Vector's type. Must be used before set_value_slice_from_row_major_vector to ensure memory exists.
| numElements | the number of elements of the Vector's type to preallocate storage for. |
| if | the memory cannot be allocated |
|
virtual |
| std::string libdap::rfc822_date | ( | const time_t | t | ) |
Given a constant pointer to a time_t, return a RFC 822/1123 style date.
This function returns the RFC 822 date with the exception that the RFC 1123 modification for four-digit years is implemented.
| t | A const time_t pointer. |
Definition at line 148 of file mime_util.cc.
|
virtual |
Get a whole row from the sequence.
| row | Get row number row from the sequence. |
Definition at line 357 of file D4Sequence.cc.
| void libdap::save_str | ( | std::string & | dst, |
| const char * | src, | ||
| const int | ) |
Save a string to a temporary variable during the parse.
Given a string (const char *src), save it to the temporary variable pointed to by dst. If the string is longer than ID_MAX, generate and error indicating that src was truncated to ID_MAX characters during the copy operation. There are two versions of this function; one calls the version of parser_error() which writes to stderr. The version which accepts the parser_arg *arg argument calls the version of parser_error() which generates and Error object.
Definition at line 159 of file parser-util.cc.
|
virtual |
Definition at line 632 of file DODSFilter.cc.
|
virtual |
Transmit a DAS.
This function formats and prints an ASCII representation of a DAS on stdout. This has the effect of sending the DAS object back to the client program.
| out | The output FILE to which the DAS is to be sent. |
| das | The DAS object to be sent. |
| anc_location | The directory in which the external DAS file resides. |
| with_mime_headers | If true (the default) send MIME headers. |
Definition at line 603 of file DODSFilter.cc.
|
virtual |
Transmit a DAS.
This function formats and prints an ASCII representation of a DAS on stdout. This has the effect of sending the DAS object back to the client program.
| out | The output stream to which the DAS is to be sent. |
| das | The DAS object to be sent. |
| anc_location | The directory in which the external DAS file resides. |
| with_mime_headers | If true (the default) send MIME headers. |
Definition at line 620 of file DODSFilter.cc.
|
virtual |
Transmit a DDS.
This function formats and prints an ASCII representation of a DDS on stdout. When called by a CGI program, this has the effect of sending a DDS object back to the client program. Either an entire DDS or a constrained DDS may be sent.
| out | The output FILE to which the DAS is to be sent. |
| dds | The DDS to send back to a client. |
| eval | A reference to the ConstraintEvaluator to use. |
| constrained | If this argument is true, evaluate the current constraint expression and send the `constrained DDS' back to the client. |
| anc_location | The directory in which the external DAS file resides. |
| with_mime_headers | If true (the default) send MIME headers. |
/** This function formats and prints an ASCII representation of a DDS on stdout. When called by a CGI program, this has the effect of sending a DDS object back to the client program. Either an entire DDS or a constrained DDS may be sent.
Transmit a DDS.
| out | The output stream to which the DAS is to be sent. |
| dds | The DDS to send back to a client. |
| eval | A reference to the ConstraintEvaluator to use. |
| constrained | If this argument is true, evaluate the current constraint expression and send the `constrained DDS' back to the client. |
| anc_location | The directory in which the external DAS file resides. |
| with_mime_headers | If true (the default) send MIME headers. |
if (eval.functional_expression()) throw Error("Function calls can only be used with data requests. To see the structure of the underlying data " "source, reissue the URL without the function.");
time_t dds_lmt = get_dds_last_modified_time(anc_location); if (is_conditional() && dds_lmt <= get_request_if_modified_since() && with_mime_headers) { set_mime_not_modified(out); } else { if (with_mime_headers) set_mime_text(out, dods_dds, d_cgi_ver, x_plain, dds_lmt); if (constrained) dds.print_constrained(out); else dds.print(out); }
out << flush; }
void DODSFilter::send_dds(DDS &dds, ConstraintEvaluator &eval, bool constrained, const string &anc_location, bool with_mime_headers) const { send_dds(cout, dds, eval, constrained, anc_location, with_mime_headers); }
'lmt' unused. Should it be used to supply a LMT or removed from the method? jhrg 8/9/05 void DODSFilter::functional_constraint(BaseType &var, DDS &dds, ConstraintEvaluator &eval, FILE *out) const { ostringstream oss; functional_constraint(var, dds, eval, oss); fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); }
'lmt' unused. Should it be used to supply a LMT or removed from the method? jhrg 8/9/05 void DODSFilter::functional_constraint(BaseType &var, DDS &dds, ConstraintEvaluator &eval, ostream &out) const { out << "Dataset {\n"; var.print_decl(out, " ", true, false, true); out << "} function_value;\n"; out << "Data:\n";
out << flush;
Grab a stream that encodes using XDR. XDRStreamMarshaller m(out);
try { In the following call to serialize, suppress CE evaluation. var.serialize(eval, dds, m, false); } catch (Error &e) { throw; } }
void DODSFilter::dataset_constraint(DDS &dds, ConstraintEvaluator &eval, FILE *out, bool ce_eval) const { ostringstream oss; dataset_constraint(dds, eval, oss, ce_eval); fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); }
void DODSFilter::dataset_constraint(DDS &dds, ConstraintEvaluator &eval, ostream &out, bool ce_eval) const { send constrained DDS dds.print_constrained(out); out << "Data:\n"; out << flush;
Grab a stream that encodes using XDR. XDRStreamMarshaller m(out);
try { Send all variables in the current projection (send_p()) for (DDS::Vars_iter i = dds.var_begin(); i != dds.var_end(); i++) if ((*i)->send_p()) { DBG(cerr << "Sending " << (*i)->name() << endl); (*i)->serialize(eval, dds, m, ce_eval); } } catch (Error &e) { throw; } }
void DODSFilter::dataset_constraint_ddx(DDS &dds, ConstraintEvaluator &eval, ostream &out, const string &boundary, const string &start, bool ce_eval) const { Write the MPM headers for the DDX (text/xml) part of the response set_mime_ddx_boundary(out, boundary, start, dods_ddx);
Make cid uuid_t uu; uuid_generate(uu); char uuid[37]; uuid_unparse(uu, uuid); char domain[256]; if (getdomainname(domain, 255) != 0 || strlen(domain) == 0) strncpy(domain, "opendap.org", 255);
string cid = string(uuid) + "@" + string(domain);
Send constrained DDX with a data blob reference dds.print_xml_writer(out, true, cid);
Write the MPM headers for the data part of the response. set_mime_data_boundary(out, boundary, cid, dap4_data, binary);
Grab a stream that encodes using XDR. XDRStreamMarshaller m(out);
try { Send all variables in the current projection (send_p()) for (DDS::Vars_iter i = dds.var_begin(); i != dds.var_end(); i++) if ((*i)->send_p()) { DBG(cerr << "Sending " << (*i)->name() << endl); (*i)->serialize(eval, dds, m, ce_eval); } } catch (Error &e) { throw; } }
/** Send the data in the DDS object back to the client program. The data is encoded using a Marshaller, and enclosed in a MIME document which is all sent to data_stream. If this is being called from a CGI, data_stream is probably stdout and writing to it has the effect of sending the response back to the client.
Transmit data.
| dds | A DDS object containing the data to be sent. |
| eval | A reference to the ConstraintEvaluator to use. |
| data_stream | Write the response to this FILE. |
| anc_location | A directory to search for ancillary files (in addition to the CWD). This is used in a call to get_data_last_modified_time(). |
| with_mime_headers | If true, include the MIME headers in the response. Defaults to true. |
Definition at line 814 of file DODSFilter.cc.
|
virtual |
Transmit data.
Send the data in the DDS object back to the client program. The data is encoded using a Marshaller, and enclosed in a MIME document which is all sent to data_stream. If this is being called from a CGI, data_stream is probably stdout and writing to it has the effect of sending the response back to the client.
| dds | A DDS object containing the data to be sent. |
| eval | A reference to the ConstraintEvaluator to use. |
| data_stream | Write the response to this stream. |
| anc_location | A directory to search for ancillary files (in addition to the CWD). This is used in a call to get_data_last_modified_time(). |
| with_mime_headers | If true, include the MIME headers in the response. Defaults to true. |
Definition at line 837 of file DODSFilter.cc.
|
virtual |
Transmit data.
Send the data in the DDS object back to the client program. The data is encoded using a Marshaller, and enclosed in a MIME document which is all sent to data_stream. If this is being called from a CGI, data_stream is probably stdout and writing to it has the effect of sending the response back to the client.
| dds | A DDS object containing the data to be sent. |
| eval | A reference to the ConstraintEvaluator to use. |
| data_stream | Write the response to this stream. |
| start | |
| boundary | |
| anc_location | A directory to search for ancillary files (in addition to the CWD). This is used in a call to get_data_last_modified_time(). |
| with_mime_headers | If true, include the MIME headers in the response. Defaults to true. |
Definition at line 966 of file DODSFilter.cc.
|
virtual |
Send the DDX response. The DDX never contains data, instead it holds a reference to a Blob response which is used to get the data values. The DDS and DAS objects are built using code that already exists in the servers.
| dds | The dataset's DDS with attributes in the variables. |
| eval | A reference to the ConstraintEvaluator to use. |
| out | Destination |
| with_mime_headers | If true, include the MIME headers in the response. Defaults to true. |
Definition at line 906 of file DODSFilter.cc.
|
virtual |
Send the DDX response. The DDX never contains data, instead it holds a reference to a Blob response which is used to get the data values. The DDS and DAS objects are built using code that already exists in the servers.
| dds | The dataset's DDS with attributes in the variables. |
| eval | A reference to the ConstraintEvaluator to use. |
| out | Destination |
| with_mime_headers | If true, include the MIME headers in the response. Defaults to true. |
Definition at line 922 of file DODSFilter.cc.
|
virtual |
Should this variable be sent?
Returns the state of the send_p property. If true, this variable should be sent to the client, if false, it should not. If no constraint expression (CE) has been evaluated, this property is true for all variables in a data source (i.e., for all the variables listed in a DDS). If a CE has been evaluated, this property is true only for those variables listed in the projection part of the CE.
Definition at line 478 of file BaseType.cc.
|
virtual |
Send version information back to the client program.
This function formats and sends to stdout version information from the httpd server, the server dispatch scripts, the DODS core software, and (optionally) the dataset.
Definition at line 590 of file DODSFilter.cc.
|
overridevirtual |
Move data to the net, then remove them from the object.
Sends the data from the indicated (local) dataset through the connection identified by the Marshaller parameter. If the data is not already incorporated into the DDS object, read the data from the dataset. Once the data are sent (written to the Marshaller), they are deleted from the object and the object state is reset so that they will be read again if the read() method is called.
This function is only used on the server side of the client/server connection, and is generally only called from the ResponseBuilder functions. It has no BaseType implementation; each datatype child class supplies its own implementation.
| eval | Use this as the constraint expression evaluator. |
| dds | The Data Descriptor Structure object corresponding to this dataset. See The DODS User Manual for information about this structure. |
| m | A marshaller used to serialize data types |
| ce_eval | A boolean value indicating whether to evaluate the DODS constraint expression that may accompany this dataset. The constraint expression is stored in the dds. |
| InternalErr. | |
| Error. |
Definition at line 203 of file D4Sequence.h.
|
overridevirtual |
The DAP4 serialization method. Serialize a variable's values for DAP4. This does not write the DMR persistent representation but does write that part of the binary data blob that holds a variable's data. Once a variable's data are serialized, that memory is reclaimed (by calling BaseType::clear_local_data()).
| m | |
| dmr | |
| eval | |
| filter | True if there is one variable that should be 'filtered' |
| Error | or InternalErr |
| void libdap::set_array_using_double | ( | Array * | dest, |
| double * | src, | ||
| int | src_len ) |
Given an array that holds some sort of numeric data, load it with values using an array of doubles. This function makes several assumptions. First, it assumes the caller really wants to put the doubles into whatever types the array holds! Caveat emptor. Second, it assumes that if the size of source (src) array is different than the destination (dest) the caller has made a mistake. In that case it will throw an Error object.
After setting the values, this method sets the read_p property for dest. Setting read_p tells the serialization methods in libdap that this variable already holds data values and, given that, the serialization code will not try to read the values.
| dest | An Array. The values are written to this array, reusing its storage. Existing values are lost. |
| src | The source data. |
| src_len | The number of elements in the src array. |
|
virtual |
Set this variable's attribute table.
| at | Source of the attributes. |
Definition at line 502 of file BaseType.cc.
|
virtual |
Definition at line 513 of file BaseType.cc.
|
virtual |
Definition at line 515 of file BaseType.cc.
|
virtual |
Definition at line 347 of file DODSFilter.cc.
|
virtual |
Definition at line 182 of file BaseType.h.
|
overridevirtual |
Set the number of elements for this variable. use -1 to indicate nothing set.
Sets the length of the vector. This function does not allocate any new space.
| l | The number of elements |
Set the length of the sequence.
| count |
This updated version can accept sizes that are too big for a DAP2 Array, but if that happens, a flag is set.
| l | The number of elements |
Definition at line 224 of file BaseType.h.
|
overridevirtual |
Set the number of elements in this variable This version of the function deprecates set_length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that the Vector/Array holds no values.
Set the number of elements in this Vector/Array This version of the function deprecates set_length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that the Vector/Array holds no values.
| l | The number of elements in the variable |
| l | The number of elements in the Vector/Array |
Definition at line 232 of file BaseType.h.
| void libdap::set_mime_binary | ( | FILE * | out, |
| ObjectType | type, | ||
| const string & | ver, | ||
| EncodingType | enc, | ||
| const time_t | last_modified ) |
Write an HTTP 1.0 response header for our binary response document (i.e., the DataDDS object).
| out | Write the MIME header to this FILE pointer. |
| type | The type of this this response. Defaults to application/octet-stream. |
| ver | The version string; denotes the libdap implementation version. |
| enc | How is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain. |
| last_modified | The time to use for the Last-Modified header value. Default is zero which means use the current time. |
Definition at line 575 of file mime_util.cc.
| void libdap::set_mime_binary | ( | ostream & | strm, |
| ObjectType | type, | ||
| const string & | ver, | ||
| EncodingType | enc, | ||
| const time_t | last_modified ) |
Write an HTTP 1.0 response header for our binary response document (i.e., the DataDDS object).
| strm | Write the MIME header to this stream. |
| type | The type of this this response. Defaults to application/octet-stream. |
| ver | The version string; denotes the libdap implementation version. |
| enc | How is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain. |
| last_modified | The time to use for the Last-Modified header value. Default is zero which means use the current time. |
Definition at line 595 of file mime_util.cc.
| void libdap::set_mime_binary | ( | ostream & | strm, |
| ObjectType | type, | ||
| EncodingType | enc, | ||
| const time_t | last_modified, | ||
| const string & | protocol ) |
Write an HTTP 1.0 response header for our binary response document (i.e., the DataDDS object).
| strm | Write the MIME header to this stream. |
| type | The type of this this response. Defaults to application/octet-stream. |
| ver | The version string; denotes the libdap implementation version. |
| enc | How is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain. |
| last_modified | The time to use for the Last-Modified header value. Default is zero which means use the current time. |
Definition at line 636 of file mime_util.cc.
| void libdap::set_mime_data_boundary | ( | ostream & | strm, |
| const string & | boundary, | ||
| const string & | cid, | ||
| ObjectType | type, | ||
| EncodingType | enc ) |
Definition at line 748 of file mime_util.cc.
| void libdap::set_mime_ddx_boundary | ( | ostream & | strm, |
| const string & | boundary, | ||
| const string & | cid, | ||
| ObjectType | type, | ||
| EncodingType | enc ) |
Definition at line 734 of file mime_util.cc.
Generate an HTTP 1.0 response header for an Error object.
| out | Write the MIME header to this FILE pointer. |
| code | HTTP 1.0 response code. Should be 400, ... 500, ... |
| reason | Reason string of the HTTP 1.0 response header. |
| version | The version string; denotes the DAP spec and implementation version. |
Definition at line 1029 of file mime_util.cc.
| void libdap::set_mime_error | ( | ostream & | strm, |
| int | code, | ||
| const string & | reason, | ||
| const string & | version ) |
Generate an HTTP 1.0 response header for an Error object.
| strm | Write the MIME header to this stream. |
| code | HTTP 1.0 response code. Should be 400, ... 500, ... |
| reason | Reason string of the HTTP 1.0 response header. |
| version | The version string; denotes the DAP spec and implementation version. |
Definition at line 1043 of file mime_util.cc.
| void libdap::set_mime_html | ( | FILE * | out, |
| ObjectType | type, | ||
| const string & | ver, | ||
| EncodingType | enc, | ||
| const time_t | last_modified ) |
Generate an HTTP 1.0 response header for a html document.
| out | Write the MIME header to this FILE pointer. |
| type | The type of this this response. |
| ver | The version string; denotes the libdap implementation version. |
| enc | How is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain. |
| last_modified | The time to use for the Last-Modified header value. Default is zero which means use the current time. |
Definition at line 469 of file mime_util.cc.
| void libdap::set_mime_html | ( | ostream & | strm, |
| ObjectType | type, | ||
| const string & | ver, | ||
| EncodingType | enc, | ||
| const time_t | last_modified ) |
Generate an HTTP 1.0 response header for a html document.
| strm | Write the MIME header to this stream. |
| type | The type of this this response. |
| ver | The version string; denotes the libdap implementation version. |
| enc | How is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain. |
| last_modified | The time to use for the Last-Modified header value. Default is zero which means use the current time. |
Definition at line 486 of file mime_util.cc.
| void libdap::set_mime_html | ( | ostream & | strm, |
| ObjectType | type, | ||
| EncodingType | enc, | ||
| const time_t | last_modified, | ||
| const string & | protocol ) |
Generate an HTTP 1.0 response header for a html document.
| strm | Write the MIME header to this stream. |
| type | The type of this this response. |
| ver | The version string; denotes the libdap implementation version. |
| enc | How is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain. |
| last_modified | The time to use for the Last-Modified header value. Default is zero which means use the current time. |
Definition at line 528 of file mime_util.cc.
| void libdap::set_mime_multipart | ( | ostream & | strm, |
| const string & | boundary, | ||
| const string & | start, | ||
| ObjectType | type, | ||
| const string & | version, | ||
| EncodingType | enc, | ||
| const time_t | last_modified ) |
Definition at line 665 of file mime_util.cc.
| void libdap::set_mime_multipart | ( | ostream & | strm, |
| const string & | boundary, | ||
| const string & | start, | ||
| ObjectType | type, | ||
| EncodingType | enc, | ||
| const time_t | last_modified, | ||
| const string & | protocol, | ||
| const string & | url ) |
Build the initial headers for the DAP4 data response
Definition at line 697 of file mime_util.cc.
| void libdap::set_mime_text | ( | FILE * | out, |
| ObjectType | type, | ||
| const string & | ver, | ||
| EncodingType | enc, | ||
| const time_t | last_modified ) |
Generate an HTTP 1.0 response header for a text document. This is used when returning a serialized DAS or DDS object.
| out | Write the MIME header to this FILE pointer. |
| type | The type of this this response. Defaults to application/octet-stream. |
| ver | The version string; denotes the libdap implementation version. |
| enc | How is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain. |
| last_modified | The time to use for the Last-Modified header value. Default is zero which means use the current time. |
Definition at line 349 of file mime_util.cc.
| void libdap::set_mime_text | ( | ostream & | strm, |
| ObjectType | type, | ||
| const string & | ver, | ||
| EncodingType | enc, | ||
| const time_t | last_modified ) |
Generate an HTTP 1.0 response header for a text document. This is used when returning a serialized DAS or DDS object.
| strm | Write the MIME header to this stream. |
| type | The type of this this response. Defaults to application/octet-stream. |
| ver | The version string; denotes the libdap implementation version. |
| enc | How is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain. |
| last_modified | The time to use for the Last-Modified header value. Default is zero which means use the current time. |
Definition at line 368 of file mime_util.cc.
| void libdap::set_mime_text | ( | ostream & | strm, |
| ObjectType | type, | ||
| EncodingType | enc, | ||
| const time_t | last_modified, | ||
| const string & | protocol ) |
Generate an HTTP 1.0 response header for a text document. This is used when returning a serialized DAS or DDS object.
| strm | Write the MIME header to this stream. |
| type | The type of this this response. Defaults to application/octet-stream. |
| ver | The version string; denotes the libdap implementation version. |
| enc | How is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain. |
| last_modified | The time to use for the Last-Modified header value. Default is zero which means use the current time. |
Definition at line 420 of file mime_util.cc.
|
virtual |
Set the response to be returned. Valid response names are "DAS", "DDS", "DataDDS, "Version".
| r | The name of the object. |
| InternalErr | Thrown if the response is not one of the valid names. |
Definition at line 390 of file DODSFilter.cc.
|
virtual |
Returns true if the variable is a synthesized variable. A synthesized variable is one that is added to the dataset by the server (usually with a `projection function'. */ bool BaseType::synthesized_p() { return d_is_synthesized; }
/** Set the synthesized flag. Before setting this flag be sure to set the read_p() state. Once this flag is set you cannot alter the state of the read_p flag!
Definition at line 397 of file BaseType.cc.
|
virtual |
Set the URL. Set the URL sent to the server.
| url | The URL, minus the constraint. |
Definition at line 368 of file DODSFilter.cc.
|
virtual |
Set the internal value. The 'values' of a D4Sequence is a vector of vectors of BaseType* objects. Using this method does not perform a deep copy; the BaseType*s are copied so the caller should not free them. Note that this does set d_length but the read_p flag for the BaseTypes should all be set to keep the serializer from trying to read each of them.
| values |
Definition at line 268 of file D4Sequence.h.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Copy rowMajorData.length() elements currently in a rowMajorData buffer into this value buffer starting at element index startElement and continuing up to startElement+rowMajorData.length()-1
This is used for aggregating together smaller rowMajor vectors into a larger one.
Note: unlike the other set_value calls, this does NOT set read_p() since it is assumed to be used as a partial read and the caller is expected to set_read_p() when the data is complete.
ASSUMES: rowMajorData.read_p() so that the data is valid! ASSUMES: this Vector has enough value_capacity() to contain all the elements such that: startElement + rowMajorData.length() <= this->value_capacity(). ASSUMES: the data type of this->var() and rowMajorData.var() MUST be non-NULL and be the same!
| rowMajorDataC | the vector from which to copy data, assumed already read in or set. |
| startElement | the element index (NOT byte, but rather data type element) to place the first data value. |
| void Vector::set_vec | ( | unsigned int | i, |
| BaseType * | val ) |
Sets element i to value val.
Sets an element of the vector to a given value. If the type of the input and the type of the Vector do not match, an error condition is returned.
Use this function only with Vectors containing compound types. See buf2val() or the set_value() methods to access members of Vector containing simple types.
| InternalErr | Thrown if i is out of range, val is null or there was a type mismatch between the BaseType referenced by val and the ith element of this Vector. |
| i | The index of the element to be changed. |
| val | A pointer to the value to be inserted into the array. |
| void Vector::set_vec_nocopy | ( | unsigned int | i, |
| BaseType * | val ) |
Sets element i to value val. Set the ith element to val. Extend the vector if needed.
| void Vector::set_vec_nocopy_ll | ( | uint64_t | i, |
| BaseType * | val ) |
| bool libdap::size_ok | ( | unsigned int | sz, |
| unsigned int | nelem ) |
| bool libdap::StrCmp | ( | int | op, |
| T1 | v1, | ||
| T2 | v2 ) |
Compare two string types. This class is one implementation of the comparison policy used by rops.
Definition at line 166 of file Operators.h.
Definition at line 136 of file AttrTable.cc.
| D4AttributeType libdap::StringToD4AttributeType | ( | string | s | ) |
Definition at line 109 of file D4Attributes.cc.
| string libdap::systime | ( | ) |
|
virtual |
Returns the type of the class instance as a string.
Definition at line 335 of file BaseType.cc.
Return the type name. This function provides backward compatibility for older code that predates, and has not been ported to, DAP4. It is prejudiced toward DAP4, but if no D4 type name can be found, it types D2. If neither would return a type name, and InternalErr object is thrown.
| t | The DAP2/DAP4 type |
| InternalErr | If not such type can be found |
Rip through a string and replace all the escaped double quotes with regular double quotes.
| source |
Definition at line 481 of file escaping.cc.
Un-escape special characters, quotes and backslashes from an HDF attribute.
Note: A regex to match one \ must be defined as: Regex foo = "\\\\"; because both C++ strings and GNU's Regex also employ \ as an escape character!
| s | The escaped attribute. |
Definition at line 407 of file escaping.cc.
Definition at line 88 of file escaping.cc.
Definition at line 105 of file escaping.cc.
|
overridepure virtual |
Loads class data.
Store the value pointed to by val in the object's internal buffer. This function does not perform any checks, so users must be sure that the thing pointed to can actually be stored in the object's buffer.
Only simple objects (Int, Float, Byte, and so on) and arrays of these simple objects may be stored using this function. To put data into more complex constructor types, use the functions provided by that class.
| val | A pointer to the data to be inserted into the class data buffer. |
| reuse | A boolean value, indicating whether the class internal data storage can be reused or not. If this argument is TRUE, the class buffer is assumed to be large enough to hold the incoming data, and it is not reallocated. If FALSE, new storage is allocated. If the internal buffer has not been allocated at all, this argument has no effect. This is currently used only in the Vector class. |
| int64_t Vector::val2buf_ll | ( | void * | val, |
| bool | reuse = false ) |
|
virtual |
Get the values for this D4Sequence This method returns a reference to the values held by the instance. You should make sure that the instance really holds values before calling it! Do not free the BaseType*s contained in the vector of vectors.
Definition at line 281 of file D4Sequence.h.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Get the sequence values by reference This method returns a reference to the D4Sequence's values, eliminating the copy of all the pointers. For large sequences, that could be a substantial number of values (even though they are 'just' pointers).
Get the value for this sequence.
Definition at line 291 of file D4Sequence.h.
|
overridevirtual |
Returns a pointer to a member of a constructor class.
Returns a pointer to the contained variable in a composite class. The composite classes are those made up of aggregated simple data types. Array, Grid, and Structure are composite types, while Int and Float are simple types. This function is only used by composite classes. The BaseType implementation always returns null.
Several of the subclasses provide alternate access methods that make sense for that particular data type. For example, the Array class defines a *var(int i) method that returns the ith entry in the Array data, and the Structure provides a *var(Vars_iter) function using a pseudo-index to access the different members of the structure.
| name | The name of the class member. Defaults to "" |
| exact_match | True if only interested in variables whose full names match n exactly. If false, returns the first variable whose name matches name. For example, if name is x and point.x is a variable, then var("x", false) would return a BaseType pointer to point.x. If exact_match was true then name would need to be "point.x" for var to return that pointer. This feature simplifies constraint expressions for datasets which have complex, nested, constructor variables. Defaults to true. |
| s | Record the path to name. Defaults to null, in which case it is not used. |
Get the BaseType pointer to the named variable of a given row.
| row | Read from row in the sequence. |
| name | Return name from row. |
Definition at line 368 of file D4Sequence.cc.
|
virtual |
Get the BaseType pointer to the $i^{th}$ variable of row.
| row | Read from row in the sequence. |
| i | Return the $i^{th}$ variable from row. |
Definition at line 383 of file D4Sequence.cc.
| void Vector::vec_resize | ( | int | l | ) |
Resizes a Vector. If the input length is greater than the current length of the Vector, new memory is allocated (the Vector moved if necessary), and the new entries are appended to the end of the array and padded with Null values. If the input length is shorter, the tail values are discarded.
|
overridevirtual |
Returns the width of the data, in bytes.
Returns the number of bytes needed to hold the entire array. This is equal to length() (the number of elements in in the array) times the width of each element.
|
overridevirtual |
Given a string that contains WWW escape sequences, translate those escape sequences back into the ASCII characters they represent. Return the modified string.
-Places in the dap code where www2id() is called:
-In the server code:
| in | The string to modify. |
| escape | The character used to signal the beginning of an escape sequence. default: "%" |
| except | If there are some escape codes that should not be removed by this call (e.g., you might not want to remove spaces, %20) use this parameter to specify those codes. The function will then transform all escapes except those given. For example, to suppress translation of both spaces and the ampersand, pass "%20%26" for 'except'. default: "" |
Definition at line 202 of file escaping.cc.
Given a string that contains XML escape sequences (i.e., entities), translate those back into ASCII characters. Return the modified string.
| in | The string to modify. |
Definition at line 301 of file escaping.cc.
|
virtual |
Definition at line 184 of file DODSFilter.cc.
| const string libdap::c_dap40_namespace = "http://xml.opendap.org/ns/DAP/4.0#" |
|
protected |
Definition at line 106 of file DODSFilter.h.
|
protected |
Definition at line 110 of file DODSFilter.h.
|
protected |
Definition at line 111 of file DODSFilter.h.
|
protected |
Definition at line 100 of file DODSFilter.h.
|
protected |
Definition at line 101 of file DODSFilter.h.
|
protected |
Definition at line 93 of file DODSFilter.h.
|
protected |
Definition at line 102 of file DODSFilter.h.
|
protected |
Definition at line 99 of file DODSFilter.h.
|
protected |
Definition at line 92 of file DODSFilter.h.
|
protected |
Definition at line 94 of file DODSFilter.h.
|
protected |
Definition at line 98 of file DODSFilter.h.
|
protected |
Definition at line 97 of file DODSFilter.h.
|
protected |
Definition at line 112 of file DODSFilter.h.
|
protected |
Definition at line 96 of file DODSFilter.h.
|
protected |
Definition at line 105 of file DODSFilter.h.
|
protected |
Definition at line 108 of file DODSFilter.h.
|
protected |
Definition at line 103 of file DODSFilter.h.
| int libdap::dods_keep_temps = 0 |
Definition at line 81 of file HTTPConnect.cc.
| const string libdap::double_quote = "\"" |
Definition at line 1116 of file AttrTable.cc.
| const size_t libdap::line_length = 1024 |
Definition at line 760 of file mime_util.cc.
| const string libdap::usage |
Definition at line 89 of file DODSFilter.cc.
| int libdap::www_trace = 0 |
Definition at line 75 of file HTTPConnect.cc.
| int libdap::www_trace_extensive = 0 |
Definition at line 78 of file HTTPConnect.cc.