casa
$Rev:20696$
|
The BeamTable class is an Alma table. More...
#include <BeamTable.h>
Public Member Functions | |
virtual | ~BeamTable () |
ASDM & | getContainer () 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. | |
BeamRow * | newRow () |
====> Row creation. | |
BeamRow * | newRow (BeamRow *row) |
Create a new row using a copy constructor mechanism. | |
BeamRow * | add (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. | |
BeamRow * | getRowByKey (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) |
BeamRow * | checkAndAdd (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 | |
ASDM & | container |
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 |
The BeamTable class is an Alma table.
Generated from model's revision "1.58", branch "HEAD"
Name | Type | Expected shape | Comment |
---|---|---|---|
Key | |||
beamId | Tag | identifies a unique row in the table. |
Definition at line 111 of file BeamTable.h.
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.
container | The container to which this table belongs. |
BeamRow* asdm::BeamTable::add | ( | BeamRow * | x | ) |
====> 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.
x | . A pointer on the row to be added. |
void asdm::BeamTable::autoIncrement | ( | string | key, |
BeamRow * | x | ||
) | [private] |
BeamRow* asdm::BeamTable::checkAndAdd | ( | 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.
DuplicateKey | |
UniquenessViolationException |
void asdm::BeamTable::checkPresenceInMemory | ( | ) | [inline, private] |
Definition at line 406 of file BeamTable.h.
References getContainer(), loadInProgress, asdm::Representable::presentInMemory, and setFromFile().
void asdm::BeamTable::error | ( | ) | [private] |
void asdm::BeamTable::fromIDL | ( | BeamTableIDL | x | ) |
Populate this table from the content of a BeamTableIDL Corba structure.
DuplicateKey | Thrown 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).
ConversionException |
Implements asdm::Representable.
vector<BeamRow *> asdm::BeamTable::get | ( | ) |
const vector<BeamRow *>& asdm::BeamTable::get | ( | ) | const |
static const vector<string>& asdm::BeamTable::getAttributesNames | ( | ) | [static] |
Return the names of the attributes of this table.
ASDM& asdm::BeamTable::getContainer | ( | ) | const |
Return the container to which this table belongs.
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.
string asdm::BeamTable::getName | ( | ) | const [virtual] |
Return the name of this table.
Implements asdm::Representable.
BeamRow* asdm::BeamTable::getRowByKey | ( | Tag | beamId | ) |
Returns a BeamRow* given a key.
beamId |
static vector<string> asdm::BeamTable::initAttributesNames | ( | ) | [static, private] |
A method to fill attributesNames;.
string asdm::BeamTable::MIMEXMLPart | ( | const asdm::ByteOrder * | byteOrder = asdm::ByteOrder::Machine_Endianity | ) | [private] |
Private methods involved during the export of this table into disk file(s).
BeamRow* asdm::BeamTable::newRow | ( | BeamRow * | row | ) |
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.
row | the row which is to be copied. |
void asdm::BeamTable::setEntity | ( | Entity | e | ) | [virtual] |
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.
directory | The name of the directory containing the file te be read and parsed. |
ConversionException | If 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.
mimeMsg | the string containing the MIME message. |
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.
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.
directory | The 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.
string asdm::BeamTable::toMIME | ( | const asdm::ByteOrder * | byteOrder = asdm::ByteOrder::Machine_Endianity | ) | [private] |
Serialize this into a stream of bytes and encapsulates that stream into a MIME message.
byteOrder | a 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).
ConversionException |
Implements asdm::Representable.
friend class ASDM [friend] |
Reimplemented from asdm::Representable.
Definition at line 112 of file BeamTable.h.
bool asdm::BeamTable::archiveAsBin [private] |
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.
ASDM& asdm::BeamTable::container [private] |
Definition at line 292 of file BeamTable.h.
Entity asdm::BeamTable::entity [private] |
Definition at line 297 of file BeamTable.h.
bool asdm::BeamTable::fileAsBin [private] |
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.
bool asdm::BeamTable::loadInProgress [private] |
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.