#include <mtsGenericObjectProxy.h>
Inheritance diagram for mtsGenericObjectProxyBase< _elementType >:


ProxyRef is used internally by the library to enable arbitrary data types T (not just ones derived from mtsGenericObject) to be added to the State Table. In this case, the StateVector (State Table history) will be an array of Proxy<T> and the StateVectorElements (pointers to working copy) will be of type ProxyRef<T>.
To create an mtsGenericObject from an existing type, one would have to specialize mtsGenericObjectProxy as follows in the header file (it is not necessary to worry about the ProxyBase or ProxyRef -- these are handled automatically):
class UserType { .... }; typedef mtsGenericObjectProxy<UserType> UserTypeProxy; CMN_DECLARE_SERVICES_INSTANTIATION(UserTypeProxy);
It is also required to instantiate the associated services in the compiled code (.cpp) file with:
CMN_IMPLEMENT_SERVICES_TEMPLATED(UserTypeProxy);
As it is, this class cannot be used in libraries other than cisstCommon if a DLL is to be created. The issue is that the class will be declared as imported in the header file because it is part of cisstCommon. (PK: OBSOLETE COMMENT?)
There are some "dirty tricks" in this class now, so that we can have a Proxy class and a ProxyRef class, and enable assignments between them. This provides a bit of polymorphic behavior for the command objects, because the Execute method can be parameterized as a ProxyBase object, and thus can be called with either a Proxy or ProxyRef object. This is used for "read from state" commands. One particularly dirty trick is that the class services are actually defined in the Proxy class, but are "stolen" by the ProxyRef class, via the ProxyBase class.
| _elementType | The actual type for which we want to provide a proxy object. |
Definition at line 199 of file mtsGenericObjectProxy.h.
| mtsGenericObjectProxyBase< _elementType >::mtsGenericObjectProxyBase | ( | void | ) | [inline] |
Default constructor. The data member is initialized using its default constructor.
Definition at line 223 of file mtsGenericObjectProxy.h.
| mtsGenericObjectProxyBase< _elementType >::mtsGenericObjectProxyBase | ( | const ThisType & | other | ) | [inline] |
Copy constructor.
Definition at line 227 of file mtsGenericObjectProxy.h.
| virtual const cmnClassServicesBase* mtsGenericObjectProxyBase< _elementType >::Services | ( | void | ) | const [inline, virtual] |
Pure virtual method to access the class services. The derived classes should always declare and implement this method using the macros CMN_DECLARE_SERVICES, CMN_DECLARE_SERVICES_INSTANTIATION and CMN_IMPLEMENT_SERVICES. In NO WAY, a user should redefine/overload this method otherwise.
Implements cmnGenericObject.
Definition at line 216 of file mtsGenericObjectProxy.h.
References mtsGenericObjectProxyBase< _elementType >::ClassServices().
| virtual value_type& mtsGenericObjectProxyBase< _elementType >::GetData | ( | void | ) | [pure virtual] |
Return pointer to data
Referenced by mtsGenericObjectProxyBase< _elementType >::Assign(), and mtsGenericTypesImpl< T, >::CastArg().
| ThisType& mtsGenericObjectProxyBase< _elementType >::operator= | ( | const ThisType & | data | ) | [inline] |
Conversion assignment.
Definition at line 238 of file mtsGenericObjectProxy.h.
References mtsGenericObjectProxyBase< _elementType >::Assign().