SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
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 Symbols

(Note that these are not member symbols.)

#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>
"accessLib", "Servername", "Username", "Password", "DatabaseName",
RWDBDATABASECALLBACK(MyDBaseCallbackImp));
#define RWDBDATABASECALLBACK(CALLBACK)
Definition dbasecb.h:40
Manages connections with database servers.
Definition dbase.h:91
static RWDBDatabase database(const RWCString &serverType, const RWCString &serverName, const RWCString &userName, const RWCString &password, const RWCString &databaseName, const RWDBDatabaseCallback &databasecb=RWDBDatabaseCallback())

Constructor & Destructor Documentation

◆ RWDBDatabaseCallback() [1/2]

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() [2/2]

RWDBDatabaseCallback::RWDBDatabaseCallback ( const RWDBDatabaseCallback & dbasecb)
inline

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

Member Function Documentation

◆ operator()()

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

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

◆ operator=()

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

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

◆ status()

RWDBStatus RWDBDatabaseCallback::status ( ) const
inline

Returns the current status of self.

Friends And Related Symbol Documentation

◆ RWDBDATABASECALLBACK

#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 © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.