OCILIB (C and C++ Driver for Oracle)  4.7.6
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-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 Agent::Agent(const Connection &connection, const ostring& name, const ostring& address)
29 {
30  AcquireAllocated
31  (
32  core::Check(OCI_AgentCreate(connection, name.c_str(), address.c_str())),
33  connection.GetHandle()
34  );
35 }
36 
37 inline Agent::Agent(OCI_Agent *pAgent, core::Handle *parent)
38 {
39  AcquireTransient(pAgent, parent);
40 }
41 
42 inline ostring Agent::GetName() const
43 {
45 }
46 
47 inline void Agent::SetName(const ostring& value)
48 {
49  core::Check(OCI_AgentSetName(*this, value.c_str()));
50 }
51 
52 inline ostring Agent::GetAddress() const
53 {
55 }
56 
57 inline void Agent::SetAddress(const ostring& value)
58 {
59  core::Check(OCI_AgentSetAddress(*this, value.c_str()));
60 }
61 
62 }
void SetAddress(const ostring &value)
Set the given AQ agent address.
Definition: Agent.hpp:57
void SetName(const ostring &value)
Set the given AQ agent name.
Definition: Agent.hpp:47
ostring GetAddress() const
Get the given AQ agent address.
Definition: Agent.hpp:52
ostring GetName() const
Get the given AQ agent name.
Definition: Agent.hpp:42
Agent(const Connection &connection, const ostring &name=OTEXT(""), const ostring &address=OTEXT(""))
Create an AQ agent object.
Definition: Agent.hpp:28
A connection or session with a specific database.
Definition: types.hpp:1580
Internal usage. Interface for handling ownership and relationship of a C API handle.
Definition: core.hpp:325
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_AgentSetName(OCI_Agent *agent, const otext *name)
Set the given AQ agent name.
OCI_SYM_PUBLIC const otext *OCI_API OCI_AgentGetAddress(OCI_Agent *agent)
Get the given AQ agent address.
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 boolean OCI_API OCI_AgentSetAddress(OCI_Agent *agent, const otext *address)
Set the given AQ agent address.
struct OCI_Agent OCI_Agent
OCILIB encapsulation of A/Q Agent.
Definition: types.h:460
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