OCILIB (C and C++ Driver for Oracle)  4.7.6
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Event.hpp
1 /*
2  * OCILIB - C Driver for Oracle (C Wrapper for Oracle OCI)
3  *
4  * Website: http://www.ocilib.net
5  *
6  * Copyright (c) 2007-2023 Vincent ROGIER <vince.rogier@ocilib.net>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #pragma once
22 
23 #include "ocilibcpp/types.hpp"
24 
25 namespace ocilib
26 {
27 
28 inline Event::Event(OCI_Event *pEvent)
29 {
30  AcquireTransient(pEvent, Environment::GetEnvironmentHandle());
31 }
32 
34 {
35  return EventType(static_cast<EventType::Type>(core::Check(OCI_EventGetType(*this))));
36 }
37 
39 {
40  return ObjectEvent(static_cast<ObjectEvent::Type>(core::Check(OCI_EventGetOperation(*this))));
41 }
42 
44 {
46 }
47 
49 {
51 }
52 
53 inline ostring Event::GetRowID() const
54 {
56 }
57 
59 {
61 }
62 
63 }
core::Enum< ObjectEventValues > ObjectEvent
Object events.
Definition: types.hpp:7269
ostring GetRowID() const
Return the rowid of the altered database object row.
Definition: Event.hpp:53
Subscription GetSubscription() const
Return the subscription that generated this event.
Definition: Event.hpp:58
core::Enum< EventTypeValues > EventType
Event type.
Definition: types.hpp:7239
ostring GetObjectName() const
Return the name of the object that generated the event.
Definition: Event.hpp:48
ObjectEvent GetObjectEvent() const
Return the type of operation reported by a notification.
Definition: Event.hpp:38
ostring GetDatabaseName() const
Return the name of the database that generated the event.
Definition: Event.hpp:43
EventType GetType() const
Return the type of event reported by a notification.
Definition: Event.hpp:33
Subscription to database or objects changes.
Definition: types.hpp:7071
Template Enumeration template class providing some type safety to some extends for manipulating enume...
Definition: core.hpp:118
struct OCI_Event OCI_Event
OCILIB encapsulation of Oracle DCN event.
Definition: types.h:440
OCI_SYM_PUBLIC OCI_Subscription *OCI_API OCI_EventGetSubscription(OCI_Event *event)
Return the subscription handle that generated this event.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_EventGetType(OCI_Event *event)
Return the type of event reported by a notification.
OCI_SYM_PUBLIC const otext *OCI_API OCI_EventGetObject(OCI_Event *event)
Return the name of the object that generated the event.
OCI_SYM_PUBLIC const otext *OCI_API OCI_EventGetDatabase(OCI_Event *event)
Return the name of the database that generated the event.
OCI_SYM_PUBLIC const otext *OCI_API OCI_EventGetRowid(OCI_Event *event)
Return the rowid of the altered database object row.
OCI_SYM_PUBLIC unsigned int OCI_API OCI_EventGetOperation(OCI_Event *event)
Return the type of operation reported by a notification.
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so,...
Definition: Utils.hpp:53
ostring MakeString(const otext *result, int size=-1)
Internal usage. Constructs a C++ string object from the given OCILIB string pointer.
Definition: Utils.hpp:65
OCILIB ++ Namespace.
std::basic_string< otext, std::char_traits< otext >, std::allocator< otext > > ostring
string class wrapping the OCILIB otext * type and OTEXT() macros ( see Character sets )
Definition: config.hpp:120