CInteractor

Name

CInteractor -- Base class for security interactions.

Synopsis


#include <Interactor.h>
         
 class CInteractor {

  CInteractor();
  CInteractor(const CInteractor& aCInteractor);

  virtual ~CInteractor();

  CInteractor& operator=(const CInteractor& aCInteractor);
  virtual  = 0 int Read(UInt_t nBytes, void* pData);
  virtual  = 0  int Write(UInt_t nbytes, void* pData);
  virtual int ReadWithPrompt(UInt_t nPromptSize, void* pPrompt, UInt_t nReadSize, void* pReadData);
  virtual void Flush();
}

Description

CInteractor is an abstract base class for the objects that authentication objects use to acquire credentials from clients. The class provides a set of interfaces that all concrete interactor classes must implement.

In one sense, the CInteractor hierarchy models obtaining credentials from a client as operations on a bi-directional byte stream. Read, and Write methods allow the application to read and write data from the credential.

Public member functions

CInteractor();

Place holder for constructors.

CInteractor(const CInteractor& aCInteractor);

Place holder for copy constructors.

virtual ~CInteractor();

Establishes destructor chaining through the class hierarchy.

CInteractor& operator=(const CInteractor& aCInteractor);

Declares the intent of the class hierarchy to offer an assignment operator.

virtual = 0 int Read(UInt_t nBytes, void* pData);

Interface declaration for reading data from the interactor. nBytes is the number of bytes to attempt to read. pData Is a pointer to an output buffer into which the data will be read. The method is supposed to return the number of bytes that were actually read into pData. This may be no more than nBytes. In general, negative values indicate an error, and zero indicates that there is no data to read.

virtual = 0 int Write(UInt_t nbytes, void* pData);

Provides the interface for a method to write data to the interactor. nbytes is the number of bytes to write, while pData points to a buffer from which the data are written. The return value is the number of bytes actually written. This will be negative for errors, zero if no data could be written, and some number that is at most nbytes if data transfer took place.

virtual int ReadWithPrompt(UInt_t nPromptSize, void* pPrompt, UInt_t nReadSize, void* pReadData);

A convenienece method for first writing a prompt string and then reading a response from the interactor. nPromptSize and pPrompt describe the prompt string and nReadSize and pReadData the input buffer for the response. The method is supposed to return the number of bytes read from the interactor. This will be have values like those of the Read method.

The default implementation is a write followed by a read.

virtual void Flush();

This member function supports flushing any output buffered in the interactor. The default implementation does nothing which is suitable for unbuffered interactors.