SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Related Functions
RWDBDatabaseCallback Class Reference

Handle class for database callbacks, encapsulating a reference-counted pointer to the RWDBDatabaseCallbackImp body class. More...

#include <rw/db/dbasecb.h>

Public Member Functions

 RWDBDatabaseCallback ()
 
 RWDBDatabaseCallback (const RWDBDatabaseCallback &dbasecb)
 
RWDBDatabaseCallbackImpoperator() () const
 
RWDBDatabaseCallbackoperator= (const RWDBDatabaseCallback &dbasecb)
 
RWDBStatus status () const
 

Related Functions

(Note that these are not member functions.)

#define RWDBDATABASECALLBACK(CALLBACK)
 

Detailed Description

RWDBDatabaseCallback is the interface handle class for database callbacks that encapsulate a reference-counted pointer to the RWDBDatabaseCallbackImp body class. Please refer to the RWDBDatabaseCallbackImp class for implementing database callbacks.

Synopsis
#include <rw/db/dbasecb.h>
RWDBDatabase dBase =
RWDBManager::database("accessLib", "Servername",
"Username", "Password",
"DatabaseName",
RWDBDATABASECALLBACK(MyDBaseCallbackImp));

Constructor & Destructor Documentation

RWDBDatabaseCallback::RWDBDatabaseCallback ( )
inline

Default constructor that creates an uninitialized database callback with all callback methods as no-ops. The status of the RWDBDatabaseCallback will be RWDBStatus::notInitialized. This constructor is provided for convenience; usable RWDBDatabaseCallback objects must be obtained by using the macro RWDBDATABASECALLBACK(CALLBACK).

RWDBDatabaseCallback::RWDBDatabaseCallback ( const RWDBDatabaseCallback dbasecb)
inline

Copy constructor. The object created shares an implementation with dbasecb.

Member Function Documentation

RWDBDatabaseCallbackImp * RWDBDatabaseCallback::operator() ( ) const
inline

Returns a pointer to the database callback implementation encapsulated by self.

RWDBDatabaseCallback & RWDBDatabaseCallback::operator= ( const RWDBDatabaseCallback dbasecb)
inline

Assignment operator. Self shares an implementation with dbasecb. Returns a reference to self.

RWDBStatus RWDBDatabaseCallback::status ( ) const
inline

Returns the current status of self.

Friends And Related Function Documentation

#define RWDBDATABASECALLBACK (   CALLBACK)
related

The macro takes as argument the name of the user-implemented database callback implementation class. The user database callback implementation class must have been derived from the RWDBDatabaseCallbackImp class. Providing simply the name of the callback implementation class creates its instance using its default constructor. To use a different constructor, pass the class and parameter values. For example:

RWDBDATABASECALLBACK(MyDBaseCallbackImp(100, "abc"))

This macro must be used while supplying an instance of database callback implementation class in the method RWDBManager::database(). This macro ensures that a new instance of the database callback implementation class is produced.

Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.