Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ResourceAccessor< R > Class Template Reference

A variation of MarkScope which allows you to forward access to the resource via the '->' operator, smart-pointer style. More...

#include <ResourceAccessor.h>

Inheritance diagram for ResourceAccessor< R >:

Detailed Description

template<class R>
class ResourceAccessor< R >

A variation of MarkScope which allows you to forward access to the resource via the '->' operator, smart-pointer style.

Definition at line 9 of file ResourceAccessor.h.

List of all members.

Public Member Functions

 ResourceAccessor (R &r)
 constructor, for marking resources which require no data
 ResourceAccessor (R &r, Resource::Data &d)
 constructor, accepts data parameter to pass to Resource::useResource()
 ResourceAccessor (const ResourceAccessor &ra)
 copy constructor, marks resource used with default (empty) data
 ResourceAccessor (const ResourceAccessor &ra, Resource::Data &d)
 copy constructor, accepts additional data parameter to pass to Resource::useResource()
R & accessResource () const __attribute__((warn_unused_result))
 returns rsrc cast as R
R * operator-> ()
 smart pointer to the underlying Resource
const R * operator-> () const
 smart pointer to the underlying Resource
R & operator* ()
 smart pointer to the underlying Resource
const R & operator* () const
 smart pointer to the underlying Resource
R & operator[] (int i)
 smart pointer to the underlying Resource
const R & operator[] (int i) const
 smart pointer to the underlying Resource

Constructor & Destructor Documentation

template<class R >
ResourceAccessor< R >::ResourceAccessor ( R &  r  ) 

constructor, for marking resources which require no data

Definition at line 9 of file ResourceAccessor.h.

template<class R >
ResourceAccessor< R >::ResourceAccessor ( R &  r,
Resource::Data d 
)

constructor, accepts data parameter to pass to Resource::useResource()

Definition at line 11 of file ResourceAccessor.h.

template<class R >
ResourceAccessor< R >::ResourceAccessor ( const ResourceAccessor< R > &  ra  ) 

copy constructor, marks resource used with default (empty) data

Definition at line 13 of file ResourceAccessor.h.

template<class R >
ResourceAccessor< R >::ResourceAccessor ( const ResourceAccessor< R > &  ra,
Resource::Data d 
)

copy constructor, accepts additional data parameter to pass to Resource::useResource()

Definition at line 15 of file ResourceAccessor.h.


Member Function Documentation

template<class R >
R& ResourceAccessor< R >::accessResource (  )  const

returns rsrc cast as R

Definition at line 19 of file ResourceAccessor.h.

Referenced by ResourceAccessor< R >::operator*(), and ResourceAccessor< R >::operator[]().

template<class R >
const R& ResourceAccessor< R >::operator* (  )  const

smart pointer to the underlying Resource

Definition at line 32 of file ResourceAccessor.h.

template<class R >
R& ResourceAccessor< R >::operator* (  ) 

smart pointer to the underlying Resource

Definition at line 31 of file ResourceAccessor.h.

template<class R >
const R* ResourceAccessor< R >::operator-> (  )  const

smart pointer to the underlying Resource

Definition at line 30 of file ResourceAccessor.h.

template<class R >
R* ResourceAccessor< R >::operator-> (  ) 

smart pointer to the underlying Resource

Definition at line 29 of file ResourceAccessor.h.

template<class R >
const R& ResourceAccessor< R >::operator[] ( int  i  )  const

smart pointer to the underlying Resource

Definition at line 34 of file ResourceAccessor.h.

template<class R >
R& ResourceAccessor< R >::operator[] ( int  i  ) 

smart pointer to the underlying Resource

Definition at line 33 of file ResourceAccessor.h.


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

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:15 2016 by Doxygen 1.6.3