Harlinn.Windows 0.1
Loading...
Searching...
No Matches
Harlinn::OCI::ServiceContext Class Referencefinal

ServiceContext - A service context handle defines attributes that determine the operational context for OCI calls to a server. More...

#include <HOCI.h>

Inheritance diagram for Harlinn::OCI::ServiceContext:
[legend]
Collaboration diagram for Harlinn::OCI::ServiceContext:
[legend]

Public Member Functions

constexpr ServiceContext () noexcept
 
 ServiceContext (const OCI::Environment &environment, void *ocisvcctx, bool ownsHandle)
 Constructs a new ServiceContext object.
 
 ServiceContext (const ServiceContext &other)=delete
 
constexpr ServiceContext (ServiceContext &&other) noexcept
 
ServiceContextoperator= (const ServiceContext &other)=delete
 
constexpr ServiceContextoperator= (ServiceContext &&other) noexcept
 
constexpr void swap (ServiceContext &other) noexcept
 
constexpr const OCI::EnvironmentEnvironment () const noexcept
 Retrieves a reference to the Environment of the ServiceContext.
 
constexpr const OCI::SessionSession () const noexcept
 Retrieves a reference to the Session of the ServiceContext.
 
HO_EXPORT bool SetSession (OCI::Session &&session)
 Sets the session attribute of the ServiceContext.
 
const OCI::ErrorHandleError () const noexcept final override
 Retrieves a reference to the ErrorHandle object of the ServiceContext.
 
void TransactionStart (TransactionStartFlags flags=TransactionStartFlags::None, UInt16 timeoutInSeconds=0) const
 Sets the beginning of a transaction.
 
void TransactionStart (TransactionStartFlags flags, const TimeSpan &timeout) const
 
Transaction BeginTransaction (TransactionStartFlags flags=TransactionStartFlags::None, UInt16 timeoutInSeconds=0) const
 
void TransactionRollback () const
 
void TransactionCommit (TransactionEndFlags flags=TransactionEndFlags::None) const
 
void TransactionDetach () const
 
void TransactionForget () const
 
void TransactionPrepare () const
 
std::unique_ptr< OCI::TypeTypeByName (const WideString &schemaName, const WideString &typeName, const WideString &versionName, OCI::Duration pinDuration, OCI::TypeGetOpt typeGetOption) const
 
std::unique_ptr< OCI::TypeTypeByName (const WideString &schemaName, const WideString &typeName, OCI::Duration pinDuration=OCI::Duration::Session, OCI::TypeGetOpt typeGetOption=OCI::TypeGetOpt::Header) const
 
std::unique_ptr< OCI::TypeTypeByFullName (const WideString &fullName, const WideString &versionName, OCI::Duration pinDuration, OCI::TypeGetOpt typeGetOption) const
 
std::unique_ptr< OCI::TypeTypeByFullName (const WideString &fullName, OCI::Duration pinDuration=OCI::Duration::Session, OCI::TypeGetOpt typeGetOption=OCI::TypeGetOpt::Header) const
 
HO_EXPORT bool Exists (const WideString &objectName, OCI::ParameterType parameterType=OCI::ParameterType::Unknown) const
 
bool Exists (const wchar_t *objectName, OCI::ParameterType parameterType=OCI::ParameterType::Unknown) const
 
HO_EXPORT OCI::Describe Describe (const WideString &objectName, OCI::ParameterType parameterType=OCI::ParameterType::Unknown, bool showInvisibleColumns=false) const
 
HO_EXPORT OCI::Describe Describe (const wchar_t *objectName, OCI::ParameterType parameterType=OCI::ParameterType::Unknown, bool showInvisibleColumns=false) const
 
HO_EXPORT OCI::Describe Describe (const OCI::Type &type) const
 
HO_EXPORT OCI::Describe Describe (const OCI::Ref &typeRef) const
 
HO_EXPORT OCI::Describe Describe (OCIType *type) const
 
HO_EXPORT OCI::Describe Describe (OCIRef *typeRef) const
 
