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

stores one object of any class derived from Base. Requesting a certain derived class via get() either returns the stored object if it has the correct type or otherwise replaces it with an object of the requested type. More...

#include <aisequence.hpp>

Collaboration diagram for MWMechanics::DerivedClassStorage< Base >:

Public Member Functions

template<class Derived >
Derived & get ()
 returns reference to stored object or deletes it and creates a fitting More...
 
template<class Derived >
void store (const Derived &payload)
 
template<class Derived >
void moveIn (Derived *p)
 takes ownership of the passed object More...
 
bool empty () const
 
const std::type_info & getType () const
 
 DerivedClassStorage ()
 
 ~DerivedClassStorage ()
 

Private Member Functions

 DerivedClassStorage (const DerivedClassStorage &other)
 
DerivedClassStorageoperator= (const DerivedClassStorage &)
 

Private Attributes

Base * mStorage
 

Detailed Description

template<class Base>
class MWMechanics::DerivedClassStorage< Base >

stores one object of any class derived from Base. Requesting a certain derived class via get() either returns the stored object if it has the correct type or otherwise replaces it with an object of the requested type.

Constructor & Destructor Documentation

template<class Base>
MWMechanics::DerivedClassStorage< Base >::DerivedClassStorage ( const DerivedClassStorage< Base > &  other)
private
template<class Base>
MWMechanics::DerivedClassStorage< Base >::DerivedClassStorage ( )
inline
template<class Base>
MWMechanics::DerivedClassStorage< Base >::~DerivedClassStorage ( )
inline

Member Function Documentation

template<class Base>
bool MWMechanics::DerivedClassStorage< Base >::empty ( ) const
inline
template<class Base>
template<class Derived >
Derived& MWMechanics::DerivedClassStorage< Base >::get ( )
inline

returns reference to stored object or deletes it and creates a fitting

Here is the caller graph for this function:

template<class Base>
const std::type_info& MWMechanics::DerivedClassStorage< Base >::getType ( ) const
inline
template<class Base>
template<class Derived >
void MWMechanics::DerivedClassStorage< Base >::moveIn ( Derived *  p)
inline

takes ownership of the passed object

Here is the caller graph for this function:

template<class Base>
DerivedClassStorage& MWMechanics::DerivedClassStorage< Base >::operator= ( const DerivedClassStorage< Base > &  )
private
template<class Base>
template<class Derived >
void MWMechanics::DerivedClassStorage< Base >::store ( const Derived &  payload)
inline

Member Data Documentation

template<class Base>
Base* MWMechanics::DerivedClassStorage< Base >::mStorage
private

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