Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends

asdm::SourceParameterTable Class Reference

The SourceParameterTable class is an Alma table. More...

#include <SourceParameterTable.h>

Inheritance diagram for asdm::SourceParameterTable:
asdm::Representable

List of all members.

Public Member Functions

virtual ~SourceParameterTable ()
ASDMgetContainer () const
 Return the container to which this table belongs.
unsigned int size ()
 Return the number of rows in the table.
string getName () const
 Return the name of this table.
Entity getEntity () const
 Return this table's Entity.
void setEntity (Entity e)
 Set this table's Entity.
SourceParameterRownewRow ()
 ====> Row creation.
SourceParameterRownewRowEmpty ()
 Has the same definition than the newRow method with the same signature.
SourceParameterRownewRow (int sourceId, ArrayTimeInterval timeInterval, int numFreq, int numStokes, int numDep, vector< StokesParameterMod::StokesParameter > stokesParameter, vector< vector< Flux > > flux, vector< Frequency > frequency, vector< Frequency > frequencyInterval, vector< vector< Flux > > fluxErr)
 Create a new row initialized to the specified values.
SourceParameterRownewRowFull (int sourceId, ArrayTimeInterval timeInterval, int numFreq, int numStokes, int numDep, vector< StokesParameterMod::StokesParameter > stokesParameter, vector< vector< Flux > > flux, vector< Frequency > frequency, vector< Frequency > frequencyInterval, vector< vector< Flux > > fluxErr)
 Has the same definition than the newRow method with the same signature.
SourceParameterRownewRow (SourceParameterRow *row)
 Create a new row using a copy constructor mechanism.
SourceParameterRownewRowCopy (SourceParameterRow *row)
 Has the same definition than the newRow method with the same signature.
SourceParameterRowadd (SourceParameterRow *x)
 ====> Append a row to its table.
vector< SourceParameterRow * > get ()
 ====> Methods returning rows.
SourceParameterRowgetRowByKey (int sourceParameterId, int sourceId, ArrayTimeInterval timeInterval)
 Returns a SourceParameterRow* given a key.
vector< SourceParameterRow * > getRowBySourceParameterId (int)
 Returns a vector of pointers on rows whose key element <<AutoIncrementableAttribute>> sourceParameterId is equal to the parameter <<AutoIncrementableAttribute>> sourceParameterId.
SourceParameterRowlookup (int sourceId, ArrayTimeInterval timeInterval, int numFreq, int numStokes, int numDep, vector< StokesParameterMod::StokesParameter > stokesParameter, vector< vector< Flux > > flux, vector< Frequency > frequency, vector< Frequency > frequencyInterval, vector< vector< Flux > > fluxErr)
 Look up the table for a row whose all attributes except the autoincrementable one are equal to the corresponding parameters of the method.
SourceParameterTableIDL * toIDL ()
 Conversion Methods.
void fromIDL (SourceParameterTableIDL x) throw (DuplicateKey,ConversionException)
 Populate this table from the content of a SourceParameterTableIDL Corba structure.
char * toFITS () const throw (ConversionException)
 To be implemented.
void fromFITS (char *fits) throw (ConversionException)
 To be implemented.
string toVOTable () const throw (ConversionException)
 To be implemented.
void fromVOTable (string vo) throw (ConversionException)
 To be implemented.
string toXML () throw (ConversionException)
 Translate this table to an XML representation conform to the schema defined for SourceParameter (SourceParameterTable.xsd).
void fromXML (string xmlDoc) throw (ConversionException)
 Populate this table from the content of a XML document that is required to be conform to the XML schema defined for a SourceParameter (SourceParameterTable.xsd).
string toMIME ()
 Serialize this into a stream of bytes and encapsulates that stream into a MIME message.
void setFromMIME (const string &mimeMsg)
 Extracts the binary part of a MIME message and deserialize its content to fill this with the result of the deserialization.
void toFile (string directory)
 Stores a representation (binary or XML) of this table into a file.
void setFromFile (const string &directory)
 Reads and parses a file containing a representation of a SourceParameterTable as those produced by the toFile method.

Static Public Member Functions

static vector< string > getKeyName ()
 Return the list of field names that make up key key as an array of strings.

Private Types

typedef vector< vector
< SourceParameterRow * > > 
ID_TIME_ROWS

Private Member Functions

 SourceParameterTable (ASDM &container)
 Create a SourceParameterTable.
SourceParameterRowcheckAndAdd (SourceParameterRow *x) throw (DuplicateKey, UniquenessViolationException)
 If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and throw exception if not.
