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

OCIPL::OciSimpleHandle< TYPE > Struct Template Reference

"simple" OCI handles without OciEnv More...

#include <ocipl.h>

Inheritance diagram for OCIPL::OciSimpleHandle< TYPE >:
Inheritance graph
[legend]
Collaboration diagram for OCIPL::OciSimpleHandle< TYPE >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef OciHandleID< TYPE > super
typedef TYPE HandleType

Public Member Functions

 OciSimpleHandle ()
 OciSimpleHandle (OCIEnv *envh, HandleType *handle)
 OciSimpleHandle (OCIEnv *envh)
 ~OciSimpleHandle ()
 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

template<typename TYPE>
struct OCIPL::OciSimpleHandle< TYPE >

"simple" OCI handles without OciEnv

Definition at line 407 of file ocipl.h.


Member Typedef Documentation

template<typename TYPE>
typedef TYPE OCIPL::OciSimpleHandle< TYPE >::HandleType

Definition at line 410 of file ocipl.h.

template<typename TYPE>
typedef OciHandleID<TYPE> OCIPL::OciSimpleHandle< TYPE >::super

Reimplemented in OCIPL::OciEnvAlloc.

Definition at line 409 of file ocipl.h.


Constructor & Destructor Documentation

template<typename TYPE>
OCIPL::OciSimpleHandle< TYPE >::OciSimpleHandle (  ) [inline]

Definition at line 413 of file ocipl.h.

     : _handle(0), _envh(0)
    {
    }
template<typename TYPE>
OCIPL::OciSimpleHandle< TYPE >::OciSimpleHandle ( OCIEnv *  envh,
HandleType handle 
) [inline]

Definition at line 419 of file ocipl.h.

     : _envh(envh), _handle(handle)
    {
    }
template<typename TYPE>
OCIPL::OciSimpleHandle< TYPE >::OciSimpleHandle ( OCIEnv *  envh ) [inline]

Definition at line 425 of file ocipl.h.

     : _handle(0)
    {
        alloc(envh);
    }
template<typename TYPE>
OCIPL::OciSimpleHandle< TYPE >::~OciSimpleHandle (  ) [inline]

Definition at line 432 of file ocipl.h.

    {
        if (_handle)
            destroy();
    }

Member Function Documentation

template<typename TYPE>
void OCIPL::OciSimpleHandle< TYPE >::alloc ( OCIEnv *  envh ) [inline]

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);
    }
template<typename TYPE>
void OCIPL::OciSimpleHandle< TYPE >::destroy (  ) [inline]

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;
        }
    }
template<typename TYPE>
ub4 OCIPL::OciHandleID< TYPE >::get_attr_id (  ) [inline, static, inherited]

Definition at line 400 of file ocipl.h.

{return OCI_ATTR_SERVER;}
template<typename TYPE>
void OCIPL::OciSimpleHandle< TYPE >::get_attribute ( dvoid *  attributep,
ub4 *  sizep,
ub4  attrtype,
OCIError *  errh 
) [inline]

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);
    }
template<typename TYPE>
ub4 OCIPL::OciHandleID< TYPE >::get_type_id (  ) [inline, static, inherited]

Definition at line 378 of file ocipl.h.

{return OCI_HTYPE_ENV;}
template<typename TYPE>
OCIPL::OciSimpleHandle< TYPE >::operator HandleType * (  ) [inline]

Definition at line 439 of file ocipl.h.

    {
        return _handle;
    }

Member Data Documentation

template<typename TYPE>
OCIEnv* OCIPL::OciSimpleHandle< TYPE >::_envh [protected]

Definition at line 478 of file ocipl.h.

template<typename TYPE>
HandleType* OCIPL::OciSimpleHandle< TYPE >::_handle [protected]

Definition at line 477 of file ocipl.h.


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