claraty::const_Auto_Ref< T > Class Template Reference
#include <auto_reference.h>
Collaboration diagram for claraty::const_Auto_Ref< T >:

Public Member Functions | |
| const_Auto_Ref () | |
| const_Auto_Ref (const const_Auto_Ref &rhs) | |
| const_Auto_Ref (const Auto_Ref< T > &rhs) | |
| ~const_Auto_Ref () | |
| const void * | get_const_representation_pointer () const |
| const_Auto_Ref & | operator= (const const_Auto_Ref &rhs) |
| template<class S> | |
| void | cast_to (const_Auto_Ref< S > &rhs) |
| void | cast_to (const_Auto_Ref< T > &rhs) |
| void | reset_rc (ref_counter< T > *new_rc) |
| template<class R> | |
| bool | operator== (const const_Auto_Ref< R > &rhs) const |
| template<class R> | |
| bool | operator!= (const const_Auto_Ref< R > &rhs) const |
| const T & | operator * () const |
| const T * | operator-> () const |
| operator bool () const | |
| bool | operator! () const |
Private Attributes | |
| ref_counter< T > * | _rc |
Detailed Description
template<class T>
class claraty::const_Auto_Ref< T >
Definition at line 228 of file auto_reference.h.
Constructor & Destructor Documentation
| claraty::const_Auto_Ref< T >::const_Auto_Ref | ( | ) | [inline] |
Definition at line 231 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc.
00231 { _rc = new ref_counter<T>(); }
| claraty::const_Auto_Ref< T >::const_Auto_Ref | ( | const const_Auto_Ref< T > & | rhs | ) | [inline] |
Definition at line 232 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc, and claraty::ref_counter< RT >::inc().
Here is the call graph for this function:

| claraty::const_Auto_Ref< T >::const_Auto_Ref | ( | const Auto_Ref< T > & | rhs | ) | [inline] |
Definition at line 236 of file auto_reference.h.
References claraty::Auto_Ref< T >::_rc, claraty::const_Auto_Ref< T >::_rc, and claraty::ref_counter< RT >::inc().
Here is the call graph for this function:

| claraty::const_Auto_Ref< T >::~const_Auto_Ref | ( | ) | [inline] |
Definition at line 240 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc, and claraty::ref_counter< RT >::dec().
Here is the call graph for this function:

Member Function Documentation
| const void* claraty::const_Auto_Ref< T >::get_const_representation_pointer | ( | ) | const [inline] |
Definition at line 247 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc.
Referenced by claraty::const_Auto_Ref< T >::operator==().
00247 { return _rc; }
| const_Auto_Ref& claraty::const_Auto_Ref< T >::operator= | ( | const const_Auto_Ref< T > & | rhs | ) | [inline] |
Definition at line 249 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc, claraty::ref_counter< RT >::dec(), and claraty::ref_counter< RT >::inc().
00249 { 00250 if (_rc != rhs._rc) { 00251 if (_rc->dec() == 0) delete _rc; 00252 _rc = rhs._rc; 00253 _rc->inc(); 00254 } 00255 return *this; 00256 }
Here is the call graph for this function:

| void claraty::const_Auto_Ref< T >::cast_to | ( | const_Auto_Ref< S > & | rhs | ) | [inline] |
Definition at line 262 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc, claraty::ref_counter< RT >::_rep, and claraty::const_Auto_Ref< T >::reset_rc().
00262 { 00263 if (dynamic_cast<S*>(_rc->_rep) == NULL) { 00264 std::cerr << "Illegal attempt to cast an Auto_Ref<T> to an Auto_Ref<U> where " 00265 "U is not castable from T (or from a NULL Auto_Ref)" << std::endl; 00266 S& dummy = dynamic_cast<S&>(*_rc->_rep); // will throw bad_cast 00267 } 00268 ref_counter<S> *rc_subclass = reinterpret_cast<ref_counter<S>*>(_rc); 00269 rhs.reset_rc(rc_subclass); 00270 }
Here is the call graph for this function:

| void claraty::const_Auto_Ref< T >::cast_to | ( | const_Auto_Ref< T > & | rhs | ) | [inline] |
| void claraty::const_Auto_Ref< T >::reset_rc | ( | ref_counter< T > * | new_rc | ) | [inline] |
Definition at line 280 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc, claraty::ref_counter< RT >::dec(), and claraty::ref_counter< RT >::inc().
Referenced by claraty::const_Auto_Ref< T >::cast_to().
Here is the call graph for this function:

| bool claraty::const_Auto_Ref< T >::operator== | ( | const const_Auto_Ref< R > & | rhs | ) | const [inline] |
Definition at line 287 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc, and claraty::const_Auto_Ref< T >::get_const_representation_pointer().
Referenced by claraty::const_Auto_Ref< T >::operator!=().
00287 { 00288 return static_cast<void*>(_rc) == rhs.get_const_representation_pointer(); 00289 }
Here is the call graph for this function:

| bool claraty::const_Auto_Ref< T >::operator!= | ( | const const_Auto_Ref< R > & | rhs | ) | const [inline] |
Definition at line 292 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::operator==().
00292 { 00293 return !operator==(rhs); 00294 }
Here is the call graph for this function:

| const T& claraty::const_Auto_Ref< T >::operator * | ( | ) | const [inline] |
Definition at line 295 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc, and claraty::ref_counter< RT >::_rep.
00295 { 00296 return *_rc->_rep; 00297 }
| const T* claraty::const_Auto_Ref< T >::operator-> | ( | ) | const [inline] |
Definition at line 299 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc, and claraty::ref_counter< RT >::_rep.
00299 { 00300 return _rc->_rep; 00301 }
| claraty::const_Auto_Ref< T >::operator bool | ( | ) | const [inline] |
Definition at line 303 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc, and claraty::ref_counter< RT >::_rep.
00303 { 00304 return !!_rc->_rep; 00305 }
| bool claraty::const_Auto_Ref< T >::operator! | ( | ) | const [inline] |
Definition at line 306 of file auto_reference.h.
References claraty::const_Auto_Ref< T >::_rc, and claraty::ref_counter< RT >::_rep.
00306 { 00307 return !_rc->_rep; 00308 }
Member Data Documentation
ref_counter<T>* claraty::const_Auto_Ref< T >::_rc [private] |
Definition at line 229 of file auto_reference.h.
Referenced by claraty::const_Auto_Ref< T >::cast_to(), claraty::const_Auto_Ref< T >::const_Auto_Ref(), claraty::const_Auto_Ref< T >::get_const_representation_pointer(), claraty::const_Auto_Ref< T >::operator *(), claraty::const_Auto_Ref< T >::operator bool(), claraty::const_Auto_Ref< T >::operator!(), claraty::const_Auto_Ref< T >::operator->(), claraty::const_Auto_Ref< T >::operator=(), claraty::const_Auto_Ref< T >::operator==(), claraty::const_Auto_Ref< T >::reset_rc(), and claraty::const_Auto_Ref< T >::~const_Auto_Ref().
The documentation for this class was generated from the following file: