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

Abstract class for global writers. More...

Inheritance diagram for QGlobalWriter:
QNamed LASCIIGlobalWriter LGuiSessionWriter LRootGlobalWriter

Public Member Functions

 QGlobalWriter (const std::string &name)
 constructor More...
 
virtual ~QGlobalWriter ()
 destructor More...
 
template<class Q >
QError Set (const std::string &name, const Q &obj, const std::string &descr="")
 Set QObject, owned by the caller, - leave it undeclared if you can't implement it. 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 QError SetQObject (const std::string &name, const std::string &className, const Diana::QObject *obj, const std::string &descr)=0
 
virtual QError Open (const std::string &filename, const std::string &opt="")=0
 Open file, called by QGlobalWriterDispatcher. More...
 
virtual QError Close ()=0
 Close file, called by QGlobalWriterDispatcher. More...
 

Friends

class QGlobalWriterDispatcher
 

Detailed Description

Abstract class for global writers.

Author
Marco Vignati

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

Global writers 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_WRITER(clazz, ext)

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

REGISTER_GLOBAL_WRITER(LMyGlobalWriter,".txt")

Definition at line 39 of file QGlobalWriter.hh.

Constructor & Destructor Documentation

◆ QGlobalWriter()

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

constructor

Definition at line 43 of file QGlobalWriter.hh.

◆ ~QGlobalWriter()

virtual QGlobalWriter::~QGlobalWriter ( )
inlinevirtual

destructor

Definition at line 46 of file QGlobalWriter.hh.

Member Function Documentation

◆ Close()

virtual QError QGlobalWriter::Close ( )
protectedpure virtual

◆ Open()

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

◆ Set()

template<class Q >
QError QGlobalWriter::Set ( const std::string &  name,
const Q &  obj,
const std::string &  descr = "" 
)
inline

Set QObject, owned by the caller, - leave it undeclared if you can't implement it.

Definition at line 49 of file QGlobalWriter.hh.

References Demangle(), and SetQObject().

Referenced by QRootFileWriterBase::Done(), QRootFileWriterBase::Dump(), and GlobalHandle< Q >::StoreOnFile().

◆ SetQObject()

virtual QError QGlobalWriter::SetQObject ( const std::string &  name,
const std::string &  className,
const Diana::QObject *  obj,
const std::string &  descr 
)
protectedpure virtual

Implemented in LRootGlobalWriter, LGuiSessionWriter, and LASCIIGlobalWriter.

Referenced by Set().

Friends And Related Function Documentation

◆ QGlobalWriterDispatcher

friend class QGlobalWriterDispatcher
friend

Definition at line 63 of file QGlobalWriter.hh.


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