SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWRORef< TypeT > Class Template Reference

Handles the case of potentially read-only access to data. More...

#include <rw/lapack/mat.h>

Public Member Functions

 RWRORef (TypeT &x, bool ro=false)
 
 operator TypeT ()
 
RWRORef< TypeT > & operator= (TypeT x)
 

Detailed Description

template<class TypeT>
class RWRORef< TypeT >

RWRORef handles the case of potentially read-only access to data. It is used by the RWBandMat, RWSymBandMat, RWUpperTriMat, RWLowerTriMat, and RWTriDiagMat classes, which all contain elements that are explicitly defined as 0 and cannot be changed. If an element defined to be 0 is accessed, the RWRORef is constructed with a reference to a static variable initialized to 0, and information that the reference is read-only.

Constructor & Destructor Documentation

template<class TypeT >
RWRORef< TypeT >::RWRORef ( TypeT &  x,
bool  ro = false 
)
inline

Builds a reference to x. The parameter ro indicates if the reference should be considered read-only.

Member Function Documentation

template<class TypeT >
RWRORef< TypeT >::operator TypeT ( )
inline

This type conversion operator is invoked by the compiler as necessary to return the value referenced by the class for use as a right-side value. It may have to modify the value as necessary (for example, to take its conjugate).

template<class TypeT >
RWRORef<TypeT>& RWRORef< TypeT >::operator= ( TypeT  x)

This function changes the value referenced by the class to the value x, after modifying x if necessary (for example, by taking its conjugate). If the reference is supposed to be read-only, a runtime error occurs.

Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.