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

OCIPL::OciHandle< TYPE > Struct Template Reference

OCI handles. More...

#include <ocipl.h>

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

List of all members.

Public Types

typedef OciHandleID< TYPE > super
typedef TYPE HandleType

Public Member Functions

 OciHandle (OciEnv &env)
 OciHandle (OciEnv &env, HandleType *handle)
 OciHandle (const OciHandle &other)
 ~OciHandle ()
void alloc ()
void destroy ()
void set_attribute (ub4 attrtype, const tstring &str)
void set_attribute (ub4 attrtype, ub4 value)
void get_attribute (dvoid *attributep, ub4 *sizep, ub4 attrtype)
void set_attribute_handle (ub4 attrtype, void *handle)
template<typename ATTR >
void set_attribute (ATTR &attr)
 operator HandleType * ()

Static Public Member Functions

static ub4 get_type_id ()
static ub4 get_attr_id ()

Public Attributes

OciEnv_env

Protected Attributes

HandleType_handle

Detailed Description

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

OCI handles.

Definition at line 560 of file ocipl.h.


Member Typedef Documentation

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

Definition at line 563 of file ocipl.h.

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

Reimplemented in OCIPL::OracleServer, OCIPL::OciLogin, and OCIPL::SqlStatement.

Definition at line 562 of file ocipl.h.


Constructor & Destructor Documentation

template<typename TYPE>
OCIPL::OciHandle< TYPE >::OciHandle ( OciEnv env ) [inline]

Definition at line 566 of file ocipl.h.

     :  _env(env),
        _handle(0)
    {
        alloc();
    }
template<typename TYPE>
OCIPL::OciHandle< TYPE >::OciHandle ( OciEnv env,
HandleType handle 
) [inline]

Definition at line 574 of file ocipl.h.

     :  _env(env),
        _handle(handle)
    {
    }
template<typename TYPE>
OCIPL::OciHandle< TYPE >::OciHandle ( const OciHandle< TYPE > &  other ) [inline]

Definition at line 581 of file ocipl.h.

     :  _env(other._env),
        _handle(other._handle)
    {
        other._handle = NULL;
    }
template<typename TYPE>
OCIPL::OciHandle< TYPE >::~OciHandle (  ) [inline]

Definition at line 589 of file ocipl.h.

    {
        if (_handle)
            destroy();
    }

Member Function Documentation

template<typename TYPE>
void OCIPL::OciHandle< TYPE >::alloc (  ) [inline]

Definition at line 596 of file ocipl.h.

    {
        if (_handle)
            destroy();

        sword res = OCIHandleAlloc(_env, (dvoid**)&_handle, super::get_type_id(), 0, 0);
        oci_check_error(_env, res);
    }
template<typename TYPE>
void OCIPL::OciHandle< TYPE >::destroy (  ) [inline]

Definition at line 606 of file ocipl.h.

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

        oci_check_error(_env, res);
    }
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::OciHandle< TYPE >::get_attribute ( dvoid *  attributep,
ub4 *  sizep,
ub4  attrtype 
) [inline]

Definition at line 629 of file ocipl.h.

    {
        sword res = OCIAttrGet(_handle, super::get_type_id(), attributep, sizep, attrtype, _env._errh);
        oci_check_error(_env, 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::OciHandle< TYPE >::operator HandleType * (  ) [inline]

Definition at line 650 of file ocipl.h.

    {
        return _handle;
    }
template<typename TYPE>
template<typename ATTR >
void OCIPL::OciHandle< TYPE >::set_attribute ( ATTR &  attr ) [inline]

Definition at line 643 of file ocipl.h.

    {
        sword res = OCIAttrSet(_handle, super::get_type_id(), attr, 0, ATTR::get_attr_id(), _env._errh);
        oci_check_error(_env, res);
    }
template<typename TYPE>
void OCIPL::OciHandle< TYPE >::set_attribute ( ub4  attrtype,
ub4  value 
) [inline]

Definition at line 622 of file ocipl.h.

    {
        sword res = OCIAttrSet(_handle, super::get_type_id(), (OraText*)&value, (ub4)sizeof(value), attrtype, _env._errh);
        oci_check_error(_env, res);
    }
template<typename TYPE>
void OCIPL::OciHandle< TYPE >::set_attribute ( ub4  attrtype,
const tstring str 
) [inline]

Definition at line 615 of file ocipl.h.

    {
        sword res = OCIAttrSet(_handle, super::get_type_id(), (TOraText*)str.c_str(), (ub4)str.length()*sizeof(TOraText), attrtype, _env._errh);
        oci_check_error(_env, res);
    }
template<typename TYPE>
void OCIPL::OciHandle< TYPE >::set_attribute_handle ( ub4  attrtype,
void *  handle 
) [inline]

Definition at line 636 of file ocipl.h.

    {
        sword res = OCIAttrSet(_handle, super::get_type_id(), handle, 0, attrtype, _env._errh);
        oci_check_error(_env, res);
    }

Member Data Documentation

template<typename TYPE>
OciEnv& OCIPL::OciHandle< TYPE >::_env

Definition at line 659 of file ocipl.h.

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

Definition at line 656 of file ocipl.h.

Referenced by OCIPL::OciHandle< OCIServer >::OciHandle().


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