![]() |
OCILIB (C and C++ Driver for Oracle)
4.7.6
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
|
Subscription to database or objects changes. More...
#include <types.hpp>
Public Types | |
enum | ChangeTypesValues { ObjectChanges = OCI_CNT_OBJECTS , RowChanges = OCI_CNT_ROWS , DatabaseChanges = OCI_CNT_DATABASES , AllChanges = OCI_CNT_ALL } |
Subscription changes flags values. More... | |
typedef void(* | NotifyHandlerProc) (Event &evt) |
User callback for subscriptions event notifications. | |
typedef core::Flags< ChangeTypesValues > | ChangeTypes |
Subscription changes flags. More... | |
Public Member Functions | |
Subscription () | |
Default constructor. | |
void | Register (const Connection &connection, const ostring &name, ChangeTypes changeTypes, NotifyHandlerProc handler, unsigned int port=0, unsigned int timeout=0) |
Register a notification against the given database. More... | |
void | Unregister () |
Unregister a previously registered notification. More... | |
void | Watch (const ostring &sql) |
Add a SQL query to monitor. | |
ostring | GetName () const |
Return the name of the given registered subscription. | |
unsigned int | GetTimeout () const |
Return the timeout of the given registered subscription. | |
unsigned int | GetPort () const |
Return the port used by the notification. | |
Connection | GetConnection () const |
Return the connection associated with a subscription handle. More... | |
Subscription to database or objects changes.
This class wraps the OCILIB object handle OCI_Subscription and its related methods
Subscription changes flags.
Possible values are Subscription::ChangeTypesValues
Subscription changes flags values.
|
inline |
Register a notification against the given database.
connection | - Connection handle |
name | - Notification name |
changeTypes | - Subscription type |
handler | - User handler callback |
port | - Port to use for notifications |
timeout | - notification timeout |
Definition at line 45 of file Subscription.hpp.
References ocilib::core::Check(), and OCI_SubscriptionRegister().
|
inline |
Unregister a previously registered notification.
Definition at line 64 of file Subscription.hpp.
|
inline |
Return the connection associated with a subscription handle.
Definition at line 95 of file Subscription.hpp.
References ocilib::core::Check(), and OCI_SubscriptionGetConnection().
Referenced by Watch().