SourceParameterRowinsertByStartTime (SourceParameterRow *x, vector< SourceParameterRow * > &row)
 Insert a SourceParameterRow* in a vector of SourceParameterRow* so that it's ordered by ascending time.
string Key (int sourceId)
 Returns a string built by concatenating the ascii representation of the parameters values suffixed with a "_" character.
void getByKeyNoAutoIncNoTime (vector< SourceParameterRow * > &vin, vector< SourceParameterRow * > &vout, int sourceId)
 Fills the vector vout (passed by reference) with pointers on elements of vin whose attributes are equal to the corresponding parameters of the method.
void error () throw (ConversionException)

Private Attributes

ASDMcontainer
bool archiveAsBin
bool fileAsBin
Entity entity
vector< SourceParameterRow * > privateRows
 A data structure to store the pointers on the table's rows.
map< string, ID_TIME_ROWScontext

Static Private Attributes

static string tableName
 The name of this table.
static vector< string > key
 The list of field names that make up key key.

Friends

class asdm::ASDM

Detailed Description

The SourceParameterTable class is an Alma table.

Generated from model's revision "1.46", branch "HEAD"

Attributes of SourceParameter
Name Type

Comment

Key

sourceParameterId int

 

sourceId int

 

timeInterval ArrayTimeInterval

 

Value
(Mandarory)

numFreq int

 

numStokes int

 

numDep int

 

stokesParameter vector<StokesParameterMod::StokesParameter >

numStokes

flux vector<vector<Flux > >

numFreq, numStokes

frequency vector<Frequency >

numFreq

frequencyInterval vector<Frequency >

numFreq

fluxErr vector<vector<Flux > >

numFreq, numStokes

Value
(Optional)

size vector<vector<Angle > >

numFreq, 2

positionAngle vector<Angle >

numFreq

sizeErr vector<vector<Angle > >

numFreq, 2

positionAngleErr vector<Angle >

numFreq

depSourceParameterId vector<int >

numDep

Definition at line 272 of file SourceParameterTable.h.


Member Typedef Documentation

typedef vector<vector <SourceParameterRow* > > asdm::SourceParameterTable::ID_TIME_ROWS [private]

Definition at line 642 of file SourceParameterTable.h.


Constructor & Destructor Documentation

virtual asdm::SourceParameterTable::~SourceParameterTable (  )  [virtual]
asdm::SourceParameterTable::SourceParameterTable ( ASDM container  )  [private]

Create a SourceParameterTable.

This constructor is private because only the container can create tables. All tables must know the container to which they belong.

Parameters:
container The container to which this table belongs.

Member Function Documentation

SourceParameterRow* asdm::SourceParameterTable::add ( SourceParameterRow x  ) 

====> Append a row to its table.

Add a row. If there table contains a row whose key's fields except² sourceParameterId are equal to x's ones then return a pointer on this row (i.e. no actual insertion is performed) otherwise add x to the table and return x.

Parameters:
x. A pointer on the row to be added.
Returns:
a SourceParameterRow pointer.
SourceParameterRow* asdm::SourceParameterTable::checkAndAdd ( SourceParameterRow x  )  throw (DuplicateKey, UniquenessViolationException) [private]

If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and throw exception if not.

Check if *x verifies the key uniqueness rule and throw an exception if not. Append x to its table.

void asdm::SourceParameterTable::error (  )  throw (ConversionException) [private]
void asdm::SourceParameterTable::fromFITS ( char *  fits  )  throw (ConversionException) [virtual]

To be implemented.

Implements asdm::Representable.

void asdm::SourceParameterTable::fromIDL ( SourceParameterTableIDL  x  )  throw (DuplicateKey,ConversionException)

Populate this table from the content of a SourceParameterTableIDL Corba structure.

Exceptions:
DuplicateKey Thrown if the method tries to add a row having a key that is already in the table.
ConversionException 
void asdm::SourceParameterTable::fromVOTable ( string  vo  )  throw (ConversionException) [virtual]

To be implemented.

Implements asdm::Representable.

void asdm::SourceParameterTable::fromXML ( string  xmlDoc  )  throw (ConversionException) [virtual]

Populate this table from the content of a XML document that is required to be conform to the XML schema defined for a SourceParameter (SourceParameterTable.xsd).

Implements asdm::Representable.

vector<SourceParameterRow *> asdm::SourceParameterTable::get (  ) 

====> Methods returning rows.

Get all rows.

Returns:
Alls rows as a vector of pointers of SourceParameterRow. The elements of this vector are stored in the order in which they have been added to the SourceParameterTable.
void asdm::SourceParameterTable::getByKeyNoAutoIncNoTime ( vector< SourceParameterRow * > &  vin,
vector< SourceParameterRow * > &  vout,
int  sourceId 
) [private]

Fills the vector vout (passed by reference) with pointers on elements of vin whose attributes are equal to the corresponding parameters of the method.

ASDM& asdm::SourceParameterTable::getContainer (  )  const

Return the container to which this table belongs.

Returns:
the ASDM containing this table.
Entity asdm::SourceParameterTable::getEntity (  )  const [virtual]

Return this table's Entity.

Implements asdm::Representable.

static vector<string> asdm::SourceParameterTable::getKeyName (  )  [static]

Return the list of field names that make up key key as an array of strings.

Returns:
a vector of string.
string asdm::SourceParameterTable::getName (  )  const [virtual]

Return the name of this table.

Returns:
the name of this table in a string.

Implements asdm::Representable.

SourceParameterRow* asdm::SourceParameterTable::getRowByKey ( int  sourceParameterId,
int  sourceId,
ArrayTimeInterval  timeInterval 
)

Returns a SourceParameterRow* given a key.

Returns:
a pointer to the row having the key whose values are passed as parameters, or 0 if no row exists for that key.
Parameters:
sourceParameterId. 
sourceId. 
timeInterval. 
vector<SourceParameterRow *> asdm::SourceParameterTable::getRowBySourceParameterId ( int   ) 

Returns a vector of pointers on rows whose key element <<AutoIncrementableAttribute>> sourceParameterId is equal to the parameter <<AutoIncrementableAttribute>> sourceParameterId.

Returns:
a vector of vector <SourceParameterRow *>. A returned vector of size 0 means that no row has been found.
Parameters:
sourceParameterId int contains the value of the autoincrementable attribute that is looked up in the table.
SourceParameterRow* asdm::SourceParameterTable::insertByStartTime ( SourceParameterRow x,
vector< SourceParameterRow * > &  row 
) [private]

Insert a SourceParameterRow* in a vector of SourceParameterRow* so that it's ordered by ascending time.

Parameters:
SourceParameterRow* x . The pointer to be inserted.
vector <SourceParameterRow*>& row. A reference to the vector where to insert x.
string asdm::SourceParameterTable::Key ( int  sourceId  )  [private]

Returns a string built by concatenating the ascii representation of the parameters values suffixed with a "_" character.

SourceParameterRow* asdm::SourceParameterTable::lookup ( int  sourceId,
ArrayTimeInterval  timeInterval,
int  numFreq,
int  numStokes,
int  numDep,
vector< StokesParameterMod::StokesParameter >  stokesParameter,
vector< vector< Flux > >  flux,
vector< Frequency frequency,
vector< Frequency frequencyInterval,
vector< vector< Flux > >  fluxErr 
)

Look up the table for a row whose all attributes except the autoincrementable one are equal to the corresponding parameters of the method.

Returns:
a pointer on this row if any, null otherwise.
Parameters:
sourceId. 
timeInterval. 
numFreq. 
numStokes. 
numDep. 
stokesParameter. 
flux. 
frequency. 
frequencyInterval. 
fluxErr. 
SourceParameterRow* asdm::SourceParameterTable::newRow ( int  sourceId,
ArrayTimeInterval  timeInterval,
int  numFreq,
int  numStokes,
int  numDep,
vector< StokesParameterMod::StokesParameter >  stokesParameter,
vector< vector< Flux > >  flux,
vector< Frequency frequency,
vector< Frequency frequencyInterval,
vector< vector< Flux > >  fluxErr 
)

Create a new row initialized to the specified values.

Returns:
a pointer on the created and initialized row.
Parameters:
sourceId. 
timeInterval. 
numFreq. 
numStokes. 
numDep. 
stokesParameter. 
flux. 
frequency. 
frequencyInterval. 
fluxErr. 
SourceParameterRow* asdm::SourceParameterTable::newRow ( SourceParameterRow row  ) 

Create a new row using a copy constructor mechanism.

The method creates a new SourceParameterRow owned by this. Each attribute of the created row is a (deep) copy of the corresponding attribute of row. The method does not add the created row to this, its simply parents it to this, a call to the add method has to be done in order to get the row added (very likely after having modified some of its attributes). If row is null then the method returns a new SourceParameterRow with default values for its attributes.

Parameters:
row the row which is to be copied.
SourceParameterRow* asdm::SourceParameterTable::newRow (  ) 

====> Row creation.

Create a new row with default values.

Returns:
a pointer on a SourceParameterRow
SourceParameterRow* asdm::SourceParameterTable::newRowCopy ( SourceParameterRow row  ) 

Has the same definition than the newRow method with the same signature.

Provided to facilitate the call from Python, otherwise the newRow method will be preferred.

SourceParameterRow* asdm::SourceParameterTable::newRowEmpty (  ) 

Has the same definition than the newRow method with the same signature.

Provided to facilitate the call from Python, otherwise the newRow method will be preferred.

SourceParameterRow* asdm::SourceParameterTable::newRowFull ( int  sourceId,
ArrayTimeInterval  timeInterval,
int  numFreq,
int  numStokes,
int  numDep,
vector< StokesParameterMod::StokesParameter >  stokesParameter,
vector< vector< Flux > >  flux,
vector< Frequency frequency,
vector< Frequency frequencyInterval,
vector< vector< Flux > >  fluxErr 
)

Has the same definition than the newRow method with the same signature.

Provided to facilitate the call from Python, otherwise the newRow method will be preferred.

void asdm::SourceParameterTable::setEntity ( Entity  e  )  [virtual]

Set this table's Entity.

Parameters:
e An entity.

Implements asdm::Representable.

void asdm::SourceParameterTable::setFromFile ( const string &  directory  ) 

Reads and parses a file containing a representation of a SourceParameterTable as those produced by the toFile method.

This table is populated with the result of the parsing.

Parameters:
directory The name of the directory containing the file te be read and parsed.
Exceptions:
ConversionException If any error occurs while reading the files in the directory or parsing them.
void asdm::SourceParameterTable::setFromMIME ( const string &  mimeMsg  ) 

Extracts the binary part of a MIME message and deserialize its content to fill this with the result of the deserialization.

Parameters:
mimeMsg the string containing the MIME message.
Exceptions:
ConversionException 
unsigned int asdm::SourceParameterTable::size (  )  [virtual]

Return the number of rows in the table.

Returns:
the number of rows in an unsigned int.

Implements asdm::Representable.

void asdm::SourceParameterTable::toFile ( string  directory  ) 

Stores a representation (binary or XML) of this table into a file.

Depending on the boolean value of its private field fileAsBin a binary serialization of this (fileAsBin==true) will be saved in a file "SourceParameter.bin" or an XML representation (fileAsBin==false) will be saved in a file "SourceParameter.xml". The file is always written in a directory whose name is passed as a parameter.

Parameters:
directory The name of directory where the file containing the table's representation will be saved.
char* asdm::SourceParameterTable::toFITS (  )  const throw (ConversionException) [virtual]

To be implemented.

Implements asdm::Representable.

SourceParameterTableIDL* asdm::SourceParameterTable::toIDL (  ) 

Conversion Methods.

Convert this table into a SourceParameterTableIDL CORBA structure.

Returns:
a pointer to a SourceParameterTableIDL
string asdm::SourceParameterTable::toMIME (  ) 

Serialize this into a stream of bytes and encapsulates that stream into a MIME message.

Returns:
a string containing the MIME message.
string asdm::SourceParameterTable::toVOTable (  )  const throw (ConversionException) [virtual]

To be implemented.

Implements asdm::Representable.

string asdm::SourceParameterTable::toXML (  )  throw (ConversionException) [virtual]

Translate this table to an XML representation conform to the schema defined for SourceParameter (SourceParameterTable.xsd).

Returns:
a string containing the XML representation.

Implements asdm::Representable.


Friends And Related Function Documentation

friend class asdm::ASDM [friend]

Definition at line 273 of file SourceParameterTable.h.


Member Data Documentation

Definition at line 590 of file SourceParameterTable.h.

Definition at line 588 of file SourceParameterTable.h.

Definition at line 643 of file SourceParameterTable.h.

Definition at line 591 of file SourceParameterTable.h.

vector<string> asdm::SourceParameterTable::key [static, private]

The list of field names that make up key key.

Definition at line 606 of file SourceParameterTable.h.

A data structure to store the pointers on the table's rows.

In all cases we maintain a private ArrayList of SourceParameterRow s.

Definition at line 633 of file SourceParameterTable.h.

string asdm::SourceParameterTable::tableName [static, private]

The name of this table.

Definition at line 600 of file SourceParameterTable.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines