libHSPlasma
Classes | Public Member Functions | Static Public Member Functions | List of all members
plKey< kobj_type > Class Template Reference

Describes and points to an hsKeyedObject. More...

#include <plKey.hpp>

Classes

struct  _ref

Public Member Functions

 plKey ()
 plKey (const plKey &init)
 plKey (plKeyData *init)
virtual ~plKey ()
plKeyDataoperator* () const
plKeyDataoperator-> () const
 operator plKeyData * () const
virtual plKeyoperator= (const plKey &other)
virtual plKeyoperator= (plKeyData *other)
bool operator== (const plKey &other) const
bool operator== (const plKeyData *other) const
bool operator!= (const plKey &other) const
bool operator!= (const plKeyData *other) const
bool operator< (const plKey &other) const
bool Exists () const
bool isLoaded () const
 plKey ()
 ~plKey ()

Static Public Member Functions

static plKey< kobj_type > Create ()

Detailed Description

template<class kobj_type = hsKeyedObject>
class plKey< kobj_type >

Describes and points to an hsKeyedObject.

This is actually just a ref-counted wrapper for plKeyData. However, you should never use plKeyData directly, but rather use plKey to hold references to plKeyData objects. The overloaded operators in plKey allow you to use it as though it were the plKeyData object, so you should generally just think of plKeyData's members as being plKey's members, with the addition of Exists() and isLoaded(), which are direct members of the plKey container.

Constructor & Destructor Documentation

template<class kobj_type = hsKeyedObject>
plKey< kobj_type >::plKey ( )

Constructs a NULL plKey. This will return false for Exists()

template<class kobj_type = hsKeyedObject>
plKey< kobj_type >::plKey ( const plKey< kobj_type > &  init)

Copy constructor

template<class kobj_type = hsKeyedObject>
plKey< kobj_type >::plKey ( plKeyData init)

Copy constructor for plKeyData pointers. Usually you won't ever need to use this directly; it's mostly here for internal use by the plResManager.

template<class kobj_type = hsKeyedObject>
virtual plKey< kobj_type >::~plKey ( )
virtual

Removes a reference to the key. When there are no more references to the key data, the plKeyData pointer will be deleted. The object it references, however, will NOT be automatically deleted. Unless the object is stored in the plResManager, you will need to delete the object yourself. However, if the object is registered with the plResManager, you should not delete the object.

template<class kobj_type = hsKeyedObject>
plKey< kobj_type >::plKey ( )
template<class kobj_type = hsKeyedObject>
plKey< kobj_type >::~plKey ( )

Member Function Documentation

template<class kobj_type = hsKeyedObject>
static plKey<kobj_type> plKey< kobj_type >::Create ( )
static
template<class kobj_type = hsKeyedObject>
bool plKey< kobj_type >::Exists ( ) const

Tests to see if the key refers to an object (not NULL key). This will return false for empty keys, so it should be checked any place where an empty key can be specified.

template<class kobj_type = hsKeyedObject>
bool plKey< kobj_type >::isLoaded ( ) const

Returns whether the object referenced by the key is currently loaded by the plResManager.

NOTE: For empty keys (Exists() == false), this will always return true!

template<class kobj_type = hsKeyedObject>
plKey< kobj_type >::operator plKeyData * ( ) const

Allows for typecasts to plKeyData* pointers.

template<class kobj_type = hsKeyedObject>
bool plKey< kobj_type >::operator!= ( const plKey< kobj_type > &  other) const

Returns true if the keys point to different plKeyData structures

template<class kobj_type = hsKeyedObject>
bool plKey< kobj_type >::operator!= ( const plKeyData other) const

Returns true if this key's plKeyData is NOT 'other'

template<class kobj_type = hsKeyedObject>
plKeyData& plKey< kobj_type >::operator* ( ) const

Allows for *(plKey) usage as a pointer.

template<class kobj_type = hsKeyedObject>
plKeyData* plKey< kobj_type >::operator-> ( ) const

Allows for (plKey)->member usage as a pointer.

template<class kobj_type = hsKeyedObject>
bool plKey< kobj_type >::operator< ( const plKey< kobj_type > &  other) const

Provides sorting functionality for STL containers

template<class kobj_type = hsKeyedObject>
virtual plKey& plKey< kobj_type >::operator= ( const plKey< kobj_type > &  other)
virtual

Copies and refs the key data in other

template<class kobj_type = hsKeyedObject>
virtual plKey& plKey< kobj_type >::operator= ( plKeyData other)
virtual

Refs the key data and stores it in this key

template<class kobj_type = hsKeyedObject>
bool plKey< kobj_type >::operator== ( const plKey< kobj_type > &  other) const

Returns true if the keys point to the same plKeyData

template<class kobj_type = hsKeyedObject>
bool plKey< kobj_type >::operator== ( const plKeyData other) const

Returns true if this key's plKeyData is 'other'


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