beautypg.com

HP Integrity NonStop J-Series User Manual

Page 187

background image

RWDEFINE_PERSISTABLE_TEMPLATE(YourClass) will expand to generate the source
code for the following global functions:

template
RWvostream& operator<<
(RWvostream& strm, const YourClass& item)

template
RWvistream& operator>>
(RWvistream& strm, YourClass& obj)

template
RWvistream& operator>>
(RWvistream& strm, YourClass*& pObj)

template
RWFile& operator<<(RWFile& strm, const YourClass& item)

template
RWFile& operator>>(RWFile& strm, YourClass& obj)

template
RWFile& operator>>(RWFile& strm, YourClass*& pObj)

For templatized classes with more than one and less than five template parameters, use
one of the following macros from rw/epersist.h:

// For YourClass:
RWDEFINE_PERSISTABLE_TEMPLATE_2(YourClass)

// For YourClass:
RWDEFINE_PERSISTABLE_TEMPLATE_3(YourClass)

// For YourClass:
RWDEFINE_PERSISTABLE_TEMPLATE_4(YourClass)

Remember, if your templatized class has any non-type template parameters, it cannot be
isomorphically persisted.

If you need to persist templatized classes with five or more template parameters, you can
write additional macros for RWDEFINE_PERSISTABLE_TEMPLATE_n. The macros are
found in the header file rw/epersist.h.

Check for Possible Problems

You've made the necessary data accessible, and declared and defined the global functions required for
isomorphic persistence. Before you go any further, you need to review your work for two possible
problems.

This manual is related to the following products: