Harlinn.Windows 0.1
|
The environment handle defines a context in which all OCI functions are invoked. More...
#include <HOCI.h>
Public Member Functions | |
constexpr | Environment () noexcept |
Environment (const EnvironmentOptions &options) | |
Environment (const Environment &other)=delete | |
constexpr | Environment (Environment &&other) noexcept |
Environment & | operator= (const Environment &other)=delete |
constexpr Environment & | operator= (Environment &&other) noexcept |
const OCI::ErrorHandle & | Error () const noexcept final override |
Provides access to the OCIError that will be used for OCI calls for this object. | |
constexpr void | swap (Environment &other) noexcept |
HO_EXPORT OCI::ErrorHandle | CreateError () const |
Creates an ErrorHandle object. | |
HO_EXPORT OCI::Server | CreateServer () const |
Creates a Server object. | |
HO_EXPORT OCI::Session | CreateSession () const |
Creates an Session object. | |
HO_EXPORT OCI::ServiceContext | CreateServiceContext () const |
Creates a ServiceContext object. | |
HO_EXPORT OCI::TransactionHandle | CreateTransaction (const OCI::ServiceContext &serviceContext) const |
Creates a TransactionHandle object. | |
HO_EXPORT OCI::Subscription | CreateSubscription () const |
Creates a Subscription object. | |
template<WideStringLike StringT> | |
OCI::Subscription | CreateSubscription (const StringT &subscriptionName) const |
Creates a Subscription object and sets the subscription name. | |
template<WideStringLike StringT = WideString> | |
StringT | BindDN () const |
The login name (DN) for LDAP connections. | |
template<WideStringLike StringT> | |
void | SetBindDN (const StringT &loginName) const |
Sets the login name (DN) for LDAP connections. | |
bool | CacheArrayFlush () const |
When this attribute is set to TRUE, during OCICacheFlush() the objects that belong to the same table are flushed together, which can considerably improve performance. This mode should only be used when the order in which the objects are flushed is not important. During this mode it is not guaranteed that the order in which the objects are marked dirty is preserved. | |
void | SetCacheArrayFlush (bool value) const |
UInt32 | CacheMaxSize () const |
Retrieves the maximum size (high watermark) for the client-side object cache as a percentage of the optimal size. | |
void | SetCacheMaxSize (UInt32 value) const |
Sets the maximum size (high watermark) for the client-side object cache as a percentage of the optimal size. Set the value at 110% of the optimal size (OCI_ATTR_CACHE_OPT_SIZE). | |
UInt32 | CacheOptimalSize () const |
Retrieves the optimal size for the client-side object cache in bytes. | |
void | SetCacheOptimalSize (UInt32 value) const |
Sets the optimal size for the client-side object cache in bytes. The default value is 8M bytes. | |
UInt16 | NationalCharacterSetId () const |
Retrieves the local (client-side) national character set ID. | |
bool | UsesUnicode () const |
Encoding method is UTF-16. | |
UInt16 | LDAPAuthenticationMode () const |
The authentication mode. | |
template<WideStringLike StringT = WideString> | |
StringT | LDAPCredentials () const |
If the authentication method is "simple authentication" ( username / password authentication ), then this attribute holds the password to use when connecting to the LDAP server. | |
template<WideStringLike StringT> | |
void | SetLDAPCredentials (const StringT &credentials) const |
template<WideStringLike StringT = WideString> | |
StringT | LDAPContext () const |
The administrative context of the client. This is usually the root of the Oracle RDBMS LDAP schema in the LDAP server. | |
template<WideStringLike StringT> | |
void | SetLDAPContext (const StringT &context) const |
template<WideStringLike StringT = WideString> | |
StringT | LDAPHost () const |
The name of the host on which the LDAP server runs. | |
template<WideStringLike StringT> | |
void | SetLDAPHost (const StringT &host) const |
UInt16 | LDAPPort () const |
The port on which the LDAP server is listening. | |
void | SetLDAPPort (UInt16 port) const |
The port on which the LDAP server is listening. | |
bool | ObjectsEnabled () const |
Returns true if the environment was initialized in object mode. | |
PinOption | DefaultPinOption () const |
Retrieves the value of OCI_PIN_DEFAULT for the application associated with the environment handle. | |
void | SetDefaultPinOption (PinOption pinOption) const |
Sets the value of OCI_PIN_DEFAULT for the application associated with the environment handle. | |
UInt16 | DefaultAllocationDuration () const |
Retrieves the value of Duration::Default for allocation durations for the application associated with the environment handle. | |
void | SetDefaultAllocationDuration (UInt16 durationValue) const |
Sets the value of Duration::Default for allocation durations for the application associated with the environment handle. | |
void | SetDefaultAllocationDuration (Duration durationValue) const |
UInt16 | DefaultPinDuration () const |
Retrieves the value of Duration::Default for pin durations for the application associated with the environment handle. | |
void | SetDefaultPinDuration (UInt16 durationValue) const |
Sets the value of Duration::Default for pin durations for the application associated with the environment handle. | |
void | SetDefaultPinDuration (Duration durationValue) const |
Sets the value of Duration::Default for pin durations for the application associated with the environment handle. | |
UInt32 | HeapAllocated () const |
Retrieves the current size of the memory allocated from the environment handle. This may help you track where memory is being used most in an application. | |
bool | AttributesOnNewObjectsIsNotNull () const |
If true, newly created objects have non-NULL attributes. | |
void | SetAttributesOnNewObjectsIsNotNull (bool value) const |
If true, newly created objects have non-NULL attributes. | |
UInt32 | SharedHeapAllocated () const |
Returns the size of the memory currently allocated from the shared pool. This attribute works on any environment handle but the process must be initialized in shared mode to return a meaningful value. | |
template<WideStringLike StringT = WideString> | |
StringT | SSLWalletLocation () const |
If the authentication method is SSL authentication, this attribute contains the location of the client wallet. | |
template<WideStringLike StringT> | |
void | SetSSLWalletLocation (const StringT &location) const |
If the authentication method is SSL authentication, this attribute contains the location of the client wallet. | |
template<WideStringLike StringT> | |
Subscription | CreateSubscription (const StringT &subscriptionName) const |
![]() | |
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 Member Functions | |
static HO_EXPORT EnvironmentMode | DefaultEnvironmentMode () |
static HO_EXPORT void | SetDefaultEnvironmentMode (EnvironmentMode defaultEnvironmentMode) |
Static Public Attributes | |
static constexpr OCI::HandleType | OCIHandleType = OCI::HandleType::Environment |
Private Types | |
using | Base = HandleBase |
Static Private Member Functions | |
static HO_EXPORT void * | CreateEnvironment () |
Private Attributes | |
OCI::ErrorHandle | error_ |
Static Private Attributes | |
static std::atomic< EnvironmentMode > | defaultEnvironmentMode_ |
Additional Inherited Members | |
![]() | |
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. | |
HandleBase & | operator= (const HandleBase &other)=delete |
constexpr HandleBase & | operator= (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::Number * | GetNumberAttribute (Attribute attribute) const |
Gets the value of an attribute from the handle as a pointer to an OCI::Number. | |
![]() | |
static HO_EXPORT void | HandleFree (void *handle, OCI::HandleType handleType) noexcept |
Calls OCIHandleFree to release the handle. | |
The environment handle defines a context in which all OCI functions are invoked.
Each environment handle contains a memory cache that enables fast memory access. All memory allocation under the environment handle is done from this cache. Access to the cache is serialized when multiple threads try to allocate memory under the same environment handle. When multiple threads share a single environment handle, they may block on access to the cache.
|
private |
|
inlineconstexprnoexcept |
|
inline |
|
delete |
|
inlineconstexprnoexcept |
|
inline |
If true, newly created objects have non-NULL attributes.
|
inline |
The login name (DN) for LDAP connections.
|
inline |
When this attribute is set to TRUE, during OCICacheFlush() the objects that belong to the same table are flushed together, which can considerably improve performance. This mode should only be used when the order in which the objects are flushed is not important. During this mode it is not guaranteed that the order in which the objects are marked dirty is preserved.
|
inline |
Retrieves the maximum size (high watermark) for the client-side object cache as a percentage of the optimal size.
|
inline |
Retrieves the optimal size for the client-side object cache in bytes.
|
staticprivate |
OCI::ErrorHandle Harlinn::OCI::Environment::CreateError | ( | ) | const |
Creates an ErrorHandle object.
An error handle is passed as a parameter to most OCI calls. The error handle maintains information about errors that occur during an OCI operation.
OCI::Server Harlinn::OCI::Environment::CreateServer | ( | ) | const |
ServiceContext Harlinn::OCI::Environment::CreateServiceContext | ( | ) | const |
Creates a ServiceContext object.
A service context handle defines attributes that determine the operational context for OCI calls to a server.
OCI::Session Harlinn::OCI::Environment::CreateSession | ( | ) | const |
Subscription Harlinn::OCI::Environment::CreateSubscription | ( | ) | const |
Creates a Subscription object.
The subscription handle is used by an OCI client application that registers and subscribes to receive notifications of database events or events in the AQ namespace.
|
inline |
Creates a Subscription object and sets the subscription name.
The subscription handle is used by an OCI client application that registers and subscribes to receive notifications of database events or events in the AQ namespace.
|
inline |
OCI::TransactionHandle Harlinn::OCI::Environment::CreateTransaction | ( | const OCI::ServiceContext & | serviceContext | ) | const |
Creates a TransactionHandle object.
|
inline |
Retrieves the value of Duration::Default for allocation durations for the application associated with the environment handle.
|
static |
|
inline |
Retrieves the value of Duration::Default for pin durations for the application associated with the environment handle.
|
inline |
Retrieves the value of OCI_PIN_DEFAULT for the application associated with the environment handle.
For example, if DefaultPinOption is set to PinOption::Recent, then if OCIObjectPin( ) is called with the pin_option parameter set to PinOption::Default, then the object is pinned in PinOption::Recent mode.
|
inlinefinaloverridevirtualnoexcept |
Provides access to the OCIError that will be used for OCI calls for this object.
Implements Harlinn::OCI::HandleBase.
|
inline |
Retrieves the current size of the memory allocated from the environment handle. This may help you track where memory is being used most in an application.
|
inline |
The authentication mode.
The following are the valid values:
|
inline |
The administrative context of the client. This is usually the root of the Oracle RDBMS LDAP schema in the LDAP server.
|
inline |
If the authentication method is "simple authentication" ( username / password authentication ), then this attribute holds the password to use when connecting to the LDAP server.
|
inline |
The name of the host on which the LDAP server runs.
|
inline |
The port on which the LDAP server is listening.
|
inline |
Retrieves the local (client-side) national character set ID.
Users can update this setting only after creating the environment handle but before calling any other OCI functions. This restriction ensures the consistency among data and metadata in the same environment handle. In UTF-16 mode, an attempt to get this attribute is invalid.
|
inline |
Returns true if the environment was initialized in object mode.
|
delete |
|
inlineconstexprnoexcept |
|
inline |
If true, newly created objects have non-NULL attributes.
value | The new value |
|
inline |
Sets the login name (DN) for LDAP connections.
loginName |
|
inline |
|
inline |
Sets the maximum size (high watermark) for the client-side object cache as a percentage of the optimal size. Set the value at 110% of the optimal size (OCI_ATTR_CACHE_OPT_SIZE).
The object cache uses the maximum and optimal values for freeing unused memory in the object cache.
value | the new value |
|
inline |
Sets the optimal size for the client-side object cache in bytes. The default value is 8M bytes.
value | The new value |
|
inline |
|
inline |
Sets the value of Duration::Default for allocation durations for the application associated with the environment handle.
durationValue |
|
static |
|
inline |
Sets the value of Duration::Default for pin durations for the application associated with the environment handle.
durationValue | The new value |
|
inline |
Sets the value of Duration::Default for pin durations for the application associated with the environment handle.
durationValue | The new value |
|
inline |
Sets the value of OCI_PIN_DEFAULT for the application associated with the environment handle.
For example, if DefaultPinOption is set to PinOption::Recent, then if OCIObjectPin( ) is called with the pin_option parameter set to PinOption::Default, then the object is pinned in PinOption::Recent mode.
|
inline |
|
inline |
|
inline |
|
inline |
The port on which the LDAP server is listening.
|
inline |
If the authentication method is SSL authentication, this attribute contains the location of the client wallet.
|
inline |
Returns the size of the memory currently allocated from the shared pool. This attribute works on any environment handle but the process must be initialized in shared mode to return a meaningful value.
|
inline |
If the authentication method is SSL authentication, this attribute contains the location of the client wallet.
|
inlineconstexprnoexcept |
|
inline |
Encoding method is UTF-16.
|
staticprivate |
|
private |
|
staticconstexpr |