WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Data.h
1#ifndef _WINC_DATA
2#define _WINC_DATA
3
4#include <WXP/Date.h>
5#include <WXP/Datum.h>
6#include <WXP/EarthPoint.h>
7#include <WXP/String.h>
8#include <WXP/VarSpec.h>
9
10namespace WXP {
11 class Data {
12 String dinfo;
13 String datim;
14 Date date;
15 char source[20];
16 // Field specifications
17 char **info; // String describing each field
18 VarSpec *vs; // Variable specification for each field
19 int *type; // Type of each field
20 int fields; // Number of fields
21
22 char **id; // Identifier for each point
23 EarthPoint *ept; // Location of each point
24 float **value;// Float values
25 char ***str; // String values
26 int num; // Number of data points
27 int limit; // Allocated limit
28
29 int initClass();
30 public:
31
32 Data();
33 Data( int rfields );
34 ~Data();
35 Data( const Data &data );
36 Data operator=(const Data &data );
37 static int copyInfo( Data &data1, const Data &data2 );
38 static int copy( Data &data1, const Data &data2 );
39 int copy( Data &data );
40
41 int init();
42 int clear();
43 inline int getNum(){ return num; };
44 int setSource( const char *str );
45 inline const char *getSource(){ return source; };
46 int setFields( int rfields );
47 inline int getFields(){ return fields; };
48 int setType( int fld, int rtype );
49 int getType( int fld );
50 int expand( int rlimit );
51 int expand();
52 int setDate( Date &rdate );
53 inline int getDate( Date &rdate ){ rdate = date; return 1; };
54 inline Date getDate(){ return date; };
55 int setDatim( const char *rdatim );
56 const char *getDatim();
57 int setInfo( const char *rinfo );
58 const char *getInfo();
59 int setInfo( int ind, const char *rinfo );
60 const char *getInfo( int ind );
61 int searchInfo( const char *str );
62 int setUnits( int ind, const char *unit );
63 const char *getUnits( int ind );
64 int setVarSpec( int fld, VarSpec &rvs );
65 int getVarSpec( int fld, VarSpec &rvs );
66 int getIndex( const char *rid );
67 int setId( int ind, const char *rid );
68 const char *getId( int ind );
69 int setLoc( int ind, EarthPoint &rpt );
70 int setLoc( int ind, float lat, float lon );
71 int getLoc( int ind, EarthPoint &rpt );
72 EarthPoint getLoc( int ind );
73 int setValue( int ind, float rval );
74 int setValue( int ind, int fld, float rval );
75 int setString( int ind, const char *rstr );
76 int setString( int ind, int fld, const char *rstr );
77 int add( Data &data, int ind, int fld );
78 int add( Data &data, int ind );
79 int add( const char *rid, EarthPoint &rpt, float rval );
80 int add( const char *rid, EarthPoint &rpt, float rval1, float rval2 );
81 int add( Datum &datum );
82 int addValue( EarthPoint &rpt, float val );
83 float getValue( int ind );
84 float getValue( int ind, int fld );
85 const char *getString( int ind );
86 const char *getString( int ind, int fld );
87 int print();
88 int printData(int ind);
89 int printData();
90
91 enum Type {
92 NONE,
93 VALUE,
94 STRING
95 };
96 };
97}
98#endif
This class is a repository for point data.
Definition Data.h:11
int getIndex(const char *rid)
Definition Data.cc:672
int setId(int ind, const char *rid)
Definition Data.cc:686
const char * getId(int ind)
Definition Data.cc:699
Data operator=(const Data &data)
Definition Data.cc:125
This class stores date and time information.
Definition Date.h:8
This class stores raw point data.
Definition Datum.h:7
This is a variable length string class.
Definition String.h:5
This class specifies variable information.
Definition VarSpec.h:13
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct defines earth point values (lat, lon, elev)
Definition EarthPoint.h:5