casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes
asdmbinaries::SDMDataObjectStreamReader Class Reference

#include <SDMDataObjectStreamReader.h>

List of all members.

Public Types

enum  BINATTACHCODES {
  ACTUALDURATIONS,
  ACTUALTIMES,
  AUTODATA,
  FLAGS,
  CROSSDATA,
  ZEROLAGS
}

Public Member Functions

 SDMDataObjectStreamReader ()
virtual ~SDMDataObjectStreamReader ()
void open (const string &path)
 Open a file expected to contain BDF data, read and parse the global header.
int64_t position ()
 Returns the current position in the BDF file.
void close ()
 Close the file containing the BDF data and releases all the memory dynamically allocated.
unsigned long long currentIntegrationStartsAt () const
 Returns the current position in bytes in the file of the current block of data (subscan, integration or subintegration) .
unsigned int currentIntegrationIndex () const
 Returns the index of the current block of data (subscan, integration or subintegration).
string title () const
 Returns the title of the SDMDataObject.
const ByteOrderbyteOrder () const
 Returns the byte order of the SDMDataObject.
unsigned long long startTime () const
 Returns the start time.
unsigned int numTime () const
 Returns the number of (sub) integrations.
string dataOID () const
 Returns the dataOID.
string execBlockUID () const
 Returns the UID of the ExecBlock.
unsigned int execBlockNum () const
 Returns the number of the ExecBlock.
unsigned int scanNum () const
 Returns the number of the scan.
unsigned int subscanNum () const
 Returns the number of the subscan.
string projectPath () const
 Returns the project path.
unsigned int numAntenna () const
 Returns the number of antenna.
CorrelationMode correlationMode () const
 Returns the correlation mode.
OptionalSpectralResolutionType spectralResolutionType () const
 Returns the spectral resolution.
ProcessorType processorType () const
 Returns the processor type.
CorrelatorType correlatorType () const
 Returns the correlator type.
bool isTP () const
 Returns true if the data are total power data and false otherwise.
bool isCorrelation () const
 Returns true if the data are correlator data and false otherwise.
const SDMDataObject::DataStructdataStruct () const
 Returns the structure of the data.
bool aborted () const
 Returns true if the observation has been aborted.
unsigned long long abortTime () const
 Returns the time, as an unsigned long long, at which the observation has been aborted.
string abortReason () const
 Returns the reason, as a string, why the observation has been aborted.
string toString () const
 Returns a string representation of the global header of this SDMDataObject.
bool hasSubset ()
 Returns true as long as the mark announcing the end of the sequence of (sub)integrations is not read in the stream.
const SDMDataSubsetgetSubset ()
const vector< SDMDataSubset > & nextSubsets (unsigned int nSubsets)
const vector< SDMDataSubset > & allRemainingSubsets ()
 SDMDataObjectStreamReader ()
virtual ~SDMDataObjectStreamReader ()
void open (const string &path)
 Open a file expected to contain BDF data, read and parse the global header.
void close ()
 Close the file containing the BDF data and releases all the memory dynamically allocated.
unsigned long long currentIntegrationStartsAt () const
 Returns the current position in bytes in the file of the current block of data (subscan, integration or subintegration) .
unsigned int currentIntegrationIndex () const
 Returns the index of the current block of data (subscan, integration or subintegration).
string title () const
 Returns the title of the SDMDataObject.
unsigned long long startTime () const
 Returns the start time.
unsigned int numTime () const
 Returns the number of (sub) integrations.
string dataOID () const
 Returns the dataOID.
string execBlockUID () const
 Returns the UID of the ExecBlock.
unsigned int execBlockNum () const
 Returns the number of the ExecBlock.
unsigned int scanNum () const
 Returns the number of the scan.
unsigned int subscanNum () const
 Returns the number of the subscan.
string projectPath () const
 Returns the project path.
unsigned int numAntenna () const
 Returns the number of antenna.
CorrelationMode correlationMode () const
 Returns the correlation mode.
OptionalSpectralResolutionType spectralResolutionType () const
 Returns the spectral resolution.
ProcessorType processorType () const
 Returns the processor type.
CorrelatorType correlatorType () const
 Returns the correlator type.
bool isTP () const
 Returns true if the data are total power data and false otherwise.
bool isCorrelation () const
 Returns true if the data are correlator data and false otherwise.
const SDMDataObject::DataStructdataStruct () const
 Returns the structure of the data.
bool aborted () const
 Returns true if the observation has been aborted.
unsigned long long abortTime () const
 Returns the time, as an unsigned long long, at which the observation has been aborted.
string abortReason () const
 Returns the reason, as a string, why the observation has been aborted.
string toString () const
 Returns a string representation of the global header of this SDMDataObject.
bool hasSubset ()
 Returns true as long as the mark announcing the end of the sequence of (sub)integrations is not read in the stream.
const SDMDataSubsetgetSubset ()
const vector< SDMDataSubset > & nextSubsets (unsigned int nSubsets)
const vector< SDMDataSubset > & allRemainingSubsets ()

Public Attributes

bitset< 6 > attachmentFlags

Private Types

enum  States {
  S_NO_BDF,
  S_AT_BEGINNING,
  S_READING,
  S_AT_END,
  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,
  T_OPEN,
  T_QUERY,
  T_TEST_END,
  T_READ,
  T_READ_NEXT,
  T_READ_ALL,
  T_CLOSE
}
enum  States {
  S_NO_BDF,
  S_AT_BEGINNING,
  S_READING,
  S_AT_END,
  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,
  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 string &methodName) const
 Private methods.
string nextLine ()
pair< string, string > headerField2Pair (const string &hf)
pair< string, string > requireHeaderField (const string &hf)
string requireMIMEHeader ()
string requireBoundaryInCT (const string &ctValue)
void skipUntilEmptyLine (int maxSkips)
string accumulateUntilBoundary (const string &boundary, int maxLines)
void requireBoundary (const string &, int maxLines)
void lookForBinaryPartSize (xmlNode *aNode)
string requireCrossDataType (xmlNode *parent)
void printElementNames (xmlNode *a_node)
void requireSDMDataHeaderMIMEPart ()
void requireSDMDataSubsetMIMEPart (SDMDataSubset &sdmDataSubset)
void releaseMemory (SDMDataSubset &sdmDataSubset)
void checkState (Transitions t, const string &methodName) const
 Private methods.
string nextLine ()
pair< string, string > headerField2Pair (const string &hf)
pair< string, string > requireHeaderField (const string &hf)
string requireMIMEHeader ()
string requireBoundaryInCT (const string &ctValue)
void skipUntilEmptyLine (int maxSkips)
string accumulateUntilBoundary (const string &boundary, int maxLines)
void requireBoundary (const string &, int maxLines)
void lookForBinaryPartSize (xmlNode *aNode)
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.
unsigned int integrationIndex
string path
ifstream f
States currentState
string currentLine
string boundary_1
string boundary_2
bool opened
map< string, int64_t > binaryPartSize
set< string > s_partNames
char * actualTimesBuffer
char * actualDurationsBuffer
char * autoDataBuffer
char * crossDataBuffer
char * flagsBuffer
char * zeroLagsBuffer
SDMDataObjectParser parser
SDMDataObject sdmDataObject
SDMDataSubset sdmDataSubset
vector< SDMDataSubsetremainingSubsets
vector< SDMDataSubsetsomeSubsets

Detailed Description

Definition at line 37 of file SDMDataObjectStreamReader.h.


Member Enumeration Documentation

Enumerator:
ACTUALDURATIONS 
ACTUALTIMES 
AUTODATA 
FLAGS 
CROSSDATA 
ZEROLAGS 

Definition at line 281 of file SDMDataObjectStreamReader.h.

Enumerations to manage the state of an instance of SDMDataObjectStreamReader.

Enumerator:
S_NO_BDF 
S_AT_BEGINNING 
S_READING 
S_AT_END 
S_NO_BDF 
S_AT_BEGINNING 
S_READING 
S_AT_END 

Definition at line 269 of file SDMDataObjectStreamReader.h.

Enumerations to manage the state of an instance of SDMDataObjectStreamReader.

Enumerator:
S_NO_BDF 
S_AT_BEGINNING 
S_READING 
S_AT_END 
S_NO_BDF 
S_AT_BEGINNING 
S_READING 
S_AT_END 

Definition at line 287 of file SDMDataObjectStreamReader.h.

Enumerator:
T_OPEN 
T_QUERY 
T_TEST_END 
T_READ 
T_READ_NEXT 
T_READ_ALL 
T_CLOSE 
T_OPEN 
T_QUERY 
T_TEST_END 
T_READ 
T_READ_NEXT 
T_READ_ALL 
T_CLOSE 

Definition at line 270 of file SDMDataObjectStreamReader.h.

Enumerator:
T_OPEN 
T_QUERY 
T_TEST_END 
T_READ 
T_READ_NEXT 
T_READ_ALL 
T_CLOSE 
T_OPEN 
T_QUERY 
T_TEST_END 
T_READ 
T_READ_NEXT 
T_READ_ALL 
T_CLOSE 

Definition at line 288 of file SDMDataObjectStreamReader.h.


Constructor & Destructor Documentation


Member Function Documentation

Returns true if the observation has been aborted.

This method must be used on an SDMDataObject containing correlator data,otherwise a SDMDataObjectException is thrown.

Returns:
a bool.
Exceptions:
SDMDataObjectException.

Returns true if the observation has been aborted.

This method must be used on an SDMDataObject containing correlator data,otherwise a SDMDataObjectException is thrown.

Returns:
a bool.
Exceptions:
SDMDataObjectException.

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.

Returns:
a string.
Exceptions:
SDMDataObjectException

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.

Returns:
a string.
Exceptions:
SDMDataObjectException

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.

Returns:
an unsigned long long.
Exceptions:
SDMDataObjectException

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.

Returns:
an unsigned long long.
Exceptions:
SDMDataObjectException
string asdmbinaries::SDMDataObjectStreamReader::accumulateUntilBoundary ( const string &  boundary,
int  maxLines 
) [private]
string asdmbinaries::SDMDataObjectStreamReader::accumulateUntilBoundary ( const string &  boundary,
int  maxLines 
) [private]

Returns the byte order of the SDMDataObject.

Returns:
a pointer to a ByteOrder instance.
void asdmbinaries::SDMDataObjectStreamReader::checkState ( Transitions  t,
const string &  methodName 
) const [private]

Private methods.

void asdmbinaries::SDMDataObjectStreamReader::checkState ( Transitions  t,
const string &  methodName 
) const [private]

Private methods.

Close the file containing the BDF data and releases all the memory dynamically allocated.

Close the file containing the BDF data and releases all the memory dynamically allocated.

Returns the correlation mode.

Returns:
a value from enumeration CorrelationMode.

Returns the correlation mode.

Returns:
a value from enumeration CorrelationMode.

Returns the correlator type.

Returns:
a value from the enumeration CorrelatorType if processorType == CORRELATOR else an SDMDataObjectException is thrown.
Exceptions:
SDMDataException

Returns the correlator type.

Returns:
a value from the enumeration CorrelatorType if processorType == CORRELATOR else an SDMDataObjectException is thrown.
Exceptions:
SDMDataException

Returns the index of the current block of data (subscan, integration or subintegration).

The indexing is 0 based.

Returns:
an unsigned int.

Returns the index of the current block of data (subscan, integration or subintegration).

The indexing is 0 based.

Returns:
an unsigned int.

Returns the current position in bytes in the file of the current block of data (subscan, integration or subintegration) .

Returns:
a long long unsigned int.

Returns the current position in bytes in the file of the current block of data (subscan, integration or subintegration) .

Returns:
a long long unsigned int.

Returns the dataOID.

Returns:
a string.

Returns the dataOID.

Returns:
a string.

Returns the structure of the data.

Returns:
a reference to a DataStruct.

Returns the structure of the data.

Returns:
a reference to a DataStruct.

Returns the number of the ExecBlock.

Returns:
an unsigned int.

Returns the number of the ExecBlock.

Returns:
an unsigned int.

Returns the UID of the ExecBlock.

Returns:
a string.

Returns the UID of the ExecBlock.

Returns:
a string.

Returns true as long as the mark announcing the end of the sequence of (sub)integrations is not read in the stream.

Returns true as long as the mark announcing the end of the sequence of (sub)integrations is not read in the stream.

pair<string, string> asdmbinaries::SDMDataObjectStreamReader::headerField2Pair ( const string &  hf) [private]
pair<string, string> asdmbinaries::SDMDataObjectStreamReader::headerField2Pair ( const string &  hf) [private]

Returns true if the data are correlator data and false otherwise.

Returns:
a bool.
Note:
data are considered as correlator data if SpectralResolutionType != BASEBAND_WIDE.

Returns true if the data are correlator data and false otherwise.

Returns:
a bool.
Note:
data are considered as correlator data if SpectralResolutionType != BASEBAND_WIDE.

Returns true if the data are total power data and false otherwise.

Returns:
a bool.
Note:
data are considered as total power data if CorrelationMode == AUTO_ONLY && SpectralResolutionType == BASEBAND_WIDE.

Returns true if the data are total power data and false otherwise.

Returns:
a bool.
Note:
data are considered as total power data if CorrelationMode == AUTO_ONLY && SpectralResolutionType == BASEBAND_WIDE.
const vector<SDMDataSubset>& asdmbinaries::SDMDataObjectStreamReader::nextSubsets ( unsigned int  nSubsets)
const vector<SDMDataSubset>& asdmbinaries::SDMDataObjectStreamReader::nextSubsets ( unsigned int  nSubsets)

Returns the number of antenna.

Returns:
an unsigned int.

Returns the number of antenna.

Returns:
an unsigned int.

Returns the number of (sub) integrations.

Returns:
an unsigned int.

Returns the number of (sub) integrations.

Returns:
an unsigned int.
void asdmbinaries::SDMDataObjectStreamReader::open ( const 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.

Exceptions:
SDMDataObjectStreamReaderException,SDMDataObjectException,SDMDataObjectParserException.
void asdmbinaries::SDMDataObjectStreamReader::open ( const 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.

Exceptions:
SDMDataObjectStreamReaderException,SDMDataObjectException,SDMDataObjectParserException.

Returns the current position in the BDF file.

or -1 if it fails to determine the position.

Returns:
an int64_t

Returns the processor type.

Returns:
a value from the enumeration ProcessorType.

Returns the processor type.

Returns:
a value from the enumeration ProcessorType.

Returns the project path.

The project path is a string of the form "/<s>execBlockNum</s>/<s>scanNum</s>/<s>subscanNum</s>"

Returns the project path.

The project path is a string of the form "/<s>execBlockNum</s>/<s>scanNum</s>/<s>subscanNum</s>"

void asdmbinaries::SDMDataObjectStreamReader::requireBoundary ( const string &  ,
int  maxLines 
) [private]
void asdmbinaries::SDMDataObjectStreamReader::requireBoundary ( const string &  ,
int  maxLines 
) [private]
string asdmbinaries::SDMDataObjectStreamReader::requireBoundaryInCT ( const string &  ctValue) [private]
string asdmbinaries::SDMDataObjectStreamReader::requireBoundaryInCT ( const string &  ctValue) [private]
pair<string, string> asdmbinaries::SDMDataObjectStreamReader::requireHeaderField ( const string &  hf) [private]
pair<string, string> asdmbinaries::SDMDataObjectStreamReader::requireHeaderField ( const string &  hf) [private]

Returns the number of the scan.

Returns:
an unsigned int.

Returns the number of the scan.

Returns:
an unsigned int.

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.

Returns:
a value from enumeration SpectralResolutionType.

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.

Returns:
a value from enumeration SpectralResolutionType.

Returns the start time.

Returns:
a long long.

Returns the start time.

Returns:
a long long.

Returns the number of the subscan.

Returns:
an unsigned int.

Returns the number of the subscan.

Returns:
an unsigned int.

Returns the title of the SDMDataObject.

Returns:
a string.

Returns the title of the SDMDataObject.

Returns:
a string.

Returns a string representation of the global header of this SDMDataObject.

Returns:
a string.

Returns a string representation of the global header of this SDMDataObject.

Returns:
a string.

Member Data Documentation

Definition at line 304 of file SDMDataObjectStreamReader.h.

Definition at line 303 of file SDMDataObjectStreamReader.h.

Definition at line 282 of file SDMDataObjectStreamReader.h.

Definition at line 305 of file SDMDataObjectStreamReader.h.

Definition at line 301 of file SDMDataObjectStreamReader.h.

Definition at line 297 of file SDMDataObjectStreamReader.h.

Definition at line 298 of file SDMDataObjectStreamReader.h.

Definition at line 306 of file SDMDataObjectStreamReader.h.

Definition at line 296 of file SDMDataObjectStreamReader.h.

Definition at line 295 of file SDMDataObjectStreamReader.h.

Definition at line 294 of file SDMDataObjectStreamReader.h.

Definition at line 307 of file SDMDataObjectStreamReader.h.

Definition at line 292 of file SDMDataObjectStreamReader.h.

Private variables.

Definition at line 291 of file SDMDataObjectStreamReader.h.

Definition at line 299 of file SDMDataObjectStreamReader.h.

Definition at line 310 of file SDMDataObjectStreamReader.h.

Definition at line 293 of file SDMDataObjectStreamReader.h.

Definition at line 313 of file SDMDataObjectStreamReader.h.

Definition at line 302 of file SDMDataObjectStreamReader.h.

Definition at line 311 of file SDMDataObjectStreamReader.h.

Definition at line 312 of file SDMDataObjectStreamReader.h.

Definition at line 314 of file SDMDataObjectStreamReader.h.

Definition at line 308 of file SDMDataObjectStreamReader.h.


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