HO_EXPORT const OCI::SessionCreateSession ()
 
HO_EXPORT const OCI::SessionCreateSession (const wchar_t *username, size_t usernameLength, const wchar_t *password, size_t passwordLength)
 
template<WideStringLike StringT1, WideStringLike StringT2>
const OCI::SessionCreateSession (const StringT1 &username, const StringT2 &password)
 
const OCI::ServerServer () const
 
HO_EXPORT bool SetServer (const OCI::Server *server)
 
bool SetServer (const OCI::Server &server)
 
HO_EXPORT void SessionBegin (CredidentialType credidentialType=CredidentialType::DatabaseServer, AuthenticationMode authenticationMode=AuthenticationMode::Default) const
 
HO_EXPORT void SessionEnd () const
 
HO_EXPORT OCI::Statement CreateStatement (const wchar_t *sql, size_t sqlLength) const
 
template<WideStringLike StringT>
OCI::Statement CreateStatement (const StringT &sql) const
 
OCI::Statement CreateStatement (const wchar_t *sql) const
 
template<WideStringLike StringT, typename ... BindableTypes>
requires (sizeof...( BindableTypes ) > 0)
OCI::Statement CreateStatement (const StringT &sql, BindableTypes &&...bindableArgs) const
 
HO_EXPORT OCI::Describe CreateDescribe () const
 
HO_EXPORT std::vector< WideStringGetDbmsOutput () const
 
template<typename T , WideStringLike StringT>
std::optional< TExecuteScalar (const StringT &sql) const
 
template<WideStringLike StringT, typename ... BindableTypes>
Int64 ExecuteNonQuery (const StringT &sql, BindableTypes &&...bindableArgs) const
 
template<typename ... BindableTypes>
Int64 ExecuteNonQuery (const wchar_t *sql, BindableTypes &&...bindableArgs) const
 
WideString DbName () const
 
- Public Member Functions inherited from Harlinn::OCI::HandleBase
constexpr void * Handle () const noexcept
 Provides access to the value of the handle object.
 
constexpr operator bool () const noexcept
 Test if the handle value is assigned.
 
constexpr bool IsValid () const noexcept
 Test if the handle value is assigned.
 
constexpr OCI::HandleType HandleType () const noexcept
 Returns a value identifying the type of the wrapped handle object.
 

Static Public Attributes

static constexpr OCI::HandleType OCIHandleType = OCI::HandleType::ServiceContext
 

Private Types

using Base = HandleBase
 

Private Member Functions

HO_EXPORT void ObjectNew (TypeCode typecode, Duration duration, bool value, void **instance) const
 
void * ObjectNew (TypeCode typecode, Duration duration, bool value) const
 
HO_EXPORT void TypeByName (const WideString &schemaName, const WideString &typeName, const WideString &versionName, OCI::Duration pinDuration, OCI::TypeGetOpt typeGetOption, OCIType **tdo) const
 
HO_EXPORT void TypeByFullName (const WideString &fullName, const WideString &versionName, OCI::Duration pinDuration, OCI::TypeGetOpt typeGetOption, OCIType **ociType) const
 

Private Attributes

const OCI::Environmentenvironment_
 
const OCI::Serverserver_
 
OCI::Session session_
 
OCI::ErrorHandle error_
 

Friends

class Ref
 
class Object
 

Additional Inherited Members

- Protected Member Functions inherited from Harlinn::OCI::HandleBase
constexpr HandleBase () noexcept
 Default constructor.
 
constexpr HandleBase (OCI::HandleType handleType, void *handle, bool ownsHandle) noexcept
 Constructs a new HandleBase object.
 
 HandleBase (const HandleBase &other)=delete
 
constexpr HandleBase (HandleBase &&other) noexcept
 Move constructor.
 
virtual ~HandleBase ()
 Destructor.
 
constexpr void SetHandle (void *newHandleValue, bool ownsHandle) noexcept
 Assigns the handle value and ownership to this object.
 
constexpr bool OwnsHandle () const noexcept
 Returns true if this object is the owner of the handle value.
 
void * DetachHandle ()
 If this object is the owner of a handle this function rescinds that ownership, and returns the handle value without closing the handle.
 
void DestroyHandle ()
 Destroys the handle if it is owned by this object.
 
HandleBaseoperator= (const HandleBase &other)=delete
 
constexpr HandleBaseoperator= (HandleBase &&other) noexcept
 
constexpr void swap (HandleBase &other) noexcept
 
template<typename Derived >
constexpr void Take (Derived &&derived) noexcept
 Template function used to implement move assignement in derived classes.
 
void InitializeHandle (void *handle, bool ownsHandle)
 Provides a "safe" mechanism for assigning a handle value. This functions throws if a handle value is already assigned to this object.
 
HO_EXPORT Int32 GetAttribute (void *buffer, UInt32 *size, Attribute attribute) const
 Gets the value of an attribute from the handle.
 
HO_EXPORT Int32 SetAttribute (void *buffer, UInt32 size, Attribute attribute) const
 Sets the value of an attribute on the handle.
 
DateTime GetDateTimeAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a DateTime.
 
void SetDateTimeAttribute (Attribute attribute, const DateTime &value) const
 Sets the value of an attribute on the handle as a DateTime.
 
template<WideStringLike StringT = WideString>
StringT GetStringAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a WideString.
 
template<WideStringLike StringT = WideString>
StringT GetStringAttributeFromByteString (Attribute attribute) const
 Gets the value of an attribute from the handle as a WideString For use with attributes that are not returned as UTF-16.
 
template<WideStringLike StringT>
void SetStringAttribute (Attribute attribute, const StringT &value) const
 Sets the value of an attribute on the handle as a WideString.
 
void SetStringAttribute (Attribute attribute, const wchar_t *value, size_t valueLength) const
 
bool GetBooleanAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a bool.
 
void SetBooleanAttribute (Attribute attribute, bool value) const
 Sets the value of an attribute on the handle as a bool.
 
Byte GetByteAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a Byte.
 
void SetByteAttribute (Attribute attribute, Byte value) const
 Sets the value of an attribute on the handle as a Byte.
 
SByte GetSByteAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a SByte.
 
void SetSByteAttribute (Attribute attribute, SByte value) const
 Sets the value of an attribute on the handle as a Byte.
 
Int16 GetInt16Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an Int16.
 
void SetInt16Attribute (Attribute attribute, Int16 value) const
 Sets the value of an attribute on the handle as an Int16.
 
UInt16 GetUInt16Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an UInt16.
 
void SetUInt16Attribute (Attribute attribute, UInt16 value) const
 Sets the value of an attribute on the handle as an UInt16.
 
Int32 GetInt32Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an Int32.
 
void SetInt32Attribute (Attribute attribute, Int32 value) const
 Sets the value of an attribute on the handle as an Int32.
 
UInt32 GetUInt32Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an UInt32.
 
void SetUInt32Attribute (Attribute attribute, UInt32 value) const
 Sets the value of an attribute on the handle as an UInt32.
 
Int64 GetInt64Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an Int64.
 
void SetInt64Attribute (Attribute attribute, Int64 value) const
 Sets the value of an attribute on the handle as an Int64.
 
UInt64 GetUInt64Attribute (Attribute attribute) const
 Gets the value of an attribute from the handle as an UInt64.
 
void SetUInt64Attribute (Attribute attribute, UInt64 value) const
 Sets the value of an attribute on the handle as an UInt64.
 
void * GetPointerAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a pointer.
 
void SetPointerAttribute (Attribute attribute, void *value) const
 Sets the value of an attribute on the handle as a pointer.
 
OCI::NumberGetNumberAttribute (Attribute attribute) const
 Gets the value of an attribute from the handle as a pointer to an OCI::Number.
 
- Static Protected Member Functions inherited from Harlinn::OCI::HandleBase
static HO_EXPORT void HandleFree (void *handle, OCI::HandleType handleType) noexcept
 Calls OCIHandleFree to release the handle.
 

