casa
$Rev:20696$
|
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. | |
virtual | ~SDMDataObjectReader () |
The destructor. | |
const SDMDataObject & | read (string filename) |
This method reads a MIME message contained in a disk file and returns a reference to an SDMDataObject. | |
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. | |
const SDMDataObject & | ref () const |
This method returns a reference to the SDMDataObject instance built during the execution of the read method. | |
const SDMDataObject * | ptr () const |
This method returns a pointer to the SDMDataObject instance built during the execution of the read method. | |
void | done () |
A method to release the resources allocated by the read operation. | |
SDMDataObjectReader () | |
An empty constructor. | |
virtual | ~SDMDataObjectReader () |
The destructor. | |
const SDMDataObject & | read (string filename) |
This method reads a MIME message contained in a disk file and returns a reference to an SDMDataObject. | |
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. | |
const SDMDataObject & | ref () const |
This method returns a reference to the SDMDataObject instance built during the execution of the read method. | |
const SDMDataObject * | ptr () const |
This method returns a pointer to the SDMDataObject instance built during the execution of the read method. | |
void | done () |
A method to release the resources allocated by the read operation. | |
Private Types | |
enum | READ { UNKNOWN_, MEMORY_, FILE_, UNKNOWN_, MEMORY_, FILE_ } |
enum | BINATTACHCODES { ACTUALDURATIONS, ACTUALTIMES, AUTODATA, FLAGS, CROSSDATA, ZEROLAGS, ACTUALDURATIONS, ACTUALTIMES, AUTODATA, FLAGS, CROSSDATA, ZEROLAGS } |
enum | READ { UNKNOWN_, MEMORY_, FILE_, UNKNOWN_, MEMORY_, FILE_ } |
enum | BINATTACHCODES { ACTUALDURATIONS, ACTUALTIMES, AUTODATA, FLAGS, CROSSDATA, ZEROLAGS, ACTUALDURATIONS, ACTUALTIMES, AUTODATA, FLAGS, CROSSDATA, ZEROLAGS } |
Private Member Functions | |
void | init () |
string::size_type | find (const string &s) |
bool | compare (const string &s) |
bool | EOD () |
string | extractXMLHeader (const string &boundary) |
void | tokenize (const string &str, vector< string > &tokens, const string &delimiters) |
void | getFields (const string &header, map< string, string > &fields) |
string | getContentID () |
string | getContentLocation () |
void | processMIME () |
void | processMIMESDMDataHeader () |
void | processMIMESDMDataSubsetHeader (SDMDataSubset &sdmDataSubset) |
void | processMIMEIntegrations () |
void | processMIMEIntegration () |
void | processMIMESubscan () |
void | processBinaryAttachment (const string &boundary, const SDMDataSubset &sdmDataSubset) |
const SDMDataObject & | sdmDataObject () |
void | init () |
string::size_type | find (const string &s) |
bool | compare (const string &s) |
bool | EOD () |
string | extractXMLHeader (const string &boundary) |
void | tokenize (const string &str, vector< string > &tokens, const string &delimiters) |
void | getFields (const string &header, map< string, string > &fields) |
string | getContentID () |
string | getContentLocation () |
void | processMIME () |
void | processMIMESDMDataHeader () |
void | processMIMESDMDataSubsetHeader (SDMDataSubset &sdmDataSubset) |
void | processMIMEIntegrations () |
void | processMIMEIntegration () |
void | processMIMESubscan () |
void | processBinaryAttachment (const string &boundary, const SDMDataSubset &sdmDataSubset) |
const SDMDataObject & | sdmDataObject () |
Static Private Member Functions | |
static bool | initClass () |
static bool | initClass () |
Private Attributes | |
READ | read_ |
int | filedes_ |
unsigned int | dataSize_ |
char * | data_ |
string::size_type | position_ |
string::size_type | lastPosition_ |
string::size_type | endPosition_ |
unsigned int | integrationNum_ |
unsigned int | scanNum_ |
SDMDataObjectParser | parser_ |
SDMDataObject related stuff. | |
SDMDataObject | sdmDataObject_ |
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 string | MIMEBOUNDARY_1 |
Two strings used as MIME boundaries. | |
static const string | MIMEBOUNDARY_2 |
static const regex | CONTENTIDDATASTRUCTUREREGEXP |
Regular expressions used to identify a Content-ID field in a MIME header. | |
static const regex | CONTENTIDSUBSETREGEXP |
static const regex | CONTENTIDBINREGEXP |
static const regex | CONTENTIDBINREGEXP1 |
static const regex | CONTENTIDBINREGEXP2 |
static set< string > | BINATTACHNAMES |
Set of valid binary attachment names. | |
static map< 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 112 of file SDMDataObjectReader.h.
enum asdmbinaries::SDMDataObjectReader::BINATTACHCODES [private] |
ACTUALDURATIONS | |
ACTUALTIMES | |
AUTODATA | |
FLAGS | |
CROSSDATA | |
ZEROLAGS | |
ACTUALDURATIONS | |
ACTUALTIMES | |
AUTODATA | |
FLAGS | |
CROSSDATA | |
ZEROLAGS |
Definition at line 200 of file SDMDataObjectReader.h.
enum asdmbinaries::SDMDataObjectReader::BINATTACHCODES [private] |
ACTUALDURATIONS | |
ACTUALTIMES | |
AUTODATA | |
FLAGS | |
CROSSDATA | |
ZEROLAGS | |
ACTUALDURATIONS | |
ACTUALTIMES | |
AUTODATA | |
FLAGS | |
CROSSDATA | |
ZEROLAGS |
Definition at line 200 of file SDMDataObjectReader.h.
enum asdmbinaries::SDMDataObjectReader::READ [private] |
Definition at line 167 of file SDMDataObjectReader.h.
enum asdmbinaries::SDMDataObjectReader::READ [private] |
Definition at line 167 of file SDMDataObjectReader.h.
An empty constructor.
virtual asdmbinaries::SDMDataObjectReader::~SDMDataObjectReader | ( | ) | [virtual] |
The destructor.
An empty constructor.
virtual asdmbinaries::SDMDataObjectReader::~SDMDataObjectReader | ( | ) | [virtual] |
The destructor.
bool asdmbinaries::SDMDataObjectReader::compare | ( | const string & | s | ) | [private] |
bool asdmbinaries::SDMDataObjectReader::compare | ( | const string & | s | ) | [private] |
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.
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.
bool asdmbinaries::SDMDataObjectReader::EOD | ( | ) | [private] |
bool asdmbinaries::SDMDataObjectReader::EOD | ( | ) | [private] |
string asdmbinaries::SDMDataObjectReader::extractXMLHeader | ( | const string & | boundary | ) | [private] |
string asdmbinaries::SDMDataObjectReader::extractXMLHeader | ( | const string & | boundary | ) | [private] |
string::size_type asdmbinaries::SDMDataObjectReader::find | ( | const string & | s | ) | [private] |
string::size_type asdmbinaries::SDMDataObjectReader::find | ( | const string & | s | ) | [private] |
string asdmbinaries::SDMDataObjectReader::getContentID | ( | ) | [private] |
string asdmbinaries::SDMDataObjectReader::getContentID | ( | ) | [private] |
string asdmbinaries::SDMDataObjectReader::getContentLocation | ( | ) | [private] |
string asdmbinaries::SDMDataObjectReader::getContentLocation | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::getFields | ( | const string & | header, |
map< string, string > & | fields | ||
) | [private] |
void asdmbinaries::SDMDataObjectReader::getFields | ( | const string & | header, |
map< string, string > & | fields | ||
) | [private] |
void asdmbinaries::SDMDataObjectReader::init | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::init | ( | ) | [private] |
static bool asdmbinaries::SDMDataObjectReader::initClass | ( | ) | [static, private] |
static bool asdmbinaries::SDMDataObjectReader::initClass | ( | ) | [static, private] |
void asdmbinaries::SDMDataObjectReader::processBinaryAttachment | ( | const string & | boundary, |
const SDMDataSubset & | sdmDataSubset | ||
) | [private] |
void asdmbinaries::SDMDataObjectReader::processBinaryAttachment | ( | const string & | boundary, |
const SDMDataSubset & | sdmDataSubset | ||
) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIME | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIME | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIMEIntegration | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIMEIntegration | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIMEIntegrations | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIMEIntegrations | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIMESDMDataHeader | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIMESDMDataHeader | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIMESDMDataSubsetHeader | ( | SDMDataSubset & | sdmDataSubset | ) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIMESDMDataSubsetHeader | ( | SDMDataSubset & | sdmDataSubset | ) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIMESubscan | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::processMIMESubscan | ( | ) | [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::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 | ( | 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 | ( | 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::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. |
const SDMDataObject& asdmbinaries::SDMDataObjectReader::ref | ( | ) | const |
This method returns a reference to the SDMDataObject instance built during the execution of the read method.
SDMDataObjectReaderException. |
const SDMDataObject& asdmbinaries::SDMDataObjectReader::sdmDataObject | ( | ) | [private] |
const SDMDataObject& asdmbinaries::SDMDataObjectReader::sdmDataObject | ( | ) | [private] |
void asdmbinaries::SDMDataObjectReader::tokenize | ( | const string & | str, |
vector< string > & | tokens, | ||
const string & | delimiters | ||
) | [private] |
void asdmbinaries::SDMDataObjectReader::tokenize | ( | const string & | str, |
vector< string > & | tokens, | ||
const string & | delimiters | ||
) | [private] |
const ACTUALDURATIONSTYPE * asdmbinaries::SDMDataObjectReader::actualDurations_ [private] |
Definition at line 227 of file SDMDataObjectReader.h.
const ACTUALTIMESTYPE * asdmbinaries::SDMDataObjectReader::actualTimes_ [private] |
Definition at line 225 of file SDMDataObjectReader.h.
bitset< 6 > asdmbinaries::SDMDataObjectReader::attachmentFlags [private] |
Definition at line 223 of file SDMDataObjectReader.h.
const AUTODATATYPE * asdmbinaries::SDMDataObjectReader::autoData_ [private] |
Definition at line 237 of file SDMDataObjectReader.h.
static set< string > asdmbinaries::SDMDataObjectReader::BINATTACHNAMES [static, private] |
Set of valid binary attachment names.
Definition at line 199 of file SDMDataObjectReader.h.
static const regex asdmbinaries::SDMDataObjectReader::CONTENTIDBINREGEXP [static, private] |
Definition at line 194 of file SDMDataObjectReader.h.
static const regex asdmbinaries::SDMDataObjectReader::CONTENTIDBINREGEXP1 [static, private] |
Definition at line 195 of file SDMDataObjectReader.h.
static const regex asdmbinaries::SDMDataObjectReader::CONTENTIDBINREGEXP2 [static, private] |
Definition at line 196 of file SDMDataObjectReader.h.
static const regex asdmbinaries::SDMDataObjectReader::CONTENTIDDATASTRUCTUREREGEXP [static, private] |
Regular expressions used to identify a Content-ID field in a MIME header.
Definition at line 192 of file SDMDataObjectReader.h.
static const regex asdmbinaries::SDMDataObjectReader::CONTENTIDSUBSETREGEXP [static, private] |
Definition at line 193 of file SDMDataObjectReader.h.
char * asdmbinaries::SDMDataObjectReader::data_ [private] |
Definition at line 172 of file SDMDataObjectReader.h.
unsigned int asdmbinaries::SDMDataObjectReader::dataSize_ [private] |
Definition at line 171 of file SDMDataObjectReader.h.
string::size_type asdmbinaries::SDMDataObjectReader::endPosition_ [private] |
Definition at line 175 of file SDMDataObjectReader.h.
int asdmbinaries::SDMDataObjectReader::filedes_ [private] |
Definition at line 170 of file SDMDataObjectReader.h.
const FLAGSTYPE * asdmbinaries::SDMDataObjectReader::flags_ [private] |
Definition at line 231 of file SDMDataObjectReader.h.
const FLOATCROSSDATATYPE * asdmbinaries::SDMDataObjectReader::floatCrossData_ [private] |
Definition at line 235 of file SDMDataObjectReader.h.
static const bool asdmbinaries::SDMDataObjectReader::initClass_ [static, private] |
Definition at line 180 of file SDMDataObjectReader.h.
unsigned int asdmbinaries::SDMDataObjectReader::integrationNum_ [private] |
Definition at line 177 of file SDMDataObjectReader.h.
string::size_type asdmbinaries::SDMDataObjectReader::lastPosition_ [private] |
Definition at line 174 of file SDMDataObjectReader.h.
const INTCROSSDATATYPE * asdmbinaries::SDMDataObjectReader::longCrossData_ [private] |
Definition at line 233 of file SDMDataObjectReader.h.
static const string asdmbinaries::SDMDataObjectReader::MIMEBOUNDARY_1 [static, private] |
Two strings used as MIME boundaries.
Definition at line 188 of file SDMDataObjectReader.h.
static const string asdmbinaries::SDMDataObjectReader::MIMEBOUNDARY_2 [static, private] |
Definition at line 189 of file SDMDataObjectReader.h.
unsigned long int asdmbinaries::SDMDataObjectReader::nActualDurations_ [private] |
Definition at line 228 of file SDMDataObjectReader.h.
unsigned long int asdmbinaries::SDMDataObjectReader::nActualTimes_ [private] |
Definition at line 226 of file SDMDataObjectReader.h.
static map< string, BINATTACHCODES > asdmbinaries::SDMDataObjectReader::name2code [static, private] |
Definition at line 201 of file SDMDataObjectReader.h.
unsigned long int asdmbinaries::SDMDataObjectReader::nAutoData_ [private] |
Definition at line 238 of file SDMDataObjectReader.h.
unsigned long int asdmbinaries::SDMDataObjectReader::nCrossData_ [private] |
Definition at line 236 of file SDMDataObjectReader.h.
unsigned long int asdmbinaries::SDMDataObjectReader::nFlags_ [private] |
Definition at line 232 of file SDMDataObjectReader.h.
unsigned long int asdmbinaries::SDMDataObjectReader::nZeroLags_ [private] |
Definition at line 230 of file SDMDataObjectReader.h.
SDMDataObject related stuff.
Definition at line 219 of file SDMDataObjectReader.h.
string::size_type asdmbinaries::SDMDataObjectReader::position_ [private] |
Definition at line 173 of file SDMDataObjectReader.h.
READ asdmbinaries::SDMDataObjectReader::read_ [private] |
Definition at line 168 of file SDMDataObjectReader.h.
unsigned int asdmbinaries::SDMDataObjectReader::scanNum_ [private] |
Definition at line 178 of file SDMDataObjectReader.h.
Definition at line 220 of file SDMDataObjectReader.h.
const SHORTCROSSDATATYPE * asdmbinaries::SDMDataObjectReader::shortCrossData_ [private] |
Definition at line 234 of file SDMDataObjectReader.h.
const ZEROLAGSTYPE * asdmbinaries::SDMDataObjectReader::zeroLags_ [private] |
Definition at line 229 of file SDMDataObjectReader.h.