UCommon
Data Structures | Namespaces | Defines | Functions
/usr/src/RPM/BUILD/ucommon-6.3.3/inc/ucommon/generics.h File Reference

Generic templates for C++. More...

#include <ucommon/cpr.h>
#include <cstdlib>
#include <cstring>
#include <stdexcept>
Include dependency graph for generics.h:
This graph shows which files directly or indirectly include this file:

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...
class  ucommon::temp_array< T >
 Manage temporary array stored on the heap. More...
class  ucommon::temporary< T >
 Manage temporary object stored on the heap. More...

Namespaces

namespace  ucommon
 

Common namespace for all ucommon objects.


Defines

#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 >
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<class 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 >
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.

Detailed Description

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.