OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
Nif::RecordPtrT< X > Class Template Reference

#include <recordptr.hpp>

Collaboration diagram for Nif::RecordPtrT< X >:

Public Member Functions

 RecordPtrT ()
 
 RecordPtrT (X *ptr)
 
void read (NIFStream *nif)
 Read the index from the nif. More...
 
void post (NIFFile *nif)
 Resolve index to pointer. More...
 
const X * getPtr () const
 Look up the actual object from the index. More...
 
X * getPtr ()
 
const X & get () const
 
X & get ()
 
const X * operator-> () const
 Syntactic sugar. More...
 
X * operator-> ()
 
bool empty () const
 Pointers are allowed to be empty. More...
 

Private Attributes

union {
   intptr_t   index
 
   X *   ptr
 
}; 
 

Detailed Description

template<class X>
class Nif::RecordPtrT< X >

A reference to another record. It is read as an index from the NIF, and later looked up in the index table to get an actual pointer.

Constructor & Destructor Documentation

template<class X>
Nif::RecordPtrT< X >::RecordPtrT ( )
inline
template<class X>
Nif::RecordPtrT< X >::RecordPtrT ( X *  ptr)
inline

Member Function Documentation

template<class X>
bool Nif::RecordPtrT< X >::empty ( ) const
inline

Pointers are allowed to be empty.

Here is the caller graph for this function:

template<class X>
const X& Nif::RecordPtrT< X >::get ( ) const
inline

Here is the caller graph for this function:

template<class X>
X& Nif::RecordPtrT< X >::get ( )
inline
template<class X>
const X* Nif::RecordPtrT< X >::getPtr ( ) const
inline

Look up the actual object from the index.

Here is the caller graph for this function:

template<class X>
X* Nif::RecordPtrT< X >::getPtr ( )
inline
template<class X>
const X* Nif::RecordPtrT< X >::operator-> ( ) const
inline

Syntactic sugar.

template<class X>
X* Nif::RecordPtrT< X >::operator-> ( )
inline
template<class X>
void Nif::RecordPtrT< X >::post ( NIFFile nif)
inline

Resolve index to pointer.

Here is the caller graph for this function:

template<class X>
void Nif::RecordPtrT< X >::read ( NIFStream nif)
inline

Read the index from the nif.

Here is the caller graph for this function:

Member Data Documentation

union { ... }
template<class X>
intptr_t Nif::RecordPtrT< X >::index
template<class X>
X* Nif::RecordPtrT< X >::ptr

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