#include <CH.h>
Inheritance diagram for CH< CandType >:

Public Types | |
| DereferenceNil | |
| enum | ErrorType { DereferenceNil } |
Public Member Functions | |
| CH () | |
| CH (CandBase *cb) | |
| CH (const CandHandle &ch) | |
| template<class T> | |
| CH (const CH< T > &ch) | |
| template<class T> | |
| operator CH () | |
| const CandType * | operator-> () const |
| const CandType & | operator * () const |
| CH< CandType > & | operator= (const CandHandle &rhs) |
| template<class T> | |
| CH< CandType > & | operator= (const CH< T > &rhs) |
| virtual CH< CandType > * | DupHandle () const |
| bool | IsValid () const |
| const CandType & | RCmd () const |
| CandType & | WCmd () |
Definition at line 18 of file CH.h.
| enum CH::ErrorType |
Definition at line 70 of file CH.h.
00070 : 00071 CandHandle(dynamic_cast<CandType*>(cb)) 00072 { 00073 }
| CH< CandType >::CH | ( | const CandHandle & | ch | ) |
Reimplemented from CandHandle.
Definition at line 110 of file CH.h.
00111 { 00112 return (new CH<CandType>(*this)); 00113 }
| bool CH< CandType >::IsValid | ( | ) | const |
Definition at line 117 of file CH.h.
References CandHandle::GetCandBase().
00118 { 00119 return dynamic_cast<const CandType*>(GetCandBase()); 00120 }
| const CandType & CH< CandType >::operator * | ( | ) | const |
Definition at line 132 of file CH.h.
References CandHandle::GetCandBase().
00133 { 00134 const CandType* cb = dynamic_cast<const CandType*>(GetCandBase()); 00135 return *cb; 00136 }
Definition at line 177 of file CH.h.
References CandHandle::GetCandBase().
00178 { 00179 return CH<T>(GetCandBase()); 00180 }
| const CandType * CH< CandType >::operator-> | ( | ) | const |
Definition at line 124 of file CH.h.
References CandHandle::GetCandBase().
00125 { 00126 const CandType* cb = dynamic_cast<const CandType*>(GetCandBase()); 00127 return cb; 00128 }
| CH< CandType > & CH< CandType >::operator= | ( | const CH< T > & | rhs | ) |
Definition at line 185 of file CH.h.
References CandHandle::GetCandBase().
00186 { 00187 CandHandle *chlhs = dynamic_cast<CandHandle*>(this); 00188 const CandHandle *chrhs = dynamic_cast<const CandHandle*>(&rhs); 00189 const CandType *refCrhs = 00190 dynamic_cast<const CandType*>(chrhs->GetCandBase()); 00191 00192 if (refCrhs) { 00193 if (refCrhs == chlhs->GetCandBase()) { 00194 return *this; 00195 } 00196 else { 00197 CandHandle chnew(const_cast<CandType*>(refCrhs)); 00198 *chlhs = chnew; // Invoke CandHandle::operator= 00199 return *this; 00200 } 00201 } 00202 else { 00203 CandHandle chnew((CandBase*)0); 00204 *chlhs = chnew; // Invoke CandHandle::operator= 00205 return *this; 00206 } 00207 }
| CH< CandType > & CH< CandType >::operator= | ( | const CandHandle & | rhs | ) |
Reimplemented from CandHandle.
Definition at line 84 of file CH.h.
References CandHandle::GetCandBase().
00085 { 00086 CandHandle *chlhs = dynamic_cast<CandHandle*>(this); 00087 const CandHandle *chrhs = dynamic_cast<const CandHandle*>(&rhs); 00088 const CandType *refCrhs = 00089 dynamic_cast<const CandType*>(chrhs->GetCandBase()); 00090 00091 if (refCrhs) { 00092 if (refCrhs == chlhs->GetCandBase()) { 00093 return *this; 00094 } 00095 else { 00096 CandHandle chnew(const_cast<CandType*>(refCrhs)); 00097 *chlhs = chnew; // Invoke CandHandle::operator= 00098 return *this; 00099 } 00100 } 00101 else { 00102 CandHandle chnew((CandBase*)0); 00103 *chlhs = chnew; // Invoke CandHandle::operator= 00104 return *this; 00105 } 00106 }
| const CandType & CH< CandType >::RCmd | ( | ) | const |
Definition at line 140 of file CH.h.
References CH< CandType >::DereferenceNil, and CandHandle::GetCandBase().
00141 { 00142 const CandType *cb = dynamic_cast<const CandType*>(GetCandBase()); 00143 if (cb == 0) { 00144 //gmi MSG("Cand", Msg::kError) 00145 //gmi << "Wrong type referenced from CandHandle " << GetName() << endl; 00146 throw CH::DereferenceNil; 00147 } 00148 return *cb; 00149 }
| CandType & CH< CandType >::WCmd | ( | ) |
Definition at line 153 of file CH.h.
References CH< CandType >::DereferenceNil, and CandHandle::GetOwnedCandBase().
00154 { 00155 CandType *cb = dynamic_cast<CandType*>(GetOwnedCandBase()); 00156 if (cb == 0) { 00157 //gmi MSG("Cand", Msg::kError) 00158 //gmi << "Wrong type referenced from CandHandle " << GetName() << endl; 00159 throw CH::DereferenceNil; 00160 } 00161 return *cb; 00162 }
1.4.7