UCommon
|
Generic templates for C++. More...
Go to the source code of this file.
Data Structures | |
class | ucommon::array_pointer< T > |
Generic smart array class. More... | |
class | ucommon::pointer< T > |
Generic smart pointer class. More... | |
class | ucommon::save_restore< T > |
Save and restore global objects in function call stack frames. More... | |
Namespaces | |
namespace | ucommon |
Common namespace for all ucommon objects. | |
Macros | |
#define | THROW(x) throw x |
#define | THROWS(x) throw(x) |
#define | THROWS_ANY throw() |
Functions | |
template<typename T > | |
bool | ucommon::bound (const T *pointer, const T *base, size_t count) |
Convenience function to check memory arrays. | |
template<typename T > | |
T & | ucommon::clear (T &o) |
template<typename T > | |
T | ucommon::copy (const T &src) |
Convenience function to copy objects. | |
template<typename T > | |
T & | ucommon::copy (const T &src, T &to) |
template<typename T > | |
void | ucommon::copy_unsafe (T *target, const T *source) |
Convenience function to copy class. | |
template<typename T > | |
T & | ucommon::deref_pointer (T *pointer) |
Convert a pointer to a reference with type checking. | |
template<typename T > | |
T * | ucommon::dup (const T &object) |
Convenience function to duplicate object pointer to heap. | |
template<> | |
char * | ucommon::dup< char > (const char &object) |
template<typename T > | |
void | ucommon::dupfree (T object) |
template<> | |
void | ucommon::dupfree< char * > (char *object) |
template<typename T > | |
bool | ucommon::is (T &object) |
Convenience function to validate object assuming it is castable to bool. | |
template<typename T > | |
bool | ucommon::isnull (T &object) |
Convenience function to test pointer object. | |
template<typename T > | |
bool | ucommon::isnullp (T *object) |
Convenience function to test pointer-pointer object. | |
template<typename T > | |
T & | ucommon::limit (T &value, T &low, T &high) |
Convenience macro to range restrict values. | |
template<typename T > | |
T & | ucommon::max (T &o1, T &o2) |
Convenience function to return max of two objects. | |
template<typename T > | |
T & | ucommon::min (T &o1, T &o2) |
Convenience function to return min of two objects. | |
template<typename T > | |
T & | ucommon::move (T &src, T &to) |
Convenience function to move objects. | |
template<typename T > | |
void | ucommon::reset_unsafe (T &object) |
Convenience function to reset an existing object. | |
template<typename T > | |
void | ucommon::store_unsafe (T &target, const T *source) |
Convenience function to store object pointer into object. | |
template<typename T > | |
void | ucommon::swap (T &o1, T &o2) |
Convenience function to swap objects. | |
template<typename T > | |
void | ucommon::zero_unsafe (T &object) |
Convenience function to zero an object and restore type info. | |
Generic templates for C++.
These are templates that do not depend on any ucommon classes. They can be used for generic C++ programming.
Definition in file generics.h.
#define THROW | ( | x | ) | throw x |
Definition at line 37 of file generics.h.
#define THROWS | ( | x | ) | throw(x) |
Definition at line 38 of file generics.h.
#define THROWS_ANY throw() |
Definition at line 39 of file generics.h.