Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

VTQL::CModul Class Reference

Base class for all moduls. More...

#include <vtql_base.h>

Inheritance diagram for VTQL::CModul:

thread::CallBack::CBFunct VTQL::CEModul VTQL::CQModul VTQL::EM_PageAlevt VTQL::QM_PageAlevt VTQL::QM_PageL VTQL::QM_Stations List of all members.

Public Methods

virtual ~CModul ()
 Removes the modul form callback list of the connection.

 CModul (const CModul &)
 CModul (Connect &connection)
 Inserts this modul into the callback list. More...

virtual bool Wait (bool block=true)
 Wait for (some kind of) completion of the command. More...

virtual void operator() (const Arg &p)=0
 this function gets called at every server output line (callback). More...


Protected Methods

void StopCB ()
 Exclude this instance from callback list.

void StartCB ()
 Add this instance into callback list.

void Start_Query (const std::string &line)
 Send command to server. More...


Detailed Description

Base class for all moduls.

This class hides all the wired things of Connect, such as the Callback interface and the Connect::Process(bool) method. Its whole lifetime it is in the callback list, i.e. it gets called on every input line the method Connect::Process(bool) emits.


Constructor & Destructor Documentation

VTQL::CModul::CModul const CModul &   
 

Warning:
The copy constructer is not implemented.

VTQL::CModul::CModul Connect   connection [inline]
 

Inserts this modul into the callback list.

Parameters:
connection  The modul does all the i/o with this connection


Member Function Documentation

virtual bool VTQL::CModul::Wait bool    block = true [virtual]
 

Wait for (some kind of) completion of the command.

You can either wait (i.e. blocking) or just check for completion (i.e. nonblocking).

Parameters:
block  false: nonblocking ; true blocking
Returns:
true if command was completed, false otherwise

Reimplemented in VTQL::CEModul.

virtual void VTQL::CModul::operator() const Arg &    p [pure virtual]
 

this function gets called at every server output line (callback).

In detail, the Connection::Process(bool) funtion should call back it, unless you did not remove it from the callback list with StopCB().

The hard thing is to find out which are the output lines, you need. It is a good idea to exclude yourself from callback if the command output has been recieved via the StopCB() method.

Use the class CQModul for queries and configuration commands and use the class CEModul for event commands, since they solve a lot of trouble you may have with this base class :-)

Parameters:
p  The Arg type is std::pair<int,std::string>, its meaning depends on the overloaded method Connect::Process(bool), since this calls this callback.
See also:
Connect::Process(bool), Query_generic::Process(bool), Event_generic::Process(bool)

Implements thread::CallBack::CBFunct.

void VTQL::CModul::Start_Query const std::string &    line [inline, protected]
 

Send command to server.

It puts the command into the output queue of the connection. It does not try to send it to the server; call e.g. Wait(false) to do so.

Parameters:
line  VTQL command line (without newline)
See also:
EscapeString(std::string)


The documentation for this class was generated from the following file:
Generated on Sun Apr 14 17:37:04 2002 for libvtql by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002