10.12.2012 Views

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Where the Markers Can Be Used<br />

Carrying Forward User Added Code<br />

To use OTT markers user must use command line option USE_MARKER=TRUE, to<br />

inform OTT that use of marker should be supported, while invoking OTT. User can<br />

use OTT markers as described later to carry forward user added code.<br />

1. User code added in .h file.<br />

a. User code added in global scope. This is typically the case when user<br />

needs to include different header files, forward declaration, and so on. Refer<br />

to the code example provided later.<br />

b. User code added in class declaration. At any point of time OTT generated<br />

class declaration will have private scope for data members and public scope<br />

for methods, or protected scope for data members and public scope for<br />

methods. User blocks can be added after all OTT generated declarations<br />

in either access specifiers.<br />

The following code example demonstrates where user code can be added in a .h<br />

file:<br />

#ifndef ...<br />

# define ...<br />

#ifndef OTT_USERCODE_START<br />

# define OTT_USERCODE_START<br />

#endif<br />

#ifndef OTT_USERCODE_END<br />

# define OTT_USERCODE_END<br />

#endif<br />

#ifndef OCCI_ORACLE<br />

# include <br />

#endif<br />

OTT_USERCODE_START // user added code<br />

...<br />

OTT_USERCODE_END<br />

#ifndef ... // OTT generated include<br />

# include " ... "<br />

#endif<br />

OTT_USERCODE_START // user added code<br />

...<br />

OTT_USERCODE_END<br />

How to Use the Object Type Translator Utility 7-65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!