SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWDBConnCallback Class Reference

Handle class for connection callbacks that encapsulate a reference-counted pointer to the RWDBConnCallbackImp body class. More...

#include <rw/db/conncb.h>

Public Member Functions

 RWDBConnCallback ()
 
 RWDBConnCallback (const RWDBConnCallback &conncb)
 
RWDBDatabaseCallback databaseCallback () const
 
RWDBConnCallbackImpoperator() () const
 
RWDBConnCallbackoperator= (const RWDBConnCallback &conncb)
 
RWDBStatus status () const
 

Related Symbols

(Note that these are not member symbols.)

#define RWDBCONNCALLBACK(CALLBACK)
 

Detailed Description

RWDBConnCallback is the interface handle class for connection callbacks that encapsulate a reference-counted pointer to the RWDBConnCallbackImp body class. Please refer to the RWDBConnCallbackImp class for implementing connection callbacks.

Synopsis
#include <rw/db/conncb.h>
RWDBConnection connection =
myDbase.connection(RWDBCONNCALLBACK(MyConnCallbackImp));
#define RWDBCONNCALLBACK(CALLBACK)
Definition conncb.h:34
Represents an explicit database connection object that can be used in place of the implicit database ...
Definition connect.h:81

Constructor & Destructor Documentation

◆ RWDBConnCallback() [1/2]

RWDBConnCallback::RWDBConnCallback ( )
inline

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

◆ RWDBConnCallback() [2/2]

RWDBConnCallback::RWDBConnCallback ( const RWDBConnCallback & conncb)
inline

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

Member Function Documentation

◆ databaseCallback()

RWDBDatabaseCallback RWDBConnCallback::databaseCallback ( ) const

Returns the RWDBDatabaseCallback associated with the RWDBDatabase object that produced the RWDBConnection object associated with self.

◆ operator()()

RWDBConnCallbackImp * RWDBConnCallback::operator() ( ) const
inline

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

◆ operator=()

RWDBConnCallback & RWDBConnCallback::operator= ( const RWDBConnCallback & conncb)
inline

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

◆ status()

RWDBStatus RWDBConnCallback::status ( ) const
inline

Returns the current status of self.

Friends And Related Symbol Documentation

◆ RWDBCONNCALLBACK

#define RWDBCONNCALLBACK ( CALLBACK)
related

This macro takes as a parameter the name of an implemented connection callback implementation class, which must derive from RWDBConnCallbackImp. To create an instance with the default constructor, just provide the name of the class. To use a different constructor, pass the class and parameter values. For example:

RWDBCONNCALLBACK(MyConnCallbackImp("abc", 1248))

This macro must be used while supplying an instance of the connection callback implementation class in the method RWDBDatabase::connection() or while producing new connection callbacks in the method redefined from RWDBDatabaseCallbackImp::produceConnCallback(). This macro ensures that a new instance of the connection callback implementation class is produced.

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