casa
5.7.0-16
|
A class to read a MIME message containing ALMA binary data and provide a view on these binary data through an instance of SDMDataObject. More...
#include <SDMDataObjectReader.h>
Public Member Functions | |
SDMDataObjectReader () | |
An empty constructor. More... | |
virtual | ~SDMDataObjectReader () |
The destructor. More... | |
const SDMDataObject & | read (std::string filename) |
This method reads a MIME message contained in a disk file and returns a reference to an SDMDataObject. More... | |
const SDMDataObject & | read (const char *buffer, unsigned long int size, bool fromFile=false) |
This method reads a MIME message contained in a memory buffer and returns a reference to an SDMDataObject. More... | |
const SDMDataObject & | ref () const |
This method returns a reference to the SDMDataObject instance built during the execution of the read method. More... | |
const SDMDataObject * | ptr () const |
This method returns a pointer to the SDMDataObject instance built during the execution of the read method. More... | |
void | done () |
A method to release the resources allocated by the read operation. More... | |
Private Types | |
enum | READ { UNKNOWN_, MEMORY_, FILE_ } |
enum | BINATTACHCODES { ACTUALDURATIONS, ACTUALTIMES, AUTODATA, FLAGS, CROSSDATA, ZEROLAGS } |
Private Member Functions | |
void | init () |
std::string::size_type | find (const std::string &s) |
bool | compare (const std::string &s) |
bool | EOD () |
std::string | extractXMLHeader (const std::string &boundary) |
void | tokenize (const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters) |
void | getFields (const std::string &header, std::map< std::string, std::string > &fields) |
std::string | getContentID () |
std::string | getContentLocation () |
void | processMIME () |
void | processMIMESDMDataHeader () |
void | processMIMESDMDataSubsetHeader (SDMDataSubset &sdmDataSubset) |
void | processMIMEIntegrations () |
void | processMIMEIntegration () |
void | processMIMESubscan () |
void | processBinaryAttachment (const std::string &boundary, const SDMDataSubset &sdmDataSubset) |
const SDMDataObject & | sdmDataObject () |
Static Private Member Functions | |
static bool | initClass () |
Private Attributes | |
READ | read_ |
int | filedes_ |
unsigned int | dataSize_ |
char * | data_ |
std::string::size_type | position_ |
std::string::size_type | lastPosition_ |
std::string::size_type | endPosition_ |
unsigned int | integrationNum_ |
SDMDataObjectParser | parser_ |
SDMDataObject related stuff. More... | |
SDMDataObject | sdmDataObject_ |
std::bitset< 6 > | attachmentFlags |
const ACTUALTIMESTYPE * | actualTimes_ |
unsigned long int | nActualTimes_ |
const ACTUALDURATIONSTYPE * | actualDurations_ |
unsigned long int | nActualDurations_ |
const ZEROLAGSTYPE * | zeroLags_ |
unsigned long int | nZeroLags_ |
const FLAGSTYPE * | flags_ |
unsigned long int | nFlags_ |
const INTCROSSDATATYPE * | longCrossData_ |
const SHORTCROSSDATATYPE * | shortCrossData_ |
const FLOATCROSSDATATYPE * | floatCrossData_ |
unsigned long int | nCrossData_ |
const AUTODATATYPE * | autoData_ |
unsigned long int | nAutoData_ |
Static Private Attributes | |
static const bool | initClass_ |
static const std::string | MIMEBOUNDARY_1 |
Two strings used as MIME boundaries. More... | |
static const std::string | MIMEBOUNDARY_2 |
static const boost::regex | CONTENTIDDATASTRUCTUREREGEXP |
Regular expressions used to identify a Content-ID field in a MIME header. More... | |
static const boost::regex | CONTENTIDSUBSETREGEXP |
static const boost::regex | CONTENTIDBINREGEXP |
static const boost::regex | CONTENTIDBINREGEXP1 |
static const boost::regex | CONTENTIDBINREGEXP2 |
static std::set< std::string > | BINATTACHNAMES |
Set of valid binary attachment names. More... | |
static std::map< std::string, BINATTACHCODES > | name2code |
A class to read a MIME message containing ALMA binary data and provide a view on these binary data through an instance of SDMDataObject.
An instance of a SDMDataObjectReader can read MIME messages stored in a file or in a memory buffer, via two different versions of the read() method. The binary data read can be Total Power or Correlator (integration and subintegration) data. Once the data obtained by a call to a read method are not needed any more the done() method must be called to release the resources allocated to access the data.
Definition at line 111 of file SDMDataObjectReader.h.
|
private |
Enumerator | |
---|---|
ACTUALDURATIONS | |
ACTUALTIMES | |
AUTODATA | |
FLAGS | |
CROSSDATA | |
ZEROLAGS |
Definition at line 205 of file SDMDataObjectReader.h.
|
private |
Enumerator | |
---|---|
UNKNOWN_ | |
MEMORY_ | |
FILE_ |
Definition at line 166 of file SDMDataObjectReader.h.
asdmbinaries::SDMDataObjectReader::SDMDataObjectReader | ( | ) |
An empty constructor.
|
virtual |
The destructor.
|
private |
void asdmbinaries::SDMDataObjectReader::done | ( | ) |
A method to release the resources allocated by the read operation.
This method must be called once the SDMDataObject built by the read method is no more needed.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
const SDMDataObject* asdmbinaries::SDMDataObjectReader::ptr | ( | ) | const |
This method returns a pointer to the SDMDataObject instance built during the execution of the read method.
SDMDataObjectReaderException. |
const SDMDataObject& asdmbinaries::SDMDataObjectReader::read | ( | std::string | filename | ) |
This method reads a MIME message contained in a disk file and returns a reference to an SDMDataObject.
filename | the name of the file to be read. |
SDMDataObjectReaderException |
const SDMDataObject& asdmbinaries::SDMDataObjectReader::read | ( | const char * | buffer, |
unsigned long int | size, | ||
bool | fromFile = false |
||
) |
This method reads a MIME message contained in a memory buffer and returns a reference to an SDMDataObject.
buffer | the adress of the buffer containing the MIME message. |
size | the size in bytes of that buffer. |
fromFile | a bool to indicate if the buffer is actually the result of a mapping of a file to virtual memory (false by default). |
SDMDataObjectReaderException |
const SDMDataObject& asdmbinaries::SDMDataObjectReader::ref | ( | ) | const |
This method returns a reference to the SDMDataObject instance built during the execution of the read method.
SDMDataObjectReaderException. |
|
private |
|
private |
|
private |
Definition at line 232 of file SDMDataObjectReader.h.
|
private |
Definition at line 230 of file SDMDataObjectReader.h.
|
private |
Definition at line 228 of file SDMDataObjectReader.h.
|
private |
Definition at line 242 of file SDMDataObjectReader.h.
|
staticprivate |
Set of valid binary attachment names.
Definition at line 204 of file SDMDataObjectReader.h.
|
staticprivate |
Definition at line 193 of file SDMDataObjectReader.h.
|
staticprivate |
Definition at line 194 of file SDMDataObjectReader.h.
|
staticprivate |
Definition at line 195 of file SDMDataObjectReader.h.
|
staticprivate |
Regular expressions used to identify a Content-ID field in a MIME header.
Definition at line 191 of file SDMDataObjectReader.h.
|
staticprivate |
Definition at line 192 of file SDMDataObjectReader.h.
|
private |
Definition at line 171 of file SDMDataObjectReader.h.
|
private |
Definition at line 170 of file SDMDataObjectReader.h.
|
private |
Definition at line 174 of file SDMDataObjectReader.h.
|
private |
Definition at line 169 of file SDMDataObjectReader.h.
|
private |
Definition at line 236 of file SDMDataObjectReader.h.
|
private |
Definition at line 240 of file SDMDataObjectReader.h.
|
staticprivate |
Definition at line 178 of file SDMDataObjectReader.h.
|
private |
Definition at line 176 of file SDMDataObjectReader.h.
|
private |
Definition at line 173 of file SDMDataObjectReader.h.
|
private |
Definition at line 238 of file SDMDataObjectReader.h.
|
staticprivate |
Two strings used as MIME boundaries.
Definition at line 186 of file SDMDataObjectReader.h.
|
staticprivate |
Definition at line 187 of file SDMDataObjectReader.h.
|
private |
Definition at line 233 of file SDMDataObjectReader.h.
|
private |
Definition at line 231 of file SDMDataObjectReader.h.
|
staticprivate |
Definition at line 206 of file SDMDataObjectReader.h.
|
private |
Definition at line 243 of file SDMDataObjectReader.h.
|
private |
Definition at line 241 of file SDMDataObjectReader.h.
|
private |
Definition at line 237 of file SDMDataObjectReader.h.
|
private |
Definition at line 235 of file SDMDataObjectReader.h.
|
private |
SDMDataObject related stuff.
Definition at line 224 of file SDMDataObjectReader.h.
|
private |
Definition at line 172 of file SDMDataObjectReader.h.
|
private |
Definition at line 167 of file SDMDataObjectReader.h.
|
private |
Definition at line 225 of file SDMDataObjectReader.h.
|
private |
Definition at line 239 of file SDMDataObjectReader.h.
|
private |
Definition at line 234 of file SDMDataObjectReader.h.