ucommon/object.h File Reference
A common object base class with auto-pointer support.
More...
#include <ucommon/platform.h>
#include <stdlib.h>
Go to the source code of this file.
Detailed Description
A common object base class with auto-pointer support.
A common object class is used which may be referenced counted and associated with a smart auto-pointer class. A lot of the things found here were inspired by working with Objective-C. Many of the classes are designed to offer automatic heap management through smart pointers and temporary objects controlled through the scope of the stack frame of method calls.
Definition in file object.h.
Function Documentation
Convenence function to access object copy.
- Parameters:
-
Definition at line 564 of file object.h.
template<class T >
bool is |
( |
T & |
object |
) |
[inline] |
Convenience function to validate object.
This solves issues where some compilers get confused between bool and pointer operators.
- Parameters:
-
- Returns:
- true if object valid.
Definition at line 574 of file object.h.
template<class T >
bool isnull |
( |
T & |
object |
) |
[inline] |
Convenience function to test pointer object.
This solves issues where some compilers get confused between bool and pointer operators.
- Parameters:
-
- Returns:
- true if object points to NULL.
Definition at line 584 of file object.h.
template<class T >
bool isnullp |
( |
T * |
object |
) |
[inline] |
Convenience function to test pointer-pointer object.
This solves issues where some compilers get confused between bool and pointer operators.
- Parameters:
-
- Returns:
- true if object points to NULL.
Definition at line 594 of file object.h.
template<class T >
T&() max |
( |
T & |
o1, |
|
|
T & |
o2 | |
|
) |
| | [inline] |
Convenience function to return max of two objects.
- Parameters:
-
| o1 | to check. |
| o2 | to check. |
- Returns:
- max object.
Definition at line 613 of file object.h.
template<class T >
T&() min |
( |
T & |
o1, |
|
|
T & |
o2 | |
|
) |
| | [inline] |
Convenience function to return min of two objects.
- Parameters:
-
| o1 | to check. |
| o2 | to check. |
- Returns:
- min object.
Definition at line 625 of file object.h.
void release |
( |
Object * |
object |
) |
[inline] |
Convenence function to access object release.
- Parameters:
-
Definition at line 557 of file object.h.
void retain |
( |
Object * |
object |
) |
[inline] |
Convenence function to access object retention.
- Parameters:
-
Definition at line 550 of file object.h.
template<class T >
void swap |
( |
T & |
o1, |
|
|
T & |
o2 | |
|
) |
| | [inline] |
Convenience function to swap objects.
- Parameters:
-
Definition at line 603 of file object.h.