1 #ifndef SDMDataObjectStreamReader_CLASS
2 #define SDMDataObjectStreamReader_CLASS
12 #include <boost/algorithm/string.hpp>
14 #include <libxml/parser.h>
15 #include <libxml/tree.h>
18 #include "boost/filesystem/operations.hpp"
19 #include <boost/regex.hpp>
26 namespace asdmbinaries {
90 std::string
title()
const;
292 const std::vector<SDMDataSubset>&
nextSubsets(
unsigned int nSubsets);
343 std::pair<std::string, std::string>
headerField2Pair(
const std::string& hf);
virtual ~SDMDataObjectStreamReader()
const ByteOrder * byteOrder() const
Returns the byte order of the SDMDataObject.
SDMDataObject:: declarations.
SDMDataObjectStreamReaderException()
SDMDataSubset sdmDataSubset
std::string requireBoundaryInCT(const std::string &ctValue)
void releaseMemory(SDMDataSubset &sdmDataSubset)
int64_t position()
Returns the current position in the BDF file.
std::string requireMIMEHeader()
bool isWVR() const
Returns true if the data are WVR data and false otherwise.
std::string abortReason() const
Returns the reason, as a string, why the observation has been aborted.
const std::vector< SDMDataSubset > & nextSubsets(unsigned int nSubsets)
void open(const std::string &path)
Open a file expected to contain BDF data, read and parse the global header.
std::string dataOID() const
Returns the dataOID.
ProcessorTypeMod::ProcessorType processorType() const
Returns the processor type.
bool hasPackedData() const
Returns true if the binary data are all packed in one subset or distributed in a sequence of subsets ...
std::pair< std::string, std::string > requireHeaderField(const std::string &hf)
std::pair< std::string, std::string > headerField2Pair(const std::string &hf)
void requireSDMDataHeaderMIMEPart()
SDMDataObjectStreamReader()
void checkState(Transitions t, const std::string &methodName) const
Private methods.
bool aborted() const
Returns true if the observation has been aborted.
unsigned int execBlockNum() const
Returns the number of the ExecBlock.
unsigned int numTime() const
Returns the number of (sub) integrations.
unsigned long long startTime() const
Returns the start time.
unsigned long long currentIntegrationStartsAt() const
Returns the current position in bytes in the file of the current block of data (subscan, integration or subintegration) .
std::map< std::string, int64_t > binaryPartSize
std::string projectPath() const
Returns the project path.
OptionalSpectralResolutionType spectralResolutionType() const
Returns the spectral resolution.
States
Enumerations to manage the state of an instance of SDMDataObjectStreamReader.
unsigned long long integrationStartsAt
Private variables.
bool isCorrelation() const
Returns true if the data are correlator data and false otherwise.
CorrelationModeMod::CorrelationMode correlationMode() const
Returns the correlation mode.
std::vector< SDMDataSubset > someSubsets
const std::string & getMessage()
unsigned long long abortTime() const
Returns the time, as an unsigned long long, at which the observation has been aborted.
std::bitset< 6 > attachmentFlags
void skipUntilEmptyLine(int maxSkips)
std::set< std::string > s_partNames
char * actualDurationsBuffer
std::vector< SDMDataSubset > remainingSubsets
CorrelatorTypeMod::CorrelatorType correlatorType() const
Returns the correlator type.
const SDMDataSubset & getSubset()
void requireBoundary(const std::string &, int maxLines)
void close()
Close the file containing the BDF data and releases all the memory dynamically allocated.
std::string requireCrossDataType(xmlNode *parent)
unsigned int numAntenna() const
Returns the number of antenna.
A class to represent byte order information.
const std::vector< SDMDataSubset > & allRemainingSubsets()
void lookForBinaryPartSize(xmlNode *aNode)
SDMDataObjectParser parser
SDMDataObject sdmDataObject
std::string toString() const
Returns a string representation of the global header of this SDMDataObject.
std::string execBlockUID() const
Returns the UID of the ExecBlock.
bool hasSubset()
Returns true as long as the mark announcing the end of the sequence of (sub)integrations is not read ...
std::string accumulateUntilBoundary(const std::string &boundary, int maxLines)
void printElementNames(xmlNode *a_node)
void skipAsLongAsLineStartsWith(const std::string &start)
std::string title() const
Returns the title of the SDMDataObject.
bool isTP() const
Returns true if the data are total power data and false otherwise.
unsigned int integrationIndex
unsigned int currentIntegrationIndex() const
Returns the index of the current block of data (subscan, integration or subintegration).
unsigned int subscanNum() const
Returns the number of the subscan.
unsigned int scanNum() const
Returns the number of the scan.
void requireSDMDataSubsetMIMEPart(SDMDataSubset &sdmDataSubset)
SDMDataObject::DataStruct:: declarations.
const SDMDataObject::DataStruct & dataStruct() const
Returns the structure of the data.