Diana Software
Public Member Functions | Protected Member Functions | Friends | List of all members
QGlobalReader Class Referenceabstract

Abstract class for global readers. More...

Inheritance diagram for QGlobalReader:
QNamed LASCIIGlobalReader LGuiSessionReader LHDRGlobalReader LRootGlobalReader

Public Member Functions

 QGlobalReader (const std::string &name)
 constructor More...
 
virtual ~QGlobalReader ()
 destructor More...
 
template<class Q >
const Q * Get (const std::string &name, QError &err) const
 Get QObject, owned by this reader. More...
 
template<class Q >
const Q * Get (const Diana::QGlobalLabel &label, QError &err) const
 Get QObject, owned by this reader. More...
 
- Public Member Functions inherited from QNamed
 QNamed ()
 
 QNamed (const std::string &Name)
 
virtual ~QNamed ()
 
const std::string & GetName () const
 
void SetName (const std::string &name)
 

Protected Member Functions

virtual const Diana::QObject * GetQObject (const std::string &, const std::string &, QError &err) const
 
virtual const Diana::QObject * GetQObject (const Diana::QGlobalLabel &label, const std::string &className, QError &err) const
 
virtual QError Open (const std::string &filename, const std::string &opt="")=0
 Open file, called by QGlobalReaderDispatcher. More...
 
virtual QError Close ()=0
 Close file, called by QGlobalReaderDispatcher. More...
 

Friends

class QGlobalReaderDispatcher
 

Detailed Description

Abstract class for global readers.

Author
Marco Vignati

Global readers are managed by the QGlobalReaderDispatcher class that
takes care of file opening and closing when it is necessary.

Global readers have to prepend an "L" to their names as they are
loadable plugins. In the implementation file the following macro
not followed by semicolon have to be used in order to generate the
code needed by the QGlobalRWFactory:

REGISTER_GLOBAL_READER(clazz, ext)

where clazz is the clazz name without "" and ext is the file extension
that identifies the file types that this reader can manage.
Exemplum for the text file reader LMyGlobalReader:

REGISTER_GLOBAL_READER(LMyGlobalReader,".txt")

Definition at line 44 of file QGlobalReader.hh.

Constructor & Destructor Documentation

◆ QGlobalReader()

QGlobalReader::QGlobalReader ( const std::string &  name)
inline

constructor

Definition at line 48 of file QGlobalReader.hh.

◆ ~QGlobalReader()

virtual QGlobalReader::~QGlobalReader ( )
inlinevirtual

destructor

Definition at line 51 of file QGlobalReader.hh.

Member Function Documentation

◆ Close()

virtual QError QGlobalReader::Close ( )
protectedpure virtual

◆ Get() [1/2]

template<class Q >
const Q* QGlobalReader::Get ( const Diana::QGlobalLabel &  label,
QError err 
) const
inline

Get QObject, owned by this reader.

Definition at line 70 of file QGlobalReader.hh.

References Demangle(), err, GetQObject(), and QERR_TYPE_CONVERSION.

◆ Get() [2/2]

template<class Q >
const Q* QGlobalReader::Get ( const std::string &  name,
QError err 
) const
inline

Get QObject, owned by this reader.

Definition at line 54 of file QGlobalReader.hh.

References Demangle(), err, GetQObject(), and QERR_TYPE_CONVERSION.

Referenced by GlobalHandle< Q >::FillFromFile().

◆ GetQObject() [1/2]

virtual const Diana::QObject* QGlobalReader::GetQObject ( const Diana::QGlobalLabel &  label,
const std::string &  className,
QError err 
) const
inlineprotectedvirtual

Definition at line 95 of file QGlobalReader.hh.

References err, and GetQObject().

◆ GetQObject() [2/2]

virtual const Diana::QObject* QGlobalReader::GetQObject ( const std::string &  ,
const std::string &  ,
QError err 
) const
inlineprotectedvirtual

Reimplemented in LRootGlobalReader, LHDRGlobalReader, LGuiSessionReader, and LASCIIGlobalReader.

Definition at line 88 of file QGlobalReader.hh.

References err, QNamed::GetName(), and QERR_NOT_IMPLEMENTED.

Referenced by Get(), and GetQObject().

◆ Open()

virtual QError QGlobalReader::Open ( const std::string &  filename,
const std::string &  opt = "" 
)
protectedpure virtual

Friends And Related Function Documentation

◆ QGlobalReaderDispatcher

friend class QGlobalReaderDispatcher
friend

Definition at line 106 of file QGlobalReader.hh.


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