34 #ifndef SourceTable_CLASS
35 #define SourceTable_CLASS
176 #include <asdmIDLC.h>
486 static const std::vector<std::string>&
getKeyName();
503 unsigned int size()
const;
521 static std::string
name() ;
561 std::string
toXML() ;
570 asdmIDL::SourceTableIDL *
toIDL() ;
579 void toIDL(asdmIDL::SourceTableIDL& x)
const;
590 void fromIDL(asdmIDL::SourceTableIDL x) ;
621 SourceRow *
newRow(
ArrayTimeInterval timeInterval,
Tag spectralWindowId, std::string code, std::vector<Angle > direction, std::vector<AngularRate > properMotion, std::string sourceName);
669 std::vector<SourceRow *>
get() ;
677 const std::vector<SourceRow *>&
get()
const ;
730 SourceRow*
lookup(
ArrayTimeInterval timeInterval,
Tag spectralWindowId, std::string code, std::vector<Angle > direction, std::vector<AngularRate > properMotion, std::string sourceName);
828 std::string
Key(
Tag spectralWindowId) ;
897 void toFile(std::string directory);
SourceRow * lookup(ArrayTimeInterval timeInterval, Tag spectralWindowId, std::string code, std::vector< Angle > direction, std::vector< AngularRate > properMotion, std::string sourceName)
Look up the table for a row whose all attributes except the autoincrementable one are equal to the co...
static const std::vector< std::string > & getKeyName()
Return the list of field names that make up key key as an array of strings.
void checkPresenceInMemory()
static const ByteOrder * Machine_Endianity
std::map< std::string, BinaryAttributeReaderFunctor * > unknownAttributes2Functors
std::string MIMEXMLPart(const asdm::ByteOrder *byteOrder=asdm::ByteOrder::Machine_Endianity)
Private methods involved during the export of this table into disk file(s).
The ArrayTimeInterval class aggregates an instance of ArrayTime and an instance of Interval...
void getByKeyNoAutoIncNoTime(std::vector< SourceRow * > &vin, std::vector< SourceRow * > &vout, Tag spectralWindowId)
Fills the vector vout (passed by reference) with pointers on elements of vin whose attributes are equ...
A class to represent byte order information.
std::string toXML()
Produces an XML representation conform to the schema defined for Source (SourceTable.xsd).
The SourceTable class is an Alma table.
unsigned int size() const
Return the number of rows in the table.
std::string getVersion() const
Return the version information about this table.
The ASDM class is the container for all tables.
The SourceRow class is a row of a SourceTable.
bool loadInProgress
Load the table in memory if necessary.
SourceRow * insertByStartTime(SourceRow *x, std::vector< SourceRow * > &row)
Insert a SourceRow* in a vector of SourceRow* so that it's ordered by ascending time.
SourceRow * checkAndAdd(SourceRow *x, bool skipCheckUniqueness=false)
If this table has an autoincrementable attribute then check if *x verifies the rule of uniqueness and...
SourceTable(ASDM &container)
Create a SourceTable.
static std::string name()
Return the name of this table.
std::string getName() const
Return the name of this table.
void toFile(std::string directory)
Stores a representation (binary or XML) of this table into a file.
std::map< std::string, ID_TIME_ROWS > context
SourceRow * getRowByKey(int sourceId, ArrayTimeInterval timeInterval, Tag spectralWindowId)
Returns a SourceRow* given a key.
std::vector< SourceRow * > getRowBySourceId(int)
Returns a vector of pointers on rows whose key element sourceId is equal to the parameter sourceId...
Entity getEntity() const
Return this table's Entity.
void setFromXMLFile(const std::string &directory)
std::string Key(Tag spectralWindowId)
Returns a string built by concatenating the ascii representation of the parameters values suffixed wi...
std::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.
std::vector< SourceRow * > privateRows
A data structure to store the pointers on the table's rows.
asdmIDL::SourceTableIDL * toIDL()
Conversion Methods.
void setFromMIME(const std::string &mimeMsg)
Extracts the binary part of a MIME message and deserialize its content to fill this with the result o...
void fromXML(std::string &xmlDoc)
Populate this table from the content of a XML document that is required to be conform to the XML sche...
The Tag class is an implementation of a unique index identifying a row of an ASDM table...
SourceRow * newRow()
====> Row creation.
ASDM & getContainer() const
Return the container to which this table belongs.
void setEntity(Entity e)
Set this table's Entity.
void addWithoutCheckingUnique(SourceRow *x)
Brutally append an SourceRow x to the collection of rows already stored in this table.
A pure virtual class whose derived classes are expected to be functors whose behaviours will be to re...
The Representable interface is implemented by all tables and by the container.
static const std::vector< std::string > & getAttributesNames()
Return the names of the attributes of this table.
const Double e
e and functions thereof:
BinaryAttributeReaderFunctor * getUnknownAttributeBinaryReader(const std::string &attributeName) const
std::map< const std::string, int > name2id_m
SourceRow * add(SourceRow *x)
====> Append a row to its table.
void setUnknownAttributeBinaryReader(const std::string &attributeName, BinaryAttributeReaderFunctor *barFctr)
std::vector< std::vector< SourceRow * > > ID_TIME_ROWS
void append(SourceRow *x)
Brutally append an SourceRow x to the collection of rows already stored in this table.
void setFromFile(const std::string &directory)
Reads and parses a file containing a representation of a SourceTable as those produced by the toFile ...
static const std::vector< std::string > & defaultAttributesNamesInBin()
Return the default sorted list of attributes names in the binary representation of the table...
void fromIDL(asdmIDL::SourceTableIDL x)
Populate this table from the content of a SourceTableIDL Corba structure.
The Entity class is an identification of a persistant entity in the ALMA archive. ...
void setFromMIMEFile(const std::string &directory)
Private methods involved during the build of this table out of the content of file(s) containing an e...