casa
5.7.0-16
|
#include <SDMDataObjectStreamReader.h>
Public Types | |
enum | BINATTACHCODES { ACTUALDURATIONS, ACTUALTIMES, AUTODATA, FLAGS, CROSSDATA, ZEROLAGS } |
Public Member Functions | |
SDMDataObjectStreamReader () | |
virtual | ~SDMDataObjectStreamReader () |
void | open (const std::string &path) |
Open a file expected to contain BDF data, read and parse the global header. More... | |
int64_t | position () |
Returns the current position in the BDF file. More... | |
void | position (int64_t p) |
Set the read position in the BDF file. More... | |
void | close () |
Close the file containing the BDF data and releases all the memory dynamically allocated. More... | |
unsigned long long | currentIntegrationStartsAt () const |
Returns the current position in bytes in the file of the current block of data (subscan, integration or subintegration) . More... | |
unsigned int | currentIntegrationIndex () const |
Returns the index of the current block of data (subscan, integration or subintegration). More... | |
std::string | title () const |
Returns the title of the SDMDataObject. More... | |
const ByteOrder * | byteOrder () const |
Returns the byte order of the SDMDataObject. More... | |
unsigned long long | startTime () const |
Returns the start time. More... | |
unsigned int | numTime () const |
Returns the number of (sub) integrations. More... | |
std::string | dataOID () const |
Returns the dataOID. More... | |
std::string | execBlockUID () const |
Returns the UID of the ExecBlock. More... | |
unsigned int | execBlockNum () const |
Returns the number of the ExecBlock. More... | |
unsigned int | scanNum () const |
Returns the number of the scan. More... | |
unsigned int | subscanNum () const |
Returns the number of the subscan. More... | |
std::string | projectPath () const |
Returns the project path. More... | |
unsigned int | numAntenna () const |
Returns the number of antenna. More... | |
CorrelationModeMod::CorrelationMode | correlationMode () const |
Returns the correlation mode. More... | |
OptionalSpectralResolutionType | spectralResolutionType () const |
Returns the spectral resolution. More... | |
ProcessorTypeMod::ProcessorType | processorType () const |
Returns the processor type. More... | |
CorrelatorTypeMod::CorrelatorType | correlatorType () const |
Returns the correlator type. More... | |
bool | hasPackedData () const |
Returns true if the binary data are all packed in one subset or distributed in a sequence of subsets (supposedly) along the time axis. More... | |
bool | isTP () const |
Returns true if the data are total power data and false otherwise. More... | |
bool | isWVR () const |
Returns true if the data are WVR data and false otherwise. More... | |
bool | isCorrelation () const |
Returns true if the data are correlator data and false otherwise. More... | |
const SDMDataObject::DataStruct & | dataStruct () const |
Returns the structure of the data. More... | |
bool | aborted () const |
Returns true if the observation has been aborted. More... | |
unsigned long long | abortTime () const |
Returns the time, as an unsigned long long, at which the observation has been aborted. More... | |
std::string | abortReason () const |
Returns the reason, as a string, why the observation has been aborted. More... | |
std::string | toString () const |
Returns a string representation of the global header of this SDMDataObject. More... | |
bool | hasSubset () |
Returns true as long as the mark announcing the end of the sequence of (sub)integrations is not read in the stream. More... | |
const SDMDataSubset & | getSubset () |
const std::vector < SDMDataSubset > & | nextSubsets (unsigned int nSubsets) |
const std::vector < SDMDataSubset > & | allRemainingSubsets () |
Public Attributes | |
std::bitset< 6 > | attachmentFlags |
Private Types | |
enum | States { S_NO_BDF, S_AT_BEGINNING, S_READING, S_AT_END } |
Enumerations to manage the state of an instance of SDMDataObjectStreamReader. More... | |
enum | Transitions { T_OPEN, T_QUERY, T_TEST_END, T_READ, T_READ_NEXT, T_READ_ALL, T_CLOSE } |
Private Member Functions | |
void | checkState (Transitions t, const std::string &methodName) const |
Private methods. More... | |
std::string | nextLine () |
std::pair< std::string, std::string > | headerField2Pair (const std::string &hf) |
std::pair< std::string, std::string > | requireHeaderField (const std::string &hf) |
std::string | requireMIMEHeader () |
std::string | requireBoundaryInCT (const std::string &ctValue) |
void | skipAsLongAsLineStartsWith (const std::string &start) |
void | skipUntilEmptyLine (int maxSkips) |
std::string | accumulateUntilBoundary (const std::string &boundary, int maxLines) |
void | requireBoundary (const std::string &, int maxLines) |
void | lookForBinaryPartSize (xmlNode *aNode) |
std::string | requireCrossDataType (xmlNode *parent) |
void | printElementNames (xmlNode *a_node) |
void | requireSDMDataHeaderMIMEPart () |
void | requireSDMDataSubsetMIMEPart (SDMDataSubset &sdmDataSubset) |
void | releaseMemory (SDMDataSubset &sdmDataSubset) |
Private Attributes | |
unsigned long long | integrationStartsAt |
Private variables. More... | |
unsigned int | integrationIndex |
std::string | path |
std::ifstream | f |
States | currentState |
std::string | currentLine |
std::string | boundary_1 |
std::string | boundary_2 |
bool | opened |
std::map< std::string, int64_t > | binaryPartSize |
std::set< std::string > | s_partNames |
char * | actualTimesBuffer |
char * | actualDurationsBuffer |
char * | autoDataBuffer |
char * | crossDataBuffer |
char * | flagsBuffer |
char * | zeroLagsBuffer |
SDMDataObjectParser | parser |
SDMDataObject | sdmDataObject |
SDMDataSubset | sdmDataSubset |
std::vector< SDMDataSubset > | remainingSubsets |
std::vector< SDMDataSubset > | someSubsets |
Definition at line 38 of file SDMDataObjectStreamReader.h.
Enumerator | |
---|---|
ACTUALDURATIONS | |
ACTUALTIMES | |
AUTODATA | |
FLAGS | |
CROSSDATA | |
ZEROLAGS |
Definition at line 305 of file SDMDataObjectStreamReader.h.
|
private |
Enumerations to manage the state of an instance of SDMDataObjectStreamReader.
Enumerator | |
---|---|
S_NO_BDF | |
S_AT_BEGINNING | |
S_READING | |
S_AT_END |
Definition at line 311 of file SDMDataObjectStreamReader.h.
|
private |
Enumerator | |
---|---|
T_OPEN | |
T_QUERY | |
T_TEST_END | |
T_READ | |
T_READ_NEXT | |
T_READ_ALL | |
T_CLOSE |
Definition at line 312 of file SDMDataObjectStreamReader.h.
asdmbinaries::SDMDataObjectStreamReader::SDMDataObjectStreamReader | ( | ) |
|
virtual |
bool asdmbinaries::SDMDataObjectStreamReader::aborted | ( | ) | const |
Returns true if the observation has been aborted.
This method must be used on an SDMDataObject containing correlator data,otherwise a SDMDataObjectException is thrown.
SDMDataObjectException. |
std::string asdmbinaries::SDMDataObjectStreamReader::abortReason | ( | ) | const |
Returns the reason, as a string, why the observation has been aborted.
The returned value is significant only if the observation has been aborted, therefore the method must always be used in conjuction with the aborted method. This method must be used on an SDMDataObject containing correlator data, otherwise a SDMDataObjectException is thrown.
SDMDataObjectException |
unsigned long long asdmbinaries::SDMDataObjectStreamReader::abortTime | ( | ) | const |
Returns the time, as an unsigned long long, at which the observation has been aborted.
The returned value is significant only if the observation has been aborted, therefore the method must always be used in conjuction with the aborted method. This method must be used on an SDMDataObject containing correlator data, otherwise a SDMDataObjectException is thrown.
SDMDataObjectException |
|
private |
const std::vector<SDMDataSubset>& asdmbinaries::SDMDataObjectStreamReader::allRemainingSubsets | ( | ) |
const ByteOrder* asdmbinaries::SDMDataObjectStreamReader::byteOrder | ( | ) | const |
Returns the byte order of the SDMDataObject.
|
private |
Private methods.
void asdmbinaries::SDMDataObjectStreamReader::close | ( | ) |
Close the file containing the BDF data and releases all the memory dynamically allocated.
CorrelationModeMod::CorrelationMode asdmbinaries::SDMDataObjectStreamReader::correlationMode | ( | ) | const |
Returns the correlation mode.
CorrelatorTypeMod::CorrelatorType asdmbinaries::SDMDataObjectStreamReader::correlatorType | ( | ) | const |
Returns the correlator type.
SDMDataException |
unsigned int asdmbinaries::SDMDataObjectStreamReader::currentIntegrationIndex | ( | ) | const |
Returns the index of the current block of data (subscan, integration or subintegration).
The indexing is 0 based.
unsigned long long asdmbinaries::SDMDataObjectStreamReader::currentIntegrationStartsAt | ( | ) | const |
Returns the current position in bytes in the file of the current block of data (subscan, integration or subintegration) .
std::string asdmbinaries::SDMDataObjectStreamReader::dataOID | ( | ) | const |
Returns the dataOID.
const SDMDataObject::DataStruct& asdmbinaries::SDMDataObjectStreamReader::dataStruct | ( | ) | const |
Returns the structure of the data.
unsigned int asdmbinaries::SDMDataObjectStreamReader::execBlockNum | ( | ) | const |
Returns the number of the ExecBlock.
std::string asdmbinaries::SDMDataObjectStreamReader::execBlockUID | ( | ) | const |
Returns the UID of the ExecBlock.
const SDMDataSubset& asdmbinaries::SDMDataObjectStreamReader::getSubset | ( | ) |
bool asdmbinaries::SDMDataObjectStreamReader::hasPackedData | ( | ) | const |
Returns true if the binary data are all packed in one subset or distributed in a sequence of subsets (supposedly) along the time axis.
bool asdmbinaries::SDMDataObjectStreamReader::hasSubset | ( | ) |
Returns true as long as the mark announcing the end of the sequence of (sub)integrations is not read in the stream.
|
private |
bool asdmbinaries::SDMDataObjectStreamReader::isCorrelation | ( | ) | const |
Returns true if the data are correlator data and false otherwise.
bool asdmbinaries::SDMDataObjectStreamReader::isTP | ( | ) | const |
Returns true if the data are total power data and false otherwise.
bool asdmbinaries::SDMDataObjectStreamReader::isWVR | ( | ) | const |
Returns true if the data are WVR data and false otherwise.
|
private |
|
private |
const std::vector<SDMDataSubset>& asdmbinaries::SDMDataObjectStreamReader::nextSubsets | ( | unsigned int | nSubsets | ) |
unsigned int asdmbinaries::SDMDataObjectStreamReader::numAntenna | ( | ) | const |
Returns the number of antenna.
unsigned int asdmbinaries::SDMDataObjectStreamReader::numTime | ( | ) | const |
Returns the number of (sub) integrations.
void asdmbinaries::SDMDataObjectStreamReader::open | ( | const std::string & | path | ) |
Open a file expected to contain BDF data, read and parse the global header.
On exit the first block of data (subscan, integration or subintegration) is ready to be read by the getData method.
SDMDataObjectStreamReaderException,SDMDataObjectException,SDMDataObjectParserException. |
int64_t asdmbinaries::SDMDataObjectStreamReader::position | ( | ) |
Returns the current position in the BDF file.
or -1 if it fails to determine the position.
void asdmbinaries::SDMDataObjectStreamReader::position | ( | int64_t | p | ) |
Set the read position in the BDF file.
|
private |
ProcessorTypeMod::ProcessorType asdmbinaries::SDMDataObjectStreamReader::processorType | ( | ) | const |
Returns the processor type.
std::string asdmbinaries::SDMDataObjectStreamReader::projectPath | ( | ) | const |
Returns the project path.
The project path is a string of the form "/<s>execBlockNum</s>/<s>scanNum</s>/<s>subscanNum</s>"
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
unsigned int asdmbinaries::SDMDataObjectStreamReader::scanNum | ( | ) | const |
Returns the number of the scan.
|
private |
|
private |
OptionalSpectralResolutionType asdmbinaries::SDMDataObjectStreamReader::spectralResolutionType | ( | ) | const |
Returns the spectral resolution.
Due to this optional nature, the spectral resolution type is not returned directly as a literal of the enumeration SpectralResolutionType, but as an instance of the class OptionalSpectralResolutionType. This instance can be queried to check if the spectral resolution type information is present and if it is its value as an SpectralResolutionType literal.
unsigned long long asdmbinaries::SDMDataObjectStreamReader::startTime | ( | ) | const |
Returns the start time.
unsigned int asdmbinaries::SDMDataObjectStreamReader::subscanNum | ( | ) | const |
Returns the number of the subscan.
std::string asdmbinaries::SDMDataObjectStreamReader::title | ( | ) | const |
Returns the title of the SDMDataObject.
std::string asdmbinaries::SDMDataObjectStreamReader::toString | ( | ) | const |
Returns a string representation of the global header of this SDMDataObject.
|
private |
Definition at line 328 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 327 of file SDMDataObjectStreamReader.h.
std::bitset<6> asdmbinaries::SDMDataObjectStreamReader::attachmentFlags |
Definition at line 306 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 329 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 325 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 321 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 322 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 330 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 320 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 319 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 318 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 331 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 316 of file SDMDataObjectStreamReader.h.
|
private |
Private variables.
Definition at line 315 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 323 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 334 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 317 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 337 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 326 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 335 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 336 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 338 of file SDMDataObjectStreamReader.h.
|
private |
Definition at line 332 of file SDMDataObjectStreamReader.h.