Loading...
Searching...
No Matches
CountedRefWeakPtr< PtrType > Class Template Reference

`#include <countedref.h>`

## Private Types

typedef CountedRefWeakPtr | self

## Name template arguments

typedef PtrType | ptr_type
| Construct unassigned weak reference.
typedef CountedRefPtr< CountedRefIndirectPtr< ptr_type > * > | ptrptr_type
| Construct unassigned weak reference.
ptrptr_type | m_indirect
| Construct unassigned weak reference.
| CountedRefWeakPtr ()
| Construct unassigned weak reference.
| CountedRefWeakPtr (ptr_type ptr)
| Convert from pointer.
| CountedRefWeakPtr (const self &rhs)
| Construct copy.
| ~CountedRefWeakPtr ()
| Unlink one reference (handled by CountedRefPtr).
void | invalidate ()
| Mark weak reference as invalid.
bool | unassigned () const
| Test whether reference was never used.
| operator bool () const
| Pointer-style interface.
self & | operator= (const self &rhs)
| Construct unassigned weak reference.
self & | operator= (ptr_type ptr)
| Construct unassigned weak reference.
bool | operator== (ptr_type ptr) const
| Construct unassigned weak reference.
bool | operator!= (ptr_type rhs) const
| Construct unassigned weak reference.
const ptr_type | operator-> () const
| Construct unassigned weak reference.
ptr_type | operator-> ()
| Construct unassigned weak reference.

## Detailed Description

template<class PtrType>
class CountedRefWeakPtr< PtrType >

Definition at line 154 of file countedref.h.

## Member Typedef Documentation

## ptr_type

template<class PtrType>

typedef PtrType CountedRefWeakPtr< PtrType >::ptr_type

Construct unassigned weak reference.

Definition at line 161 of file countedref.h.

## ptrptr_type

template<class PtrType>

typedef CountedRefPtr<CountedRefIndirectPtr<ptr_type>*> CountedRefWeakPtr< PtrType >::ptrptr_type

Construct unassigned weak reference.

Definition at line 162 of file countedref.h.

## self

template<class PtrType>

typedef CountedRefWeakPtr CountedRefWeakPtr< PtrType >::self

private

Definition at line 155 of file countedref.h.

## Constructor & Destructor Documentation

## CountedRefWeakPtr() [1/3]

template<class PtrType>

CountedRefWeakPtr< PtrType >::CountedRefWeakPtr | ( |  | ) |

inline

Construct unassigned weak reference.

Definition at line 166 of file countedref.h.

: m_indirect(NULL) { }
CountedRefWeakPtr
Definition countedref.h:154
CountedRefWeakPtr::m_indirect
ptrptr_type m_indirect
Construct unassigned weak reference.
Definition countedref.h:204

## CountedRefWeakPtr() [2/3]

template<class PtrType>

CountedRefWeakPtr< PtrType >::CountedRefWeakPtr | ( | ptr_type | ptr | ) |

inline

Convert from pointer.

Definition at line 169 of file countedref.h.

: m_indirect(new CountedRefIndirectPtr<ptr_type>(ptr)) { }

## CountedRefWeakPtr() [3/3]

template<class PtrType>

CountedRefWeakPtr< PtrType >::CountedRefWeakPtr | ( | const self & | rhs | ) |

inline

Construct copy.

Definition at line 172 of file countedref.h.

: m_indirect(rhs.m_indirect) { }

## ~CountedRefWeakPtr()

template<class PtrType>

CountedRefWeakPtr< PtrType >::~CountedRefWeakPtr | ( |  | ) |

inline

Unlink one reference (handled by CountedRefPtr).

Definition at line 175 of file countedref.h.

{ }

## Member Function Documentation

## invalidate()

template<class PtrType>

void CountedRefWeakPtr< PtrType >::invalidate | ( |  | ) |

inline

Mark weak reference as invalid.

Definition at line 178 of file countedref.h.

{ *this = NULL; }

## operator bool()

template<class PtrType>

CountedRefWeakPtr< PtrType >::operator bool | ( |  | ) | const

inline

Pointer-style interface.

Definition at line 184 of file countedref.h.

{ return operator->(); }
CountedRefWeakPtr::operator->
const ptr_type operator->() const
Construct unassigned weak reference.
Definition countedref.h:200

## operator!=()

template<class PtrType>

bool CountedRefWeakPtr< PtrType >::operator!= | ( | ptr_type | rhs | ) | const

inline

Construct unassigned weak reference.

Definition at line 199 of file countedref.h.

{ return !operator==(rhs); }
operator==
bool operator==(const Rational &a, const Rational &b)
Definition GMPrat.cc:312

## operator->() [1/2]

template<class PtrType>

ptr_type CountedRefWeakPtr< PtrType >::operator-> | ( |  | ) |

inline

Construct unassigned weak reference.

Definition at line 201 of file countedref.h.

{ return (m_indirect? m_indirect->m_ptr:NULL); }

## operator->() [2/2]

template<class PtrType>

const ptr_type CountedRefWeakPtr< PtrType >::operator-> | ( |  | ) | const

inline

Construct unassigned weak reference.

Definition at line 200 of file countedref.h.

{ return (m_indirect? m_indirect->m_ptr: NULL); }

## operator=() [1/2]

template<class PtrType>

self & CountedRefWeakPtr< PtrType >::operator= | ( | const self & | rhs | ) |

inline

Construct unassigned weak reference.

Definition at line 185 of file countedref.h.

{
m_indirect = rhs.m_indirect;
return *this;
}

## operator=() [2/2]

template<class PtrType>

self & CountedRefWeakPtr< PtrType >::operator= | ( | ptr_type | ptr | ) |

inline

Construct unassigned weak reference.

Definition at line 189 of file countedref.h.

{
if (!m_indirect)
m_indirect = new CountedRefIndirectPtr<ptr_type>(ptr);
else
m_indirect->m_ptr = ptr;
return *this;
}

## operator==()

template<class PtrType>

bool CountedRefWeakPtr< PtrType >::operator== | ( | ptr_type | ptr | ) | const

inline

Construct unassigned weak reference.

Definition at line 196 of file countedref.h.

{
return m_indirect &&(m_indirect->m_ptr == ptr);
}

## unassigned()

template<class PtrType>

bool CountedRefWeakPtr< PtrType >::unassigned | ( |  | ) | const

inline

Test whether reference was never used.

Definition at line 181 of file countedref.h.

{ return !m_indirect; }

## Field Documentation

## m_indirect

template<class PtrType>

ptrptr_type CountedRefWeakPtr< PtrType >::m_indirect

private

Construct unassigned weak reference.

Definition at line 204 of file countedref.h.

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

- Singular/countedref.h