Skip Headers

Oracle C++ Call Interface Programmer's Guide
Release 2 (9.2)

Part Number A96583-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

OCCI Classes and Methods, 17 of 22


RefAny Class

The RefAny class is designed to support a reference to any type. Its primary purpose is to handle generic references and allow conversions of Ref in the type hierarchy. A RefAny object can be used as an intermediary between any two types, Ref<x> and Ref<y>, where x and y are different types.

A Ref<T> can always be converted to a RefAny; there is a method to perform the conversion in the Ref<T> template. Each Ref<T> has a constructor and assignment operator that takes a reference to RefAny.

RefAny();
RefAny(const Connection *sessptr, const OCIRef *Ref);
RefAny(const RefAny& src);

Summary of RefAny Methods

Table 8-17 RefAny Methods  
Method Summary

clear()

Clear the reference.

getConnection()

Return the connection this ref was created from.

getRef()

Return the Ref.

isNull()

Check if the RefAny object is null.

markDelete()

Mark the object as deleted.

operator=()

Assignment operator.

operator==()

Check if equal.

operator!=()

Check if not equal.

unmarkDelete()

Unmark the object as deleted.

clear()

This method clears the reference.

Syntax
void clear();

getConnection()

Returns the connection from which this ref was instantiated.

Syntax
const Connection * getConnection() const;

getRef()

Returns the underlying OCIRef *

Syntax
LNOCIRef* getRef() const;

isNull()

Returns true if the object pointed to by this ref is null else false.

Syntax
bool isNull() const;

markDelete()

This method marks the referred object as deleted.

Syntax
void markDelete();

operator=()

Assigns the ref or the object to a ref. For the first case, the refs are assigned and for the second case, the ref is constructed from the object and then assigned.

Syntax
RefAny& operator=(const RefAny& src);
Parameters
src

The source RefAny object to be assigned.

operator==()

Compares this ref with the RefAny object and returns true if both the refs are referring to the same object in the cache, otherwise it returns false.

Syntax
bool operator== (const RefAny &refAnyR) const;
Parameters
refAnyR

RefAny object to be compared with.

operator!=()

Compares this ref with the RefAny object and returns true if both the refs are not referring to the same object in the cache, otherwise it returns false.

Syntax
bool operator!= (const RefAny &refAnyR) const;
Parameters
refAnyR

RefAny object to be compared with.

unmarkDelete()

This method unmarks the referred object as dirty.

Syntax
void unmarkDelete();


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 2001, 2002 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table Of Contents
Contents
Go To Index
Index

Master Index

Feedback