Detailed Description

ServiceContext - A service context handle defines attributes that determine the operational context for OCI calls to a server.

Member Typedef Documentation

◆ Base

Constructor & Destructor Documentation

◆ ServiceContext() [1/4]

Harlinn::OCI::ServiceContext::ServiceContext ( )
inlineconstexprnoexcept

◆ ServiceContext() [2/4]

Harlinn::OCI::ServiceContext::ServiceContext ( const OCI::Environment & environment,
void * ocisvcctx,
bool ownsHandle )
inline

Constructs a new ServiceContext object.

Parameters
environmentA reference to the environment used to create the service context handle
handleThe handle wrapped by this object.
ownsHandleSet to true if the new object will take owneship of the handle value

◆ ServiceContext() [3/4]

Harlinn::OCI::ServiceContext::ServiceContext ( const ServiceContext & other)
delete

◆ ServiceContext() [4/4]

Harlinn::OCI::ServiceContext::ServiceContext ( ServiceContext && other)
inlineconstexprnoexcept

Member Function Documentation

◆ BeginTransaction()

Transaction Harlinn::OCI::ServiceContext::BeginTransaction ( TransactionStartFlags flags = TransactionStartFlags::None,
UInt16 timeoutInSeconds = 0 ) const
inlinenodiscard

◆ CreateDescribe()

OCI::Describe Harlinn::OCI::ServiceContext::CreateDescribe ( ) const

◆ CreateSession() [1/3]

const OCI::Session & Harlinn::OCI::ServiceContext::CreateSession ( )

◆ CreateSession() [2/3]

template<WideStringLike StringT1, WideStringLike StringT2>
const OCI::Session & Harlinn::OCI::ServiceContext::CreateSession ( const StringT1 & username,
const StringT2 & password )
inline

◆ CreateSession() [3/3]

const OCI::Session & Harlinn::OCI::ServiceContext::CreateSession ( const wchar_t * username,
size_t usernameLength,
const wchar_t * password,
size_t passwordLength )

◆ CreateStatement() [1/4]

template<WideStringLike StringT>
OCI::Statement Harlinn::OCI::ServiceContext::CreateStatement ( const StringT & sql) const
inline

◆ CreateStatement() [2/4]

template<WideStringLike StringT, typename ... BindableTypes>
requires (sizeof...( BindableTypes ) > 0)
OCI::Statement Harlinn::OCI::ServiceContext::CreateStatement ( const StringT & sql,
BindableTypes &&... bindableArgs ) const
inline

◆ CreateStatement() [3/4]

OCI::Statement Harlinn::OCI::ServiceContext::CreateStatement ( const wchar_t * sql) const
inline

◆ CreateStatement() [4/4]

OCI::Statement Harlinn::OCI::ServiceContext::CreateStatement ( const wchar_t * sql,
size_t sqlLength ) const

◆ DbName()

WideString Harlinn::OCI::ServiceContext::DbName ( ) const
inline

◆ Describe() [1/6]

OCI::Describe Harlinn::OCI::ServiceContext::Describe ( const OCI::Ref & typeRef) const

◆ Describe() [2/6]

OCI::Describe Harlinn::OCI::ServiceContext::Describe ( const OCI::Type & type) const

◆ Describe() [3/6]

OCI::Describe Harlinn::OCI::ServiceContext::Describe ( const wchar_t * objectName,
OCI::ParameterType parameterType = OCI::ParameterType::Unknown,
bool showInvisibleColumns = false ) const

◆ Describe() [4/6]

OCI::Describe Harlinn::OCI::ServiceContext::Describe ( const WideString & objectName,
OCI::ParameterType parameterType = OCI::ParameterType::Unknown,
bool showInvisibleColumns = false ) const

◆ Describe() [5/6]

OCI::Describe Harlinn::OCI::ServiceContext::Describe ( OCIRef * typeRef) const

◆ Describe() [6/6]

OCI::Describe Harlinn::OCI::ServiceContext::Describe ( OCIType * type) const

◆ Environment()

