Programming Idioms
[SHORE Storage Manager Application Programming Interface (SSM API)]

Collaboration diagram for Programming Idioms:

The storage manager is written with programming idioms that make sure all return codes are checked, and users of the storage manager are strongly encouraged to use these idioms.

The macros support writing and reading of methods and functions that return an w_rc_t (return code), which are defined in w_rc.h. Return codes are described in some detail ERRNUM. There you may also see how to create your own return codes for server modules.

 w_rc_t
 method(args...)
 {
     W_DO(ss_m::create_file(...));
     return RCOK;
 }

The W_DO macro returns whatever the called function returns if that return code was an error code, otherwise, it falls through to the code below the macro call. This is the most-often used idiom.

The RC_* macros let you construct a return code for a return value from a function. The normal, non-error return code is RCOK.

See the examples as well as Significant C Preprocessor Macros in w_rc.h.


Generated on Wed Jul 7 17:22:33 2010 for Shore Storage Manager by  doxygen 1.4.7