User talk:Kr/UNO References
From Apache OpenOffice Wiki
Additional requirements for UNO References:
- a second dimension, reflecting the purpose (thread unsafe, thread safe, thread affine, debug ...)
- ABI (or runtime): com::sun::star:uno::Reference needs to become the "thread safe" reference
- API (or build time) com::sun::star::uno::Reference needs to be mappable per define to any other purpose reference
- A generic specialisation to be created and casted to any other reference, internally doing a mapping.
This allows for compile and runtime detection of mistakenly mixed references!
New generic UNO Reference:
template<typename T, char const * pPurpose>
EnvReverence
A reference to thread safe objects:
template<typename T>
struct SafeReference {
typedef EnvReference<T, safe> Type;
};
The classical UNO reference "com::sun::star::uno::Reference" is "define" dependent generically mapped to the new UNO reference "com::sun::star::uno::EnvReference".