const OCI::Environment & Harlinn::OCI::ServiceContext::Environment ( ) const
inlineconstexprnoexcept

Retrieves a reference to the Environment of the ServiceContext.

Returns
A reference to the Environment of the ServiceContext

◆ Error()

const OCI::ErrorHandle & Harlinn::OCI::ServiceContext::Error ( ) const
inlinefinaloverridevirtualnoexcept

Retrieves a reference to the ErrorHandle object of the ServiceContext.

Returns

Implements Harlinn::OCI::HandleBase.

◆ ExecuteNonQuery() [1/2]

template<WideStringLike StringT, typename ... BindableTypes>
Int64 Harlinn::OCI::ServiceContext::ExecuteNonQuery ( const StringT & sql,
BindableTypes &&... bindableArgs ) const
inline

◆ ExecuteNonQuery() [2/2]

template<typename ... BindableTypes>
Int64 Harlinn::OCI::ServiceContext::ExecuteNonQuery ( const wchar_t * sql,
BindableTypes &&... bindableArgs ) const
inline

◆ ExecuteScalar()

template<typename T , WideStringLike StringT>
std::optional< T > Harlinn::OCI::ServiceContext::ExecuteScalar ( const StringT & sql) const
inline

◆ Exists() [1/2]

bool Harlinn::OCI::ServiceContext::Exists ( const wchar_t * objectName,
OCI::ParameterType parameterType = OCI::ParameterType::Unknown ) const
inline

◆ Exists() [2/2]

bool Harlinn::OCI::ServiceContext::Exists ( const WideString & objectName,
OCI::ParameterType parameterType = OCI::ParameterType::Unknown ) const

◆ GetDbmsOutput()

std::vector< WideString > Harlinn::OCI::ServiceContext::GetDbmsOutput ( ) const

◆ ObjectNew() [1/2]

void * Harlinn::OCI::ServiceContext::ObjectNew ( TypeCode typecode,
Duration duration,
bool value ) const
inlinenodiscardprivate

◆ ObjectNew() [2/2]

void Harlinn::OCI::ServiceContext::ObjectNew ( TypeCode typecode,
Duration duration,
bool value,
void ** instance ) const
private

◆ operator=() [1/2]

ServiceContext & Harlinn::OCI::ServiceContext::operator= ( const ServiceContext & other)
delete

◆ operator=() [2/2]

ServiceContext & Harlinn::OCI::ServiceContext::operator= ( ServiceContext && other)
inlineconstexprnoexcept

◆ Server()

const OCI::Server * Harlinn::OCI::ServiceContext::Server ( ) const
inline

◆ Session()

const OCI::Session & Harlinn::OCI::ServiceContext::Session ( ) const
inlineconstexprnoexcept

Retrieves a reference to the Session of the ServiceContext.

Returns

◆ SessionBegin()

void Harlinn::OCI::ServiceContext::SessionBegin ( CredidentialType credidentialType = CredidentialType::DatabaseServer,
AuthenticationMode authenticationMode = AuthenticationMode::Default ) const

◆ SessionEnd()

void Harlinn::OCI::ServiceContext::SessionEnd ( ) const

◆ SetServer() [1/2]

bool Harlinn::OCI::ServiceContext::SetServer ( const OCI::Server & server)
inline

◆ SetServer() [2/2]

bool Harlinn::OCI::ServiceContext::SetServer ( const OCI::Server * server)

◆ SetSession()

bool Harlinn::OCI::ServiceContext::SetSession ( OCI::Session && session)

Sets the session attribute of the ServiceContext.

Parameters
authenticationThe Session object for the OCISession
Returns

◆ swap()

void Harlinn::OCI::ServiceContext::swap ( ServiceContext & other)
inlineconstexprnoexcept

◆ TransactionCommit()

void Harlinn::OCI::ServiceContext::TransactionCommit ( TransactionEndFlags flags = TransactionEndFlags::None) const
inline

◆ TransactionDetach()

void Harlinn::OCI::ServiceContext::TransactionDetach ( ) const
inline

◆ TransactionForget()

void Harlinn::OCI::ServiceContext::TransactionForget ( ) const
inline

◆ TransactionPrepare()

void Harlinn::OCI::ServiceContext::TransactionPrepare ( ) const
inline

◆ TransactionRollback()

void Harlinn::OCI::ServiceContext::TransactionRollback ( ) const
inline

◆ TransactionStart() [1/2]

void Harlinn::OCI::ServiceContext::TransactionStart ( TransactionStartFlags flags,
const TimeSpan & timeout ) const
inline

◆ TransactionStart() [2/2]

void Harlinn::OCI::ServiceContext::TransactionStart ( TransactionStartFlags flags = TransactionStartFlags::None,
UInt16 timeoutInSeconds = 0 ) const
inline

Sets the beginning of a transaction.

Parameters
flagsSpecifies whether a new transaction is being started or an existing transaction is being resumed. Also specifies serializability or read-only status. More than a single value can be specified. By default, a read/write transaction is started. TransactionStartFlags for possible values.
timeoutInSecondsThe time, in seconds, to wait for a transaction to become available for resumption when TransactionStartFlags::Resume is specified. When TransactionStartFlags::New is specified, the timeout parameter indicates the number of seconds the transaction can be inactive before it is automatically terminated by the system. A transaction is inactive between the time it is detached (with OCITransDetach()) and the time it is resumed with OCITransStart().

◆ TypeByFullName() [1/3]

std::unique_ptr< OCI::Type > Harlinn::OCI::ServiceContext::TypeByFullName ( const WideString & fullName,
const WideString & versionName,
OCI::Duration pinDuration,
OCI::TypeGetOpt typeGetOption ) const
inline

◆ TypeByFullName() [2/3]

void Harlinn::OCI::ServiceContext::TypeByFullName ( const WideString & fullName,
const WideString & versionName,
OCI::Duration pinDuration,
OCI::TypeGetOpt typeGetOption,
OCIType ** ociType ) const
private

◆ TypeByFullName() [3/3]

std::unique_ptr< OCI::Type > Harlinn::OCI::ServiceContext::TypeByFullName ( const WideString & fullName,
OCI::Duration pinDuration = OCI::Duration::Session,
OCI::TypeGetOpt typeGetOption = OCI::TypeGetOpt::Header ) const
inline

◆ TypeByName() [1/3]

std::unique_ptr< OCI::Type > Harlinn::OCI::ServiceContext::TypeByName ( const WideString & schemaName,
const WideString & typeName,
const WideString & versionName,
OCI::Duration pinDuration,
OCI::TypeGetOpt typeGetOption ) const
inline

◆ TypeByName() [2/3]

void Harlinn::OCI::ServiceContext::TypeByName ( const WideString & schemaName,
const WideString & typeName,
const WideString & versionName,
OCI::Duration pinDuration,
OCI::TypeGetOpt typeGetOption,
OCIType ** tdo ) const
private

◆ TypeByName() [3/3]

std::unique_ptr< OCI::Type > Harlinn::OCI::ServiceContext::TypeByName ( const WideString & schemaName,
const WideString & typeName,
OCI::Duration pinDuration = OCI::Duration::Session,
OCI::TypeGetOpt typeGetOption = OCI::TypeGetOpt::Header ) const
inline

Friends And Related Symbol Documentation

◆ Object

friend class Object
friend

◆ Ref

friend class Ref
friend

Member Data Documentation

◆ environment_

const OCI::Environment* Harlinn::OCI::ServiceContext::environment_
private

◆ error_

OCI::ErrorHandle Harlinn::OCI::ServiceContext::error_
private

◆ OCIHandleType

OCI::HandleType Harlinn::OCI::ServiceContext::OCIHandleType = OCI::HandleType::ServiceContext
staticconstexpr

◆ server_

const OCI::Server* Harlinn::OCI::ServiceContext::server_
private

◆ session_

OCI::Session Harlinn::OCI::ServiceContext::session_
private

The documentation for this class was generated from the following files: