1 #ifndef _library__globalwrap__hpp__included__
2 #define _library__globalwrap__hpp__included__
7 * Wrapper for glboal/module-local objects accessable in global ctor context.
14 * Ctor, forces the object to be constructed (to avoid races).
16 globalwrap() throw(std::bad_alloc
)
21 * Get the wrapped object.
23 * returns: The wrapped object.
24 * throws std::bad_alloc: Not enough memory.
26 T
& operator()() throw(std::bad_alloc
)
29 if(!state
) //State initializes to 0.
32 std::cerr
<< "Warning: Recursive use of globalwrap<T>." << std::endl
;