CVM Class Library  8.1
This C++ class library encapsulates concepts of vector and different matrices including square, band, symmetric and hermitian ones in Euclidean space of real and complex numbers.
 All Classes Files Functions Variables Typedefs Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
type_proxy< T, TR > Class Template Reference

Read-write access for a particular value. More...

#include <cvm.h>

Public Member Functions

 type_proxy (T &ref, bool read_only)
 Proxy constructor.
 type_proxy (const T &ref, bool read_only=true)
 Proxy constructor.
 type_proxy (const type_proxy &p)
 Proxy copy constructor.
 operator T () const
 Type cast to value.
val () const
 Value.
T & get () throw (cvmexception)
 Reference to value.
const T & get () const
 Const reference to value.
type_proxyoperator= (const type_proxy &p)
 Assignment operator.
type_proxyoperator= (const T &v) throw (cvmexception)
 Assignment operator.
T * operator& () throw (cvmexception)
 Address operator.
const T * operator& () const
 Address operator.
template<typename U >
T & operator+= (const U &u) throw (cvmexception)
 Increment by.
template<typename U >
T & operator-= (const U &u) throw (cvmexception)
 Decrement by.
template<typename U >
T & operator*= (const U &u) throw (cvmexception)
 Multiply by.
template<typename U >
T & operator/= (const U &u) throw (cvmexception)
 Divide by.
template<typename U >
operator+ (const U &u) const
 Addition operator.
template<typename U >
operator- (const U &u) const
 Subtraction operator.
template<typename U >
operator* (const U &u) const
 Multiplication operator.
template<typename U >
operator/ (const U &u) const
 Division operator.
operator+ (const type_proxy< T, TR > &u) const
 Addition operator.
operator- (const type_proxy< T, TR > &u) const
 Subtraction operator.
operator* (const type_proxy< T, TR > &u) const
 Multiplication operator.
operator/ (const type_proxy< T, TR > &u) const
 Division operator.
operator- () const
 Unary minus operator.
TR real () const
 Real part.
TR imag () const
 Imaginary part.

Protected Attributes

T & mT
 reference to value
bool mbReadOnly
 read-only flag

Detailed Description

template<typename T, typename TR>
class type_proxy< T, TR >

Read-write access for a particular value.

This class is used to resctict access to elements of specific matrices like symmetric, hermitian and band ones.

Definition at line 1350 of file cvm.h.

Constructor & Destructor Documentation

template<typename T, typename TR>
type_proxy< T, TR >::type_proxy ( T &  ref,
bool  read_only 
)
inline

Proxy constructor.

Creates instance of type proxy by non-const reference to value.

Parameters
[in]refReference to value.
[in]read_onlyTrue for read-only proxy.

Definition at line 1364 of file cvm.h.

template<typename T, typename TR>
type_proxy< T, TR >::type_proxy ( const T &  ref,
bool  read_only = true 
)
inline

Proxy constructor.

Creates instance of type proxy by const reference to value.

Parameters
[in]refReference to value.
[in]read_onlyTrue by default.

Definition at line 1377 of file cvm.h.

template<typename T, typename TR>
type_proxy< T, TR >::type_proxy ( const type_proxy< T, TR > &  p)
inline

Proxy copy constructor.

Creates instance of type proxy by another one.

Parameters
[in]pConst reference to another proxy.

Definition at line 1389 of file cvm.h.

Member Function Documentation

template<typename T, typename TR>
type_proxy< T, TR >::operator T ( ) const
inline

Type cast to value.

Returns value.

Returns
Value

Definition at line 1401 of file cvm.h.

template<typename T, typename TR>
T type_proxy< T, TR >::val ( ) const
inline

Value.

Returns value.

Returns
Value

Definition at line 1425 of file cvm.h.

Here is the caller graph for this function:

template<typename T, typename TR>
T& type_proxy< T, TR >::get ( ) throw (cvmexception)
inline

Reference to value.

Returns reference to value. Throws cvmexception if proxy is read-only.

Returns
Reference to value

Definition at line 1435 of file cvm.h.

template<typename T, typename TR>
const T& type_proxy< T, TR >::get ( ) const
inline

Const reference to value.

Returns const reference to value.

Returns
Reference to value

Definition at line 1446 of file cvm.h.

template<typename T, typename TR>
type_proxy& type_proxy< T, TR >::operator= ( const type_proxy< T, TR > &  p)
inline

Assignment operator.

Returns
type_proxy&

Assigns type_proxy. Returns reference to *this.

Parameters
[in]pConst reference to another proxy.

Definition at line 1457 of file cvm.h.

template<typename T, typename TR>
type_proxy& type_proxy< T, TR >::operator= ( const T &  v) throw (cvmexception)
inline

Assignment operator.

Returns
type_proxy&

Assigns value. Returns reference to *this. Throws cvmexception if proxy is read-only.

Parameters
[in]vConst reference to another value.

Definition at line 1471 of file cvm.h.

template<typename T, typename TR>
T* type_proxy< T, TR >::operator& ( ) throw (cvmexception)
inline

Address operator.

Returns
T*

Returns pointer to value. Throws cvmexception if proxy is read-only.

Definition at line 1484 of file cvm.h.

template<typename T, typename TR>
const T* type_proxy< T, TR >::operator& ( ) const
inline

Address operator.

Returns
const T*

Returns const pointer to value.

Definition at line 1496 of file cvm.h.

template<typename T, typename TR>
template<typename U >
T& type_proxy< T, TR >::operator+= ( const U &  u) throw (cvmexception)
inline

Increment by.

Returns
T&

Returns reference to value changed. Throws cvmexception if proxy is read-only.

Parameters
[in]uConst reference to value to be incremented by.

Definition at line 1508 of file cvm.h.

template<typename T, typename TR>
template<typename U >
T& type_proxy< T, TR >::operator-= ( const U &  u) throw (cvmexception)
inline

Decrement by.

Returns
T&

Returns reference to value changed. Throws cvmexception if proxy is read-only.

Parameters
[in]uConst reference to value to be decremented by.

Definition at line 1523 of file cvm.h.

template<typename T, typename TR>
template<typename U >
T& type_proxy< T, TR >::operator*= ( const U &  u) throw (cvmexception)
inline

Multiply by.

Returns
T&

Returns reference to value changed. Throws cvmexception if proxy is read-only.

Parameters
[in]uConst reference to value to be multiplied by.

Definition at line 1538 of file cvm.h.

template<typename T, typename TR>
template<typename U >
T& type_proxy< T, TR >::operator/= ( const U &  u) throw (cvmexception)
inline

Divide by.

Returns
T&

Returns reference to value changed. Throws cvmexception if proxy is read-only.

Parameters
[in]uConst reference to value to be divided by.

Definition at line 1553 of file cvm.h.

template<typename T, typename TR>
template<typename U >
T type_proxy< T, TR >::operator+ ( const U &  u) const
inline

Addition operator.

Returns
T

Returns result of addition as value.

Parameters
[in]uConst reference to value to be added.

Definition at line 1568 of file cvm.h.

template<typename T, typename TR>
template<typename U >
T type_proxy< T, TR >::operator- ( const U &  u) const
inline

Subtraction operator.

Returns
T

Returns result of subtraction as value.

Parameters
[in]uConst reference to value to be subtracted.

Definition at line 1580 of file cvm.h.

template<typename T, typename TR>
template<typename U >
T type_proxy< T, TR >::operator* ( const U &  u) const
inline

Multiplication operator.

Returns
T

Returns result of mutliplication as value.

Parameters
[in]uConst reference to value to be multiplied.

Definition at line 1592 of file cvm.h.

template<typename T, typename TR>
template<typename U >
T type_proxy< T, TR >::operator/ ( const U &  u) const
inline

Division operator.

Returns
T

Returns result of division as value.

Parameters
[in]uConst reference to value to be divided.

Definition at line 1604 of file cvm.h.

template<typename T, typename TR>
T type_proxy< T, TR >::operator+ ( const type_proxy< T, TR > &  u) const
inline

Addition operator.

Returns
T

Returns result of addition as value.

Parameters
[in]uConst reference to proxy to be added.

Definition at line 1615 of file cvm.h.

template<typename T, typename TR>
T type_proxy< T, TR >::operator- ( const type_proxy< T, TR > &  u) const
inline

Subtraction operator.

Returns
T

Returns result of subtraction as value.

Parameters
[in]uConst reference to proxy to be subtracted.

Definition at line 1626 of file cvm.h.

template<typename T, typename TR>
T type_proxy< T, TR >::operator* ( const type_proxy< T, TR > &  u) const
inline

Multiplication operator.

Returns
T

Returns result of mutliplication as value.

Parameters
[in]uConst reference to proxy to be multiplied.

Definition at line 1637 of file cvm.h.

template<typename T, typename TR>
T type_proxy< T, TR >::operator/ ( const type_proxy< T, TR > &  u) const
inline

Division operator.

Returns
T

Returns result of division as value.

Parameters
[in]uConst reference to proxy to be divided.

Definition at line 1648 of file cvm.h.

template<typename T, typename TR>
T type_proxy< T, TR >::operator- ( ) const
inline

Unary minus operator.

Returns
T

Returns result of sign change as value.

Definition at line 1658 of file cvm.h.

template<typename T, typename TR>
TR type_proxy< T, TR >::real ( ) const
inline

Real part.

Returns
TR

Returns real part of complex value as value. Specialized for std::complex<treal> only. Link error would be received otherwise.

Definition at line 1669 of file cvm.h.

template<typename T, typename TR>
TR type_proxy< T, TR >::imag ( ) const
inline

Imaginary part.

Returns
TR

Returns imaginary part of complex value as value. Specialized for std::complex<treal> only. Link error would be received otherwise.

Definition at line 1680 of file cvm.h.

Member Data Documentation

template<typename T, typename TR>
T& type_proxy< T, TR >::mT
protected

reference to value

Definition at line 1353 of file cvm.h.

template<typename T, typename TR>
bool type_proxy< T, TR >::mbReadOnly
protected

read-only flag

Definition at line 1354 of file cvm.h.


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