Module: DB Interface Module Group: Callback Classes
Does not inherit
#define RWDBCONNCALLBACK(CALLBACK) databaseCallback() |
operator()() operator=() |
RWDBConnCallback() status() |
#include <rw/db/conncb.h> RWDBConnection connection = myDbase.connection( RWDBCONNCALLBACK(MyConnCallbackImp) );
RWDBConnCallback is the interface handle class for connection callbacks which encapsulates a reference-counted pointer to the RWDBConnCallbackImp body class. Please refer to the RWDBConnCallbackImp class for implementing connection callbacks.
RWDBConnCallback();
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(const RWDBConnCallback& conncb);
Copy constructor. The object created shares an implementation with conncb.
RWDBConnCallback& operator=(const RWDBConnCallback& conncb);
Assignment operator. Self shares an implementation with conncb. Returns a reference to self.
RWDBConnCallbackImp* operator()() const;
Returns a pointer to the connection callback implementation encapsulated by self.
RWDBStatus status() const;
Returns the current status of self.
RWDBDatabaseCallback databaseCallback() const;
Returns the RWDBDatabaseCallback associated with the RWDBDatabase object that produced the RWDBConnection object to which self is associated.
#define RWDBCONNCALLBACK(CALLBACK)
The macro takes as an argument, the name of your implemented connection callback implementation class. Your connection callback implementation class must have been derived from the RWDBConnCallbackImp class. Providing simply the name of the callback implementation class will create its instance using its default constructor. To use a different constructor, pass the arguments along with it. (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 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.