ValueWrapperInterface< T > Class Template Reference#include <componentInterface.h>
Inheritance diagram for ValueWrapperInterface< T >: ![]() Detailed Description
This class is designed to wrap an existing class or type easily to allow a SimComponent to expose a property with custom processing code in an efficient and safe way.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Public Member Functions | |
| virtual bool | isValid () const |
| This will return true if the interface is valid. | |
| const T & | operator * () |
| Dereferencing a value interface will allow get to do any processing and return the reference to that. | |
| const T & | operator= (const T &lval) |
| Assignment operator will invoke set. | |
| ValueWrapperInterface () | |
| Default Constructor. | |
| ValueWrapperInterface (const T ©) | |
| Copy constructor. | |
| virtual | ~ValueWrapperInterface () |
| Destructor, destroy memory. | |
| virtual const T & | get () |
| Get the value associated with this interface. | |
| virtual const T & | set (const T &t) |
| Set the value associated with this interface. | |
Protected Attributes | |
| T * | mValuePtr |
Private Types | |
| typedef ComponentInterface | Parent |
typedef ComponentInterface ValueWrapperInterface< T >::Parent [private] |
| ValueWrapperInterface< T >::ValueWrapperInterface | ( | ) | [inline] |
Default Constructor.
| ValueWrapperInterface< T >::ValueWrapperInterface | ( | const T & | copy | ) | [inline] |
Copy constructor.
| virtual ValueWrapperInterface< T >::~ValueWrapperInterface | ( | ) | [inline, virtual] |
Destructor, destroy memory.
| virtual bool ValueWrapperInterface< T >::isValid | ( | ) | const [inline, virtual] |
| const T& ValueWrapperInterface< T >::operator * | ( | ) | [inline] |
Dereferencing a value interface will allow get to do any processing and return the reference to that.
| const T& ValueWrapperInterface< T >::operator= | ( | const T & | lval | ) | [inline] |
Assignment operator will invoke set.
| virtual const T& ValueWrapperInterface< T >::get | ( | ) | [inline, virtual] |
Get the value associated with this interface.
Processing code can be done here for specialized implementations.
| virtual const T& ValueWrapperInterface< T >::set | ( | const T & | t | ) | [inline, virtual] |
Set the value associated with this interface.
Validation/processing code can be done here. The copy-constructor uses the set method to do it's copy so be mindful of that, or specialize the copy-constructor.
T* ValueWrapperInterface< T >::mValuePtr [protected] |