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

VTQL::Query_generic Class Reference

For handling connection in query or configuration mode, you will need a connection provieded by this class. More...

#include <vtql_query.h>

Inheritance diagram for VTQL::Query_generic:

VTQL::Connect List of all members.

Public Methods

virtual ~Query_generic ()
 Query_generic (const std::string &file_name)
 Open a connection to a server. More...

 Query_generic (const sock::Socket_basic &s)
 Open a connection to a server (advanced). More...

virtual bool Process (bool block)
 This method gets called the query moduls. More...

virtual Connectoperator<< (const std::string &s)
size_t LatestWriteID () const
 Get the command ID of the latest command, you put with operator<<(const std::string).

size_t LatestReadID () const
 Get the command ID of the latest processed command. More...


Detailed Description

For handling connection in query or configuration mode, you will need a connection provieded by this class.

Usually you do only care about make an instance of this class and pass it to the query moduls. The only non-trivial aspect of this class is, that it gives any command an ID and you get the ID of an command output, so that you can easily identify the output of your command. This is done by the CQModul class.


Constructor & Destructor Documentation

VTQL::Query_generic::Query_generic const std::string &    file_name
 

Open a connection to a server.

As you may suspect, this connection has to be either in query or connection mode.

Parameters:
file_name  File name of a socket of VTQLserver

VTQL::Query_generic::Query_generic const sock::Socket_basic   s
 

Open a connection to a server (advanced).

If you have an file descriptor and it is connected to a server, you can use this constructor. As you may suspect, this connection has to be either in query or connection mode.

Parameters:
file_descriptor  A file descriptor that is connected to a VTQLserver.
See also:
sock::Socket_basic::Socket_basic(int), sock::Socket_basic::operator int()


Member Function Documentation

virtual bool VTQL::Query_generic::Process bool    block [virtual]
 

This method gets called the query moduls.

This method handles the incomming data and sends anything in the output queue. It calls the callback, where the argument pair is

  • (>0,line) A normal line (not a error message and not SUCCESS or VOID or ERROR).
    1. the line number, stating with 1
    2. the line itself (without newline character)
  • (0,"") The Command was successfully completed.
  • (-1,"") The Command was void.
  • (-2,Error) Error on command execution.
    1. -2
    2. error string
Parameters:
block  true: blocking ; false: nonblocking i/o
Returns:
true if a command was completed read

Implements VTQL::Connect.

size_t VTQL::Query_generic::LatestReadID   const [inline]
 

Get the command ID of the latest processed command.

It is already set before the callbacks ar called, so you can find out, which ID the current line has.


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