OCILIB (C and C++ Driver for Oracle)  4.7.3
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Agent.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-2021 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 Agent::Agent(const Connection &connection, const ostring& name, const ostring& address)
29 {
30  Acquire(core::Check(OCI_AgentCreate(connection, name.c_str(), address.c_str())), reinterpret_cast<HandleFreeFunc>(OCI_AgentFree), nullptr, nullptr);
31 }
32 
33 inline Agent::Agent(OCI_Agent *pAgent, core::Handle *parent)
34 {
35  Acquire(pAgent, nullptr, nullptr, parent);
36 }
37 
38 inline ostring Agent::GetName() const
39 {
41 }
42 
43 inline void Agent::SetName(const ostring& value)
44 {
45  core::Check(OCI_AgentSetName(*this, value.c_str()));
46 }
47 
48 inline ostring Agent::GetAddress() const
49 {
51 }
52 
53 inline void Agent::SetAddress(const ostring& value)
54 {
55  core::Check(OCI_AgentSetAddress(*this, value.c_str()));
56 }
57 
58 }
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
Definition: types.h:448
Internal usage. Interface for handling ownership and relationship of a C API handle.
Definition: core.hpp:312
OCILIB ++ Namespace.
ostring GetAddress() const
Get the given AQ agent address.
Definition: Agent.hpp:48
A connection or session with a specific database.
Definition: types.hpp:1563
static T Check(T result)
Internal usage. Checks if the last OCILIB function call has raised an error. If so, it raises a C++ exception using the retrieved error handle.
Definition: Utils.hpp:53
Agent(const Connection &connection, const ostring &name=OTEXT(""), const ostring &address=OTEXT(""))
Create an AQ agent object.
Definition: Agent.hpp:28
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
OCI_SYM_PUBLIC boolean OCI_API OCI_AgentSetName(OCI_Agent *agent, const otext *name)
Set the given AQ agent name.
void SetAddress(const ostring &value)
Set the given AQ agent address.
Definition: Agent.hpp:53
ostring GetName() const
Get the given AQ agent name.
Definition: Agent.hpp:38
OCI_SYM_PUBLIC const otext *OCI_API OCI_AgentGetName(OCI_Agent *agent)
Get the given AQ agent name.
OCI_SYM_PUBLIC boolean OCI_API OCI_AgentFree(OCI_Agent *agent)
Free an AQ agent object.
OCI_SYM_PUBLIC boolean OCI_API OCI_AgentSetAddress(OCI_Agent *agent, const otext *address)
Set the given AQ agent address.
void SetName(const ostring &value)
Set the given AQ agent name.
Definition: Agent.hpp:43
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
OCI_SYM_PUBLIC OCI_Agent *OCI_API OCI_AgentCreate(OCI_Connection *con, const otext *name, const otext *address)
Create an AQ agent object.
OCI_SYM_PUBLIC const otext *OCI_API OCI_AgentGetAddress(OCI_Agent *agent)
Get the given AQ agent address.