- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# FUObjectRef< ObjectClass > Class Template Reference
[Utility Classes.]

An object reference On top of the tracked object pointer, when this reference is released: the tracked object is released. More...

`#include <FUObject.h>`

Inheritance diagram for FUObjectRef< ObjectClass >:

List of all members.

## Public Member Functions
| FUObjectRef (ObjectClass *_ptr=NULL)
| Copy constructor.
| ~FUObjectRef ()
| Destructor.
FUObjectRef< ObjectClass > & | operator= (ObjectClass *_ptr)
| Assigns this reference to own a new object.
FUObjectRef< ObjectClass > & | operator= (FUObjectRef< ObjectClass > &_ptr)
| Exchanges the reference from one object to another.
ObjectClass & | operator * ()
| Accesses the tracked object.
const ObjectClass & | operator * () const
| See above.
ObjectClass * | operator-> ()
| See above.
const ObjectClass * | operator-> () const
| See above.
| operator ObjectClass * ()
| See above.
| operator const ObjectClass * () const
| See above.
## Protected Member Functions
virtual void | OnOwnedObjectReleased (FUObject *object)
| Callback when an object tracked by this tracker is being released.

## Detailed Description

### template<class ObjectClass = FUObject>
class FUObjectRef< ObjectClass >

An object reference On top of the tracked object pointer, when this reference is released: the tracked object is released.

This template is very complex for a reference. You get reduced compilation times when compared to simple containment.

## Constructor & Destructor Documentation

template<class ObjectClass = FUObject>
FUObjectRef< ObjectClass >::FUObjectRef | ( | ObjectClass * | _ptr = `NULL` | ) | `[inline]`

  | Copy constructor. Parameters:
  | _ptr | The object to reference. This pointer can be NULL to indicate that no object should be referenced at this time.

template<class ObjectClass = FUObject>
FUObjectRef< ObjectClass >::~FUObjectRef | ( |  | ) | `[inline]`

| Destructor. The object referenced will be released.

## Member Function Documentation

template<class ObjectClass = FUObject>
virtual void FUObjectRef< ObjectClass >::OnOwnedObjectReleased | ( | FUObject * | object | ) | `[inline, protected, virtual]`

  | Callback when an object tracked by this tracker is being released. Parameters:
  | object | A contained object.
Implements FUObjectOwner.

template<class ObjectClass = FUObject>
ObjectClass& FUObjectRef< ObjectClass >::operator * | ( |  | ) | `[inline]`

| Accesses the tracked object. Returns: The tracked object.

template<class ObjectClass = FUObject>
FUObjectRef<ObjectClass>& FUObjectRef< ObjectClass >::operator= | ( | FUObjectRef< ObjectClass > & | _ptr | ) | `[inline]`

  | Exchanges the reference from one object to another. If this reference already points to an object, it will be released. If the other reference points to an object, that object will now be owned by this reference and the other reference will point to NULL. Parameters:
  | _ptr | The other reference.
Returns: This reference.

template<class ObjectClass = FUObject>
FUObjectRef<ObjectClass>& FUObjectRef< ObjectClass >::operator= | ( | ObjectClass * | _ptr | ) | `[inline]`

  | Assigns this reference to own a new object. Parameters:
  | _ptr | The new object to own.
Returns: This reference.

The documentation for this class was generated from the following file:

- FUtils/FUObject.h