![]() |
OCILIB (C and C++ Driver for Oracle)
4.7.7
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
|
Subscription to database or objects changes. More...
#include <types.hpp>
Inherits ocilib::core::HandleHolder< OCI_Subscription * >.
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. | |
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. | |
| void | Unregister () |
| Unregister a previously registered notification. | |
| 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. | |
Subscription to database or objects changes.
This class wraps the OCILIB object handle OCI_Subscription and its related methods
| ocilib::Subscription::NotifyHandlerProc |
Subscription changes flags.
Possible values are Subscription::ChangeTypesValues
Subscription changes flags values.
|
inline |
Default constructor.
Definition at line 31 of file Subscription.hpp.
|
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 |
Add a SQL query to monitor.
Definition at line 71 of file Subscription.hpp.
References ocilib::core::Check(), ocilib::Statement::Execute(), GetConnection(), and OCI_SubscriptionAddStatement().
|
inline |
Return the name of the given registered subscription.
Definition at line 80 of file Subscription.hpp.
References ocilib::core::Check(), ocilib::core::MakeString(), and OCI_SubscriptionGetName().
|
inline |
Return the timeout of the given registered subscription.
Definition at line 85 of file Subscription.hpp.
References ocilib::core::Check(), and OCI_SubscriptionGetTimeout().
|
inline |
Return the port used by the notification.
Definition at line 90 of file Subscription.hpp.
References ocilib::core::Check(), and OCI_SubscriptionGetPort().
|
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().