00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
#ifndef StationTable_CLASS
00035
#define StationTable_CLASS
00036
00037
#include <string>
00038
#include <vector>
00039
#include <map>
00040
#include <set>
00041
using std::string;
00042
using std::vector;
00043
using std::map;
00044
00045
#include <Angle.h>
00046
#include <AngularRate.h>
00047
#include <ArrayTime.h>
00048
#include <ArrayTimeInterval.h>
00049
#include <Complex.h>
00050
#include <Entity.h>
00051
#include <EntityId.h>
00052
#include <EntityRef.h>
00053
#include <Flux.h>
00054
#include <Frequency.h>
00055
#include <Humidity.h>
00056
#include <Interval.h>
00057
#include <Length.h>
00058
#include <PartId.h>
00059
#include <Pressure.h>
00060
#include <Speed.h>
00061
#include <Tag.h>
00062
#include <Temperature.h>
00063
#include <ConversionException.h>
00064
#include <DuplicateKey.h>
00065
#include <UniquenessViolationException.h>
00066
#include <NoSuchRow.h>
00067
#include <DuplicateKey.h>
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
#include "CStationType.h"
00083
using namespace StationTypeMod;
00084
00085
00086
00087
00088
00089
#ifndef WITHOUT_ACS
00090
#include <asdmIDLC.h>
00091
using asdmIDL::StationTableIDL;
00092
#endif
00093
00094
using asdm::Angle;
00095
using asdm::AngularRate;
00096
using asdm::ArrayTime;
00097
using asdm::Complex;
00098
using asdm::Entity;
00099
using asdm::EntityId;
00100
using asdm::EntityRef;
00101
using asdm::Flux;
00102
using asdm::Frequency;
00103
using asdm::Humidity;
00104
using asdm::Interval;
00105
using asdm::Length;
00106
using asdm::PartId;
00107
using asdm::Pressure;
00108
using asdm::Speed;
00109
using asdm::Tag;
00110
using asdm::Temperature;
00111
00112
using asdm::DuplicateKey;
00113
using asdm::ConversionException;
00114
using asdm::NoSuchRow;
00115
using asdm::DuplicateKey;
00116
00117
#include <Representable.h>
00118
00119
namespace asdm {
00120
00121
00122
00123
00124
class ASDM;
00125
class StationRow;
00171 class StationTable :
public Representable {
00172
friend class asdm::ASDM;
00173
00174
public:
00175
00176
00182
static vector<string>
getKeyName();
00183
00184
00185
virtual ~
StationTable();
00186
00192
ASDM &
getContainer()
const;
00193
00199
unsigned int size() ;
00200
00206 string
getName()
const;
00207
00211
Entity getEntity()
const;
00212
00217
void setEntity(
Entity e);
00218
00219
00220
00221
00222
00227
StationRow *
newRow();
00228
00233
StationRow*
newRowEmpty();
00234
00235
00247
StationRow *
newRow(string name, vector<Length > position, StationTypeMod::StationType type);
00248
00253
StationRow *
newRowFull(string name, vector<Length > position, StationTypeMod::StationType type);
00254
00255
00268
StationRow *
newRow(
StationRow *row);
00269
00274
StationRow *
newRowCopy(
StationRow *row);
00275
00276
00277
00278
00279
00280
00281
00282
00292
StationRow*
add(
StationRow* x) ;
00293
00294
00295
00296
00297
00298
00299
00305 vector<StationRow *>
get() ;
00306
00307
00308
00309
00310
00320
StationRow*
getRowByKey(
Tag stationId);
00321
00322
00323
00324
00325
00339
StationRow*
lookup(string name, vector<Length > position, StationTypeMod::StationType type);
00340
00341
00342
#ifndef WITHOUT_ACS
00343
00349 StationTableIDL *
toIDL() ;
00350
#endif
00351
00352
#ifndef WITHOUT_ACS
00353
00359
void fromIDL(StationTableIDL x)
throw(
DuplicateKey,
ConversionException);
00360
#endif
00361
00365
char *
toFITS()
const throw(
ConversionException);
00366
00370
void fromFITS(
char *fits)
throw(
ConversionException);
00371
00375 string
toVOTable()
const throw(
ConversionException);
00376
00380
void fromVOTable(string vo)
throw(
ConversionException);
00381
00388 string
toXML()
throw(
ConversionException);
00389
00395
void fromXML(string xmlDoc)
throw(
ConversionException);
00396
00402 string
toMIME();
00403
00410
void setFromMIME(
const string & mimeMsg);
00411
00421
void toFile(string directory);
00422
00431
void setFromFile(
const string& directory);
00432
00433
private:
00434
00443
StationTable (
ASDM & container);
00444
00445
ASDM & container;
00446
00447
bool archiveAsBin;
00448
bool fileAsBin ;
00449
00450
Entity entity;
00451
00452
00453
00454 map<string,int> noAutoIncIds;
00455
void autoIncrement(string key,
StationRow* x);
00456
00457
00461
static string tableName;
00462
00463
00467
static vector<string> key;
00468
00469
00475
StationRow* checkAndAdd(
StationRow* x)
throw (
DuplicateKey,
UniquenessViolationException);
00476
00477
00478
00479
00480
00481
00482 vector<StationRow * > privateRows;
00483
00484
00485
00486 vector<StationRow *> row;
00487
00488
00489
void error()
throw(
ConversionException);
00490
00491 };
00492
00493 }
00494
00495
#endif