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 ProcessorTable_CLASS
00035
#define ProcessorTable_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
#include "CProcessorType.h"
00081
using namespace ProcessorTypeMod;
00082
00083
00084
00085
00086
00087
00088
00089
#ifndef WITHOUT_ACS
00090
#include <asdmIDLC.h>
00091
using asdmIDL::ProcessorTableIDL;
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 ProcessorRow;
00180 class ProcessorTable :
public Representable {
00181
friend class asdm::ASDM;
00182
00183
public:
00184
00185
00191
static vector<string>
getKeyName();
00192
00193
00194
virtual ~
ProcessorTable();
00195
00201
ASDM &
getContainer()
const;
00202
00208
unsigned int size() ;
00209
00215 string
getName()
const;
00216
00220
Entity getEntity()
const;
00221
00226
void setEntity(
Entity e);
00227
00228
00229
00230
00231
00236
ProcessorRow *
newRow();
00237
00242
ProcessorRow*
newRowEmpty();
00243
00244
00256
ProcessorRow *
newRow(
Tag almaCorrelatorModeId, ProcessorTypeMod::ProcessorType type, string subType);
00257
00262
ProcessorRow *
newRowFull(
Tag almaCorrelatorModeId, ProcessorTypeMod::ProcessorType type, string subType);
00263
00264
00277
ProcessorRow *
newRow(
ProcessorRow *row);
00278
00283
ProcessorRow *
newRowCopy(
ProcessorRow *row);
00284
00285
00286
00287
00288
00289
00290
00291
00301
ProcessorRow*
add(
ProcessorRow* x) ;
00302
00303
00304
00305
00306
00307
00308
00314 vector<ProcessorRow *>
get() ;
00315
00316
00317
00318
00319
00329
ProcessorRow*
getRowByKey(
Tag processorId);
00330
00331
00332
00333
00334
00348
ProcessorRow*
lookup(
Tag almaCorrelatorModeId, ProcessorTypeMod::ProcessorType type, string subType);
00349
00350
00351
#ifndef WITHOUT_ACS
00352
00358 ProcessorTableIDL *
toIDL() ;
00359
#endif
00360
00361
#ifndef WITHOUT_ACS
00362
00368
void fromIDL(ProcessorTableIDL x)
throw(
DuplicateKey,
ConversionException);
00369
#endif
00370
00374
char *
toFITS()
const throw(
ConversionException);
00375
00379
void fromFITS(
char *fits)
throw(
ConversionException);
00380
00384 string
toVOTable()
const throw(
ConversionException);
00385
00389
void fromVOTable(string vo)
throw(
ConversionException);
00390
00397 string
toXML()
throw(
ConversionException);
00398
00404
void fromXML(string xmlDoc)
throw(
ConversionException);
00405
00411 string
toMIME();
00412
00419
void setFromMIME(
const string & mimeMsg);
00420
00430
void toFile(string directory);
00431
00440
void setFromFile(
const string& directory);
00441
00442
private:
00443
00452
ProcessorTable (
ASDM & container);
00453
00454
ASDM & container;
00455
00456
bool archiveAsBin;
00457
bool fileAsBin ;
00458
00459
Entity entity;
00460
00461
00462
00463 map<string,int> noAutoIncIds;
00464
void autoIncrement(string key,
ProcessorRow* x);
00465
00466
00470
static string tableName;
00471
00472
00476
static vector<string> key;
00477
00478
00484
ProcessorRow* checkAndAdd(
ProcessorRow* x)
throw (
DuplicateKey,
UniquenessViolationException);
00485
00486
00487
00488
00489
00490
00491 vector<ProcessorRow * > privateRows;
00492
00493
00494
00495 vector<ProcessorRow *> row;
00496
00497
00498
void error()
throw(
ConversionException);
00499
00500 };
00501
00502 }
00503
00504
#endif