Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

strmod::strmod::LocalCopy< T > Class Template Reference

Makes a local copy of a variable the compiler doesn't have enough information to do CSE on. More...

#include <StrMod/LocalCopy.h>

List of all members.

Public Methods

 LocalCopy (T &classvar)
 Constructs a local copy of a member or global variable.

 ~LocalCopy ()
 Stores the local copy back to original member or global variable referenced by classvar in the constructor.

 operator T & ()
 Trying to make this stand in for the variable as much as possible.

 operator const T & () const
 Trying to make this stand in for the variable as much as possible.

const T & operator= (const T &b)
 Trying to make this stand in for the variable as much as possible.


Public Attributes

local
 Yes, this is supposed to be public.


Detailed Description

template<class T>
class strmod::strmod::LocalCopy< T >

Makes a local copy of a variable the compiler doesn't have enough information to do CSE on.

This will make a local copy of a member variable and store the value of that copy back into the member variable when the local copy is destroyed. This is useful for a member variable you know will only be altered by the function across an entire call, despite other functions being called. When other functions are called, the compiler's CSE throws out member variables, as those variables may concievably be altered by the function call.

Definition at line 46 of file LocalCopy.h.


Constructor & Destructor Documentation

template<class T>
strmod::strmod::LocalCopy< T >::LocalCopy T &    classvar [inline]
 

Constructs a local copy of a member or global variable.

Parameters:
classvar A reference to the variable to make a copy of.

Definition at line 51 of file LocalCopy.h.


The documentation for this class was generated from the following file:
Generated on Wed Jan 29 00:32:54 2003 for libNet by doxygen1.3-rc1