OCILIB (C and C++ Driver for Oracle)  4.7.5
Open source and cross platform Oracle Driver delivering efficient access to Oracle databases.
Loading...
Searching...
No Matches
ocilib::Reference Class Reference

Object identifying the SQL data type REF. More...

#include <types.hpp>

Inherits ocilib::core::HandleHolder< OCI_Ref * >, and ocilib::core::Streamable.

Public Member Functions

 Reference ()
 Create an empty null Reference instance.
 
 Reference (const TypeInfo &typeInfo)
 Parametrized constructor.
 
TypeInfo GetTypeInfo () const
 Return the TypeInfo object describing the referenced object.
 
Object GetObject () const
 Returns the object pointed by the reference.
 
bool IsReferenceNull () const
 Check if the reference points to an object or not.
 
void SetReferenceNull ()
 Nullify the given Ref handle.
 
Reference Clone () const
 Clone the current instance to a new one performing deep copy.
 
ostring ToString () const override
 return a string representation of the current reference
 

Detailed Description

Object identifying the SQL data type REF.

This class wraps the OCILIB object handle OCI_Ref and its related methods

Definition at line 4844 of file types.hpp.

Constructor & Destructor Documentation

◆ Reference() [1/2]

ocilib::Reference::Reference ( )
inline

Create an empty null Reference instance.

Definition at line 31 of file Reference.hpp.

◆ Reference() [2/2]

ocilib::Reference::Reference ( const TypeInfo typeInfo)
inline

Parametrized constructor.

Parameters
typeInfo- type info descriptor

Definition at line 35 of file Reference.hpp.

References ocilib::core::Check(), ocilib::TypeInfo::GetConnection(), and OCI_RefCreate().

Member Function Documentation

◆ GetTypeInfo()

TypeInfo ocilib::Reference::GetTypeInfo ( ) const
inline

Return the TypeInfo object describing the referenced object.

Definition at line 50 of file Reference.hpp.

References ocilib::core::Check(), OCI_RefGetTypeInfo(), and OCI_TypeInfoGetConnection().

Referenced by Clone().

◆ GetObject()

Object ocilib::Reference::GetObject ( ) const
inline

Returns the object pointed by the reference.

Returns
The object may bu null is the current reference value is null

Definition at line 63 of file Reference.hpp.

References ocilib::core::Check(), and OCI_RefGetObject().

◆ IsReferenceNull()

bool ocilib::Reference::IsReferenceNull ( ) const
inline

Check if the reference points to an object or not.

Definition at line 77 of file Reference.hpp.

References ocilib::core::Check(), and OCI_RefIsNull().

◆ SetReferenceNull()

void ocilib::Reference::SetReferenceNull ( )
inline

Nullify the given Ref handle.

Note
this call clears the reference to object pointed by the reference object.

Definition at line 82 of file Reference.hpp.

References ocilib::core::Check(), and OCI_RefSetNull().

◆ Clone()

Reference ocilib::Reference::Clone ( ) const
inline

Clone the current instance to a new one performing deep copy.

Definition at line 68 of file Reference.hpp.

References ocilib::core::Check(), GetTypeInfo(), and OCI_RefAssign().

◆ ToString()

ostring ocilib::Reference::ToString ( ) const
inlineoverridevirtual

return a string representation of the current reference

Implements ocilib::core::Streamable.

Definition at line 87 of file Reference.hpp.

References ocilib::core::Check(), ocilib::core::MakeString(), OCI_RefGetHexSize(), and OCI_RefToText().