casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends
asdm::BeamTable Class Reference

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

#include <BeamTable.h>

Inheritance diagram for asdm::BeamTable:
asdm::Representable

List of all members.

Public Member Functions

virtual ~BeamTable ()
ASDMgetContainer () const
 Return the container to which this table belongs.
unsigned int size () const
 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.
string toXML ()
 Produces an XML representation conform to the schema defined for Beam (BeamTable.xsd).
BeamTableIDL * toIDL ()
 Conversion Methods.
void fromIDL (BeamTableIDL x)
 Populate this table from the content of a BeamTableIDL Corba structure.
BeamRownewRow ()
 ====> Row creation.
BeamRownewRow (BeamRow *row)
 Create a new row using a copy constructor mechanism.
BeamRowadd (BeamRow *x)
 ====> Append a row to its table.
vector< BeamRow * > get ()
 ====> Methods returning rows.
const vector< BeamRow * > & get () const
 Get a const reference on the collection of rows pointers internally hold by the table.
BeamRowgetRowByKey (Tag beamId)
 Returns a BeamRow* given a key.

Static Public Member Functions

static vector< string > getKeyName ()
 Return the list of field names that make up key key as an array of strings.
static const vector< string > & getAttributesNames ()
 Return the names of the attributes of this table.

Private Member Functions

 BeamTable (ASDM &container)
 Create a BeamTable.
void autoIncrement (string key, BeamRow *x)
BeamRowcheckAndAdd (BeamRow *x)
 If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and throw exception if not.
void error ()
void fromXML (string &xmlDoc)
 Populate this table from the content of a XML document that is required to be conform to the XML schema defined for a Beam (BeamTable.xsd).
void setFromMIMEFile (const string &directory)
 Private methods involved during the build of this table out of the content of file(s) containing an external representation of a Beam table.
void setFromXMLFile (const string &directory)
string toMIME (const asdm::ByteOrder *byteOrder=asdm::ByteOrder::Machine_Endianity)
 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.
string MIMEXMLPart (const asdm::ByteOrder *byteOrder=asdm::ByteOrder::Machine_Endianity)
 Private methods involved during the export of this table into disk file(s).
void toFile (string directory)
 Stores a representation (binary or XML) of this table into a file.
void checkPresenceInMemory ()
void setFromFile (const string &directory)
 Reads and parses a file containing a representation of a BeamTable as those produced by the toFile method.

Static Private Member Functions

static vector< string > initAttributesNames ()
 A method to fill attributesNames;.

Private Attributes

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

Static Private Attributes

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

Friends

class ASDM

Detailed Description

The BeamTable class is an Alma table.


Role
At the present time, this table is not defined. This table would be needed for the observing system to write suitable primary beam maps in all data sets. It is not clear that this table is really needed. Data reduction software may well access available archived beam measurements (e.g. CalBeam tables) for accurate deconvolution.

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

Attributes of Beam
Name Type Expected shape

Comment

Key

beamId

Tag  

 identifies a unique row in the table.

Definition at line 111 of file BeamTable.h.


Constructor & Destructor Documentation

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

Create a BeamTable.

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

Parameters:
containerThe container to which this table belongs.

Member Function Documentation

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

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 pointer to a BeamRow.
void asdm::BeamTable::autoIncrement ( string  key,
BeamRow x 
) [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.

Exceptions:
DuplicateKey
UniquenessViolationException
void asdm::BeamTable::checkPresenceInMemory ( ) [inline, private]
void asdm::BeamTable::error ( ) [private]
void asdm::BeamTable::fromIDL ( BeamTableIDL  x)

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

Exceptions:
DuplicateKeyThrown if the method tries to add a row having a key that is already in the table.
ConversionException
void asdm::BeamTable::fromXML ( string &  xmlDoc) [private, virtual]

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

Exceptions:
ConversionException

Implements asdm::Representable.

====> Methods returning rows.

Get a collection of pointers on the rows of the table.

Returns:
Alls rows in a vector of pointers of BeamRow. The elements of this vector are stored in the order in which they have been added to the BeamTable.
const vector<BeamRow *>& asdm::BeamTable::get ( ) const

Get a const reference on the collection of rows pointers internally hold by the table.

Returns:
A const reference of a vector of pointers of BeamRow. The elements of this vector are stored in the order in which they have been added to the BeamTable.
static const vector<string>& asdm::BeamTable::getAttributesNames ( ) [static]

Return the names of the attributes of this table.

Returns:
a vector of string

Return the container to which this table belongs.

Returns:
the ASDM containing this table.

Referenced by checkPresenceInMemory().

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

Return this table's Entity.

Implements asdm::Representable.

static vector<string> asdm::BeamTable::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::BeamTable::getName ( ) const [virtual]

Return the name of this table.

Returns:
the name of this table in a string.

Implements asdm::Representable.

Returns a BeamRow* 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:
beamId
static vector<string> asdm::BeamTable::initAttributesNames ( ) [static, private]

A method to fill attributesNames;.

Private methods involved during the export of this table into disk file(s).

====> Row creation.

Create a new row with default values.

Returns:
a pointer on a BeamRow

Create a new row using a copy constructor mechanism.

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

Parameters:
rowthe row which is to be copied.
void asdm::BeamTable::setEntity ( Entity  e) [virtual]

Set this table's Entity.

Parameters:
eAn entity.

Implements asdm::Representable.

void asdm::BeamTable::setFromFile ( const string &  directory) [private]

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

This table is populated with the result of the parsing.

Parameters:
directoryThe name of the directory containing the file te be read and parsed.
Exceptions:
ConversionExceptionIf any error occurs while reading the files in the directory or parsing them.

Referenced by checkPresenceInMemory().

void asdm::BeamTable::setFromMIME ( const string &  mimeMsg) [private]

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

Parameters:
mimeMsgthe string containing the MIME message.
Exceptions:
ConversionException
void asdm::BeamTable::setFromMIMEFile ( const string &  directory) [private]

Private methods involved during the build of this table out of the content of file(s) containing an external representation of a Beam table.

void asdm::BeamTable::setFromXMLFile ( const string &  directory) [private]
unsigned int asdm::BeamTable::size ( ) const [virtual]

Return the number of rows in the table.

Returns:
the number of rows in an unsigned int.

Implements asdm::Representable.

void asdm::BeamTable::toFile ( string  directory) [private]

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 "Beam.bin" or an XML representation (fileAsBin==false) will be saved in a file "Beam.xml". The file is always written in a directory whose name is passed as a parameter.

Parameters:
directoryThe name of directory where the file containing the table's representation will be saved.
BeamTableIDL* asdm::BeamTable::toIDL ( )

Conversion Methods.

Convert this table into a BeamTableIDL CORBA structure.

Returns:
a pointer to a BeamTableIDL

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

Returns:
a string containing the MIME message.
Parameters:
byteOrdera const pointer to a static instance of the class ByteOrder.
string asdm::BeamTable::toXML ( ) [virtual]

Produces an XML representation conform to the schema defined for Beam (BeamTable.xsd).

Returns:
a string containing the XML representation.
Exceptions:
ConversionException

Implements asdm::Representable.


Friends And Related Function Documentation

friend class ASDM [friend]

Reimplemented from asdm::Representable.

Definition at line 112 of file BeamTable.h.


Member Data Documentation

Definition at line 294 of file BeamTable.h.

const vector<string> asdm::BeamTable::attributesNames [static, private]

The attributes names.

Definition at line 313 of file BeamTable.h.

Definition at line 292 of file BeamTable.h.

Definition at line 297 of file BeamTable.h.

Definition at line 295 of file BeamTable.h.

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

The list of field names that make up key key.

Definition at line 324 of file BeamTable.h.

Load the table in memory if necessary.

Reimplemented from asdm::Representable.

Definition at line 405 of file BeamTable.h.

Referenced by checkPresenceInMemory().

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

A map for the autoincrementation algorithm.

Definition at line 301 of file BeamTable.h.

vector<BeamRow * > asdm::BeamTable::privateRows [private]

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

In all cases we maintain a private vector of BeamRow s.

Definition at line 343 of file BeamTable.h.

vector<BeamRow *> asdm::BeamTable::row [private]

Definition at line 347 of file BeamTable.h.

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

The name of this table.

Definition at line 308 of file BeamTable.h.


The documentation for this class was generated from the following file: