Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes

OCIPL::OciEnvAlloc Struct Reference

wrapper for the OCIEnv handle More...

#include <ocipl.h>

Inheritance diagram for OCIPL::OciEnvAlloc:
Inheritance graph
[legend]
Collaboration diagram for OCIPL::OciEnvAlloc:
Collaboration graph
[legend]

List of all members.

Public Types

typedef OciSimpleHandle< OCIEnv > super
typedef OCIEnv HandleType

Public Member Functions

 OciEnvAlloc (ub4 oci_mode=OCI_OBJECT)
 operator HandleType * ()
void alloc (OCIEnv *envh)
void destroy ()
void get_attribute (dvoid *attributep, ub4 *sizep, ub4 attrtype, OCIError *errh)

Static Public Member Functions

static ub4 get_type_id ()
static ub4 get_attr_id ()

Protected Attributes

HandleType_handle
OCIEnv * _envh

Detailed Description

wrapper for the OCIEnv handle

Definition at line 533 of file ocipl.h.


Member Typedef Documentation

typedef OCIEnv OCIPL::OciSimpleHandle< OCIEnv >::HandleType [inherited]

Definition at line 410 of file ocipl.h.

Reimplemented from OCIPL::OciSimpleHandle< OCIEnv >.

Definition at line 535 of file ocipl.h.


Constructor & Destructor Documentation

OCIPL::OciEnvAlloc::OciEnvAlloc ( ub4  oci_mode = OCI_OBJECT ) [inline]

Definition at line 538 of file ocipl.h.

    {
#if ORACLE_VERSION>=81
#ifdef UNICODE
        sword res = OCIEnvNlsCreate(&_handle, oci_mode, 0/*ctxp*/, 0, 0, 0, 0/*xtramem_sz*/, 0/*usrmempp*/, OCI_UTF16ID, OCI_UTF16ID);
#else
        sword res = OCIEnvCreate(&_handle, oci_mode, 0/*ctxp*/, 0, 0, 0, 0/*xtramem_sz*/, 0/*usrmempp*/);
#endif
        //oci_check_error(res);
#else
        sword res = OCIInitialize(oci_mode, 0/*ctxp*/, 0, 0, 0);
        //oci_check_error(res);

        OCIEnvInit(&_handle, OCI_DEFAULT, (size_t)0, (dvoid **) 0);
#endif
    }

Member Function Documentation

void OCIPL::OciSimpleHandle< OCIEnv >::alloc ( OCIEnv *  envh ) [inline, inherited]

Definition at line 445 of file ocipl.h.

    {
         // If we already manage a handle, free it.
        if (_handle)
            destroy();

        _envh = envh;

        sword res = OCIHandleAlloc(envh, (dvoid**)&_handle, super::get_type_id(), 0, 0);
        oci_check_error(envh, res);
    }
void OCIPL::OciSimpleHandle< OCIEnv >::destroy (  ) [inline, inherited]

Definition at line 458 of file ocipl.h.

    {
        sword res = OCIHandleFree(_handle, super::get_type_id());
        _handle = 0;

        if (_envh) {
            oci_check_error(_envh, res);
            _envh = 0;
        }
    }
static ub4 OCIPL::OciHandleID< OCIEnv >::get_attr_id (  ) [static, inherited]
void OCIPL::OciSimpleHandle< OCIEnv >::get_attribute ( dvoid *  attributep,
ub4 *  sizep,
ub4  attrtype,
OCIError *  errh 
) [inline, inherited]

Definition at line 470 of file ocipl.h.

    {
        sword res = OCIAttrGet(_handle, super::get_type_id(), attributep, sizep, attrtype, errh);
        oci_check_error(_envh, res);
    }
static ub4 OCIPL::OciHandleID< OCIEnv >::get_type_id (  ) [static, inherited]
OCIPL::OciSimpleHandle< OCIEnv >::operator HandleType * (  ) [inline, inherited]

Definition at line 439 of file ocipl.h.

    {
        return _handle;
    }

Member Data Documentation

OCIEnv* OCIPL::OciSimpleHandle< OCIEnv >::_envh [protected, inherited]

Definition at line 478 of file ocipl.h.

HandleType* OCIPL::OciSimpleHandle< OCIEnv >::_handle [protected, inherited]

Definition at line 477 of file ocipl.h.


The documentation for this struct was generated from the following file: