Crazy Eddie's GUI System  0.8.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGUI::Element::CachedRectf Class Reference

A tiny wrapper to hide some of the dirty work of rect caching. More...

Public Types

typedef Rectf(Element::* DataGenerator )(bool) const
 Function to generate fresh data that might later be cached. More...
 

Public Member Functions

 CachedRectf (Element const *element, DataGenerator generator)
 
const Rectfget () const
 Retrieves cached Rectf or generated a fresh one and caches it.
 
Rectf getFresh (bool skipAllPixelAlignment=false) const
 Skips all caching and calls the generator. More...
 
void invalidateCache () const
 Invalidates the cached Rectf causing it to be regenerated. More...
 
bool isCacheValid () const
 
void regenerateCache () const
 

Detailed Description

A tiny wrapper to hide some of the dirty work of rect caching.

This is used internally by CEGUI::Element and other classes, it is passed to the user in several methods. In those circumstances you most likely want the result of either the "get()" or "getFresh(..)" methods.

Member Typedef Documentation

typedef Rectf(Element::* CEGUI::Element::CachedRectf::DataGenerator)(bool) const

Function to generate fresh data that might later be cached.

If the bool is true all PixelAlignment settings will be overridden and no pixel alignment will take place.

Member Function Documentation

Rectf CEGUI::Element::CachedRectf::getFresh ( bool  skipAllPixelAlignment = false) const
inline

Skips all caching and calls the generator.

This method will cache the result if cache is invalid and alignment is not being skipped.

void CEGUI::Element::CachedRectf::invalidateCache ( ) const
inline

Invalidates the cached Rectf causing it to be regenerated.

The regeneration will not happen immediately, it will happen when user requests the data.