asdm::AnnotationTable Class Reference

#include <AnnotationTable.h>

Inheritance diagram for asdm::AnnotationTable:

Inheritance graph
[legend]
Collaboration diagram for asdm::AnnotationTable:

Collaboration graph
[legend]
List of all members.

Detailed Description

The AnnotationTable class is an Alma table.

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

Attributes of Annotation
Name Type Comment

Key

annotationId Tag  

Value
(Mandarory)

time ArrayTime  

issue string  

details string  

Value
(Optional)

antennaId vector<Tag>

interval Interval  

numAntenna int  

numBaseband int  

basebandName vector<BasebandNameMod::BasebandName > numBaseband

dValue double  

vdValue vector<double >

vvdValues vector<vector<double > > ,

llValue long long  

vllValue vector<long long >

vvllValue vector<vector<long long > > ,

Definition at line 260 of file AnnotationTable.h.

Public Member Functions

virtual ~AnnotationTable ()
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.
AnnotationRownewRow ()
 Create a new row with default values.
AnnotationRownewRowEmpty ()
 Has the same definition than the newRow method with the same signature.
AnnotationRownewRow (ArrayTime time, string issue, string details)
 Create a new row initialized to the specified values.
AnnotationRownewRowFull (ArrayTime time, string issue, string details)
 Has the same definition than the newRow method with the same signature.
AnnotationRownewRow (AnnotationRow *row)
 Create a new row using a copy constructor mechanism.
AnnotationRownewRowCopy (AnnotationRow *row)
 Has the same definition than the newRow method with the same signature.
AnnotationRowadd (AnnotationRow *x)
 Add a row.
vector< AnnotationRow * > get ()
 Get all rows.
AnnotationRowgetRowByKey (Tag annotationId)
 Returns a AnnotationRow* given a key.
AnnotationRowlookup (ArrayTime time, string issue, string details)
 Look up the table for a row whose all attributes except the autoincrementable one are equal to the corresponding parameters of the method.
AnnotationTableIDL * toIDL ()
 Convert this table into a AnnotationTableIDL CORBA structure.
void fromIDL (AnnotationTableIDL x) throw (DuplicateKey,ConversionException)
 Populate this table from the content of a AnnotationTableIDL 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 Annotation (AnnotationTable.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 Annotation (AnnotationTable.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 AnnotationTable 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 Member Functions

 AnnotationTable (ASDM &container)
 Create a AnnotationTable.
void autoIncrement (string key, AnnotationRow *x)
AnnotationRowcheckAndAdd (AnnotationRow *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.
void error () throw (ConversionException)

Private Attributes

ASDMcontainer
bool archiveAsBin
bool fileAsBin
Entity entity
map< string, int > noAutoIncIds
 A map for the autoincrementation algorithm.
vector< AnnotationRow * > privateRows
 A data structure to store the pointers on the table's rows.
vector< AnnotationRow * > row

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


Constructor & Destructor Documentation

virtual asdm::AnnotationTable::~AnnotationTable (  )  [virtual]

asdm::AnnotationTable::AnnotationTable ( ASDM container  )  [private]

Create a AnnotationTable.

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

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

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

Returns:
a vector of string.

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

Return the container to which this table belongs.

Returns:
the ASDM containing this table.

unsigned int asdm::AnnotationTable::size (  )  [virtual]

Return the number of rows in the table.

Returns:
the number of rows in an unsigned int.

Implements asdm::Representable.

string asdm::AnnotationTable::getName (  )  const [virtual]

Return the name of this table.

Returns:
the name of this table in a string.

Implements asdm::Representable.

Entity asdm::AnnotationTable::getEntity (  )  const [virtual]

Return this table's Entity.

Implements asdm::Representable.

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

Set this table's Entity.

Parameters:
e An entity.

Implements asdm::Representable.

AnnotationRow* asdm::AnnotationTable::newRow (  ) 

Create a new row with default values.

Returns:
a pointer on a AnnotationRow

AnnotationRow* asdm::AnnotationTable::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.

AnnotationRow* asdm::AnnotationTable::newRow ( ArrayTime  time,
string  issue,
string  details 
)

Create a new row initialized to the specified values.

Returns:
a pointer on the created and initialized row.
Parameters:
time. 
issue. 
details. 

AnnotationRow* asdm::AnnotationTable::newRowFull ( ArrayTime  time,
string  issue,
string  details 
)

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.

AnnotationRow* asdm::AnnotationTable::newRow ( AnnotationRow row  ) 

Create a new row using a copy constructor mechanism.

The method creates a new AnnotationRow 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 AnnotationRow with default values for its attributes.

Parameters:
row the row which is to be copied.

AnnotationRow* asdm::AnnotationTable::newRowCopy ( AnnotationRow 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.

AnnotationRow* asdm::AnnotationTable::add ( AnnotationRow x  ) 

Add a row.

If there table contains a row whose key's fields 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 AnnotationRow pointer.

vector<AnnotationRow *> asdm::AnnotationTable::get (  ) 

Get all rows.

Returns:
Alls rows as a vector of pointers of AnnotationRow. The elements of this vector are stored in the order in which they have been added to the AnnotationTable.

AnnotationRow* asdm::AnnotationTable::getRowByKey ( Tag  annotationId  ) 

Returns a AnnotationRow* 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:
annotationId. 

AnnotationRow* asdm::AnnotationTable::lookup ( ArrayTime  time,
string  issue,
string  details 
)

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:
time. 
issue. 
details. 

AnnotationTableIDL* asdm::AnnotationTable::toIDL (  ) 

Convert this table into a AnnotationTableIDL CORBA structure.

Returns:
a pointer to a AnnotationTableIDL

void asdm::AnnotationTable::fromIDL ( AnnotationTableIDL  x  )  throw (DuplicateKey,ConversionException)

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

Exceptions:
DuplicateKey Thrown if the method tries to add a row having a key that is already in the table.
ConversionException 

char* asdm::AnnotationTable::toFITS (  )  const throw (ConversionException) [virtual]

To be implemented.

Implements asdm::Representable.

void asdm::AnnotationTable::fromFITS ( char *  fits  )  throw (ConversionException) [virtual]

To be implemented.

Implements asdm::Representable.

string asdm::AnnotationTable::toVOTable (  )  const throw (ConversionException) [virtual]

To be implemented.

Implements asdm::Representable.

void asdm::AnnotationTable::fromVOTable ( string  vo  )  throw (ConversionException) [virtual]

To be implemented.

Implements asdm::Representable.

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

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

Returns:
a string containing the XML representation.

Implements asdm::Representable.

void asdm::AnnotationTable::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 Annotation (AnnotationTable.xsd).

Implements asdm::Representable.

string asdm::AnnotationTable::toMIME (  ) 

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

Returns:
a string containing the MIME message.

void asdm::AnnotationTable::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 

void asdm::AnnotationTable::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 "Annotation.bin" or an XML representation (fileAsBin==false) will be saved in a file "Annotation.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.

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

Reads and parses a file containing a representation of a AnnotationTable 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::AnnotationTable::autoIncrement ( string  key,
AnnotationRow x 
) [private]

AnnotationRow* asdm::AnnotationTable::checkAndAdd ( AnnotationRow 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::AnnotationTable::error (  )  throw (ConversionException) [private]


Friends And Related Function Documentation

friend class asdm::ASDM [friend]

Definition at line 261 of file AnnotationTable.h.


Member Data Documentation

ASDM& asdm::AnnotationTable::container [private]

Definition at line 534 of file AnnotationTable.h.

bool asdm::AnnotationTable::archiveAsBin [private]

Definition at line 536 of file AnnotationTable.h.

bool asdm::AnnotationTable::fileAsBin [private]

Definition at line 537 of file AnnotationTable.h.

Entity asdm::AnnotationTable::entity [private]

Definition at line 539 of file AnnotationTable.h.

map<string,int> asdm::AnnotationTable::noAutoIncIds [private]

A map for the autoincrementation algorithm.

Definition at line 543 of file AnnotationTable.h.

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

The name of this table.

Definition at line 550 of file AnnotationTable.h.

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

The list of field names that make up key key.

Definition at line 556 of file AnnotationTable.h.

vector<AnnotationRow * > asdm::AnnotationTable::privateRows [private]

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

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

Definition at line 571 of file AnnotationTable.h.

vector<AnnotationRow *> asdm::AnnotationTable::row [private]

Definition at line 575 of file AnnotationTable.h.


The documentation for this class was generated from the following file:
Generated on Thu Aug 27 21:23:09 2009 for NRAOCASA by  doxygen 1.5.1