casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Types | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TableSAXReader< T, R, RFilter > Class Template Reference

#include <asdm2MSGeneric.h>

Public Member Functions

 TableSAXReader (bool verbose, RFilter &rFilter, TableFiller tableFiller_f_p, std::map< AtmPhaseCorrectionMod::AtmPhaseCorrection, ASDM2MSFiller * > &msFillers_m)
 An empty contructor. More...
 
 ~TableSAXReader ()
 The destructor. More...
 
void operator() (const std::string &asdmDirectory, bool ignoreTime)
 It will be used as a functor. More...
 

Static Public Member Functions

static void start_element_callback (void *v_p, const xmlChar *name, const xmlChar **)
 Defines the action to perform when an event "opening tag" occurs. More...
 
static void end_element_callback (void *v_p, const xmlChar *name)
 Defines the action to perform when an event "closing tag" occurs. More...
 
static void characters_callback (void *v_p, const xmlChar *ch, int len)
 Defines the action to be performed while parsing any text outside of a tag. More...
 

Private Types

typedef void(* TableFiller )(const std::vector< R * > &, std::map< AtmPhaseCorrectionMod::AtmPhaseCorrection, ASDM2MSFiller * > &)
 

Static Private Member Functions

static xmlSAXHandler initSAXHandler ()
 
static void error (const std::string &message)
 
static void unexpectedOpeningElement (const xmlChar *name, const xmlChar *expectedName)
 
static void unexpectedClosingElement (const xmlChar *name)
 
static void checkOpeningElement (const xmlChar *name, const xmlChar *expectedName)
 
static void checkClosingElement (const xmlChar *name, const xmlChar *expectedName)
 
static void enterElementInfo (void *v_p, const xmlChar *name)
 
static void exitElementInfo (void *v_p, const xmlChar *name)
 

Private Attributes

bool verbose
 
ParserContext< T, R, RFilter > myContext
 
std::string topLevelElement_s
 
asdm::ASDM asdm
 

Static Private Attributes

static xmlSAXHandler myHandler
 

Detailed Description

template<class T, class R, class RFilter>
class TableSAXReader< T, R, RFilter >

Definition at line 248 of file asdm2MSGeneric.h.

Member Typedef Documentation

template<class T , class R , class RFilter >
typedef void(* TableSAXReader< T, R, RFilter >::TableFiller)(const std::vector< R * > &, std::map< AtmPhaseCorrectionMod::AtmPhaseCorrection, ASDM2MSFiller * > &)
private

Definition at line 250 of file asdm2MSGeneric.h.

Constructor & Destructor Documentation

template<class T , class R , class RFilter >
TableSAXReader< T, R, RFilter >::TableSAXReader ( bool  verbose,
RFilter &  rFilter,
TableFiller  tableFiller_f_p,
std::map< AtmPhaseCorrectionMod::AtmPhaseCorrection, ASDM2MSFiller * > &  msFillers_m 
)
inline
template<class T , class R , class RFilter >
TableSAXReader< T, R, RFilter >::~TableSAXReader ( )
inline

The destructor.

Definition at line 281 of file asdm2MSGeneric.h.

Member Function Documentation

template<class T , class R , class RFilter >
static void TableSAXReader< T, R, RFilter >::characters_callback ( void *  v_p,
const xmlChar ch,
int  len 
)
inlinestatic

Defines the action to be performed while parsing any text outside of a tag.

Normally his occurs only when an attribute is parsed.

Definition at line 461 of file asdm2MSGeneric.h.

References V2CTX_P.

Referenced by TableSAXReader< T, R, RFilter >::initSAXHandler().

template<class T , class R , class RFilter >
static void TableSAXReader< T, R, RFilter >::checkClosingElement ( const xmlChar name,
const xmlChar expectedName 
)
inlinestaticprivate
template<class T , class R , class RFilter >
static void TableSAXReader< T, R, RFilter >::checkOpeningElement ( const xmlChar name,
const xmlChar expectedName 
)
inlinestaticprivate
template<class T , class R , class RFilter >
static void TableSAXReader< T, R, RFilter >::end_element_callback ( void *  v_p,
const xmlChar name 
)
inlinestatic

Defines the action to perform when an event "closing tag" occurs.

We are right after a <row>..</row>

Possibly write some remainings rows by applying tableFiller on the vector.

Log a minimum of information about what has just happened.

Empty the vector before reading new rows.

We were in an <Entity> element.

We were in a <ContainerEntity> element.

We were in a <row>..</row> element.

Push the last parsed row into the vector.

If the size of this vector is equal to the maximum number allowed to reside in memory then proceed by applying tableFiller on on the vector and after that clear the vector.

Log a minimum of information about what has just happened.

We were in an element located in a <row>..</row>, which is normally an attribute.

Definition at line 360 of file asdm2MSGeneric.h.

References TableSAXReader< T, R, RFilter >::checkClosingElement(), debug, TableSAXReader< T, R, RFilter >::error(), TableSAXReader< T, R, RFilter >::exitElementInfo(), getexepath(), casacore::LogMessage::NORMAL, casacore::LogSink::postGlobally(), V2CTX_P, and WHERE.

Referenced by TableSAXReader< T, R, RFilter >::initSAXHandler().

template<class T , class R , class RFilter >
static void TableSAXReader< T, R, RFilter >::enterElementInfo ( void *  v_p,
const xmlChar name 
)
inlinestaticprivate

Definition at line 504 of file asdm2MSGeneric.h.

References V2CTX_P.

Referenced by TableSAXReader< T, R, RFilter >::start_element_callback().

template<class T , class R , class RFilter >
static void TableSAXReader< T, R, RFilter >::error ( const std::string &  message)
inlinestaticprivate
template<class T , class R , class RFilter >
static void TableSAXReader< T, R, RFilter >::exitElementInfo ( void *  v_p,
const xmlChar name 
)
inlinestaticprivate

Definition at line 508 of file asdm2MSGeneric.h.

References V2CTX_P.

Referenced by TableSAXReader< T, R, RFilter >::end_element_callback().

template<class T , class R , class RFilter >
static xmlSAXHandler TableSAXReader< T, R, RFilter >::initSAXHandler ( )
inlinestaticprivate
template<class T , class R , class RFilter >
void TableSAXReader< T, R, RFilter >::operator() ( const std::string &  asdmDirectory,
bool  ignoreTime 
)
inline

It will be used as a functor.

Definition at line 286 of file asdm2MSGeneric.h.

References TableSAXReader< T, R, RFilter >::myContext, TableSAXReader< T, R, RFilter >::myHandler, and casa::name().

template<class T , class R , class RFilter >
static void TableSAXReader< T, R, RFilter >::start_element_callback ( void *  v_p,
const xmlChar name,
const xmlChar **   
)
inlinestatic

Defines the action to perform when an event "opening tag" occurs.

We are right before the toplevel element of the XML document.

We are right after the toplevel element of the XML document.

We are right after the <Entity.../> element.

We are right after the <ContainerEntity.../> element or a <row>..</row> element.

We are inside a <row>...</row> but outside any element contained in that element.

We are inside a element contained in a <row>...</row> element.

Otherwise we have a problem.

Definition at line 296 of file asdm2MSGeneric.h.

References TableSAXReader< T, R, RFilter >::checkOpeningElement(), debug, TableSAXReader< T, R, RFilter >::enterElementInfo(), TableSAXReader< T, R, RFilter >::error(), casa::name(), and V2CTX_P.

Referenced by TableSAXReader< T, R, RFilter >::initSAXHandler().

template<class T , class R , class RFilter >
static void TableSAXReader< T, R, RFilter >::unexpectedClosingElement ( const xmlChar name)
inlinestaticprivate
template<class T , class R , class RFilter >
static void TableSAXReader< T, R, RFilter >::unexpectedOpeningElement ( const xmlChar name,
const xmlChar expectedName 
)
inlinestaticprivate

Member Data Documentation

template<class T , class R , class RFilter >
asdm::ASDM TableSAXReader< T, R, RFilter >::asdm
private

Definition at line 472 of file asdm2MSGeneric.h.

Referenced by TableSAXReader< T, R, RFilter >::TableSAXReader().

template<class T , class R , class RFilter >
ParserContext<T, R, RFilter> TableSAXReader< T, R, RFilter >::myContext
private
template<class T , class R , class RFilter >
xmlSAXHandler TableSAXReader< T, R, RFilter >::myHandler
staticprivate

Definition at line 473 of file asdm2MSGeneric.h.

Referenced by TableSAXReader< T, R, RFilter >::operator()().

template<class T , class R , class RFilter >
std::string TableSAXReader< T, R, RFilter >::topLevelElement_s
private

Definition at line 471 of file asdm2MSGeneric.h.

Referenced by TableSAXReader< T, R, RFilter >::TableSAXReader().

template<class T , class R , class RFilter >
bool TableSAXReader< T, R, RFilter >::verbose
private

Definition at line 469 of file asdm2MSGeneric.h.

Referenced by TableSAXReader< T, R, RFilter >::TableSAXReader().


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