asdmbinaries::SDMDataObjectReader Class Reference
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>
List of all members.
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.
|
Private Types |
enum | READ {
UNKNOWN_,
MEMORY_,
FILE_
} |
enum | BINATTACHCODES {
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 () |
Static Private Member Functions |
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 |
Detailed Description
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.
Member Enumeration Documentation
- Enumerator:
ACTUALDURATIONS |
|
ACTUALTIMES |
|
AUTODATA |
|
FLAGS |
|
CROSSDATA |
|
ZEROLAGS |
|
Definition at line 200 of file SDMDataObjectReader.h.
Constructor & Destructor Documentation
asdmbinaries::SDMDataObjectReader::SDMDataObjectReader |
( |
|
) |
|
virtual asdmbinaries::SDMDataObjectReader::~SDMDataObjectReader |
( |
|
) |
[virtual] |
Member Function Documentation
bool asdmbinaries::SDMDataObjectReader::compare |
( |
const string & |
s |
) |
[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.
bool asdmbinaries::SDMDataObjectReader::EOD |
( |
|
) |
[private] |
string asdmbinaries::SDMDataObjectReader::extractXMLHeader |
( |
const string & |
boundary |
) |
[private] |
string::size_type asdmbinaries::SDMDataObjectReader::find |
( |
const string & |
s |
) |
[private] |
string asdmbinaries::SDMDataObjectReader::getContentID |
( |
|
) |
[private] |
string asdmbinaries::SDMDataObjectReader::getContentLocation |
( |
|
) |
[private] |
void asdmbinaries::SDMDataObjectReader::getFields |
( |
const string & |
header, |
|
|
map< string, string > & |
fields | |
|
) |
| | [private] |
void asdmbinaries::SDMDataObjectReader::init |
( |
|
) |
[private] |
static bool asdmbinaries::SDMDataObjectReader::initClass |
( |
|
) |
[static, private] |
void asdmbinaries::SDMDataObjectReader::processBinaryAttachment |
( |
const string & |
boundary, |
|
|
const SDMDataSubset & |
sdmDataSubset | |
|
) |
| | [private] |
void asdmbinaries::SDMDataObjectReader::processMIME |
( |
|
) |
[private] |
void asdmbinaries::SDMDataObjectReader::processMIMEIntegration |
( |
|
) |
[private] |
void asdmbinaries::SDMDataObjectReader::processMIMEIntegrations |
( |
|
) |
[private] |
void asdmbinaries::SDMDataObjectReader::processMIMESDMDataHeader |
( |
|
) |
[private] |
void asdmbinaries::SDMDataObjectReader::processMIMESDMDataSubsetHeader |
( |
SDMDataSubset & |
sdmDataSubset |
) |
[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.
- Returns:
- a reference to an SDMDataObject.
- Exceptions:
-
| 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.
- Parameters:
-
| 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). |
- Returns:
- a reference to an SDMDataObject built during the read operation.
- Exceptions:
-
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.
- Parameters:
-
| filename | the name of the file to be read. |
- Returns:
- a reference to an SDMDataObject built during the read operation.
- Exceptions:
-
const SDMDataObject& asdmbinaries::SDMDataObjectReader::ref |
( |
|
) |
const |
This method returns a reference to the SDMDataObject instance built during the execution of the read method.
- Returns:
- a reference to an SDMDataObject.
- Exceptions:
-
| SDMDataObjectReaderException. | |
const SDMDataObject& asdmbinaries::SDMDataObjectReader::sdmDataObject |
( |
|
) |
[private] |
void asdmbinaries::SDMDataObjectReader::tokenize |
( |
const string & |
str, |
|
|
vector< string > & |
tokens, |
|
|
const string & |
delimiters | |
|
) |
| | [private] |
Member Data Documentation
Regular expressions used to identify a Content-ID field in a MIME header.
Definition at line 192 of file SDMDataObjectReader.h.
The documentation for this class was generated from the following file: