#include <CeylanCountedPointer.h>
Classes | |
struct | Referent |
Second: implementation. More... | |
Public Types | |
typedef T | ElementType |
The counted object (wrapped resource) type. | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
CountedPointer (ElementType *resourcePointer=0) | |
CountedPointer (const CountedPointer< T > &source) | |
Copy constructor. | |
CountedPointer< T > & | operator= (const CountedPointer< T > &source) |
~CountedPointer () throw () | |
Destructor of a counted pointer, decreases the reference count which may lead to deallocation of resource. | |
ElementType & | operator* () const |
Dereferences the counted pointer to access the wrapped resource, and returns a reference to this resource. | |
ElementType * | operator-> () const |
Returns the wrapped resource pointer. | |
ElementType * | get () const |
Returns the wrapped resource pointer. | |
bool | isUnique () const |
Tells whether the reference count for the wrapped resource is exactly 1. | |
ReferenceCount | getReferenceCount () const |
Returns the reference count for this counted pointer. | |
virtual const std::string | toString (VerbosityLevels level=high) const |
Returns a user-friendly description of this counted pointer. | |
Static Public Member Functions | |
static const std::string | ToString (std::list< TextDisplayable * > displayables, Ceylan::VerbosityLevels level=Ceylan::high) |
Returns a user-friendly description of this list of pointers to text displayable instances. | |
static TextOutputFormat | GetOutputFormat () |
Returns the current overall text format to be used by TextDisplayable instances. | |
static void | SetOutputFormat (TextOutputFormat newOutputFormat) |
Sets the current overall text format to be used by TextDisplayable instances. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
void | reset (Referent *refPointer) |
Each CountedPointer has therefore a member: Referent * _referent ;. | |
void | setReferent (Referent *refPointer) |
Sets the referent for this counter pointer. | |
void | release () |
Release a reference to the wrapped resource. | |
Private Attributes | |
struct Ceylan::CountedPointer::Referent * | _referent |
Second: implementation. |
Definition at line 154 of file CeylanCountedPointer.h.
typedef T Ceylan::CountedPointer< T >::ElementType |
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
Ceylan::CountedPointer< T >::CountedPointer | ( | ElementType * | resourcePointer = 0 |
) | [inline] |
Definition at line 185 of file CeylanCountedPointer.h.
References Ceylan::CountedPointer< T >::setReferent().
Ceylan::CountedPointer< T >::CountedPointer | ( | const CountedPointer< T > & | source | ) | [inline] |
Copy constructor.
The two instances of counted pointer will refer the same referent.
Definition at line 206 of file CeylanCountedPointer.h.
References Ceylan::CountedPointer< T >::_referent, and Ceylan::CountedPointer< T >::setReferent().
Ceylan::CountedPointer< T >::~CountedPointer | ( | ) | throw () [inline] |
Destructor of a counted pointer, decreases the reference count which may lead to deallocation of resource.
Definition at line 255 of file CeylanCountedPointer.h.
References Ceylan::CountedPointer< T >::release().
ElementType* Ceylan::CountedPointer< T >::get | ( | ) | const [inline] |
Returns the wrapped resource pointer.
Definition at line 295 of file CeylanCountedPointer.h.
References Ceylan::CountedPointer< T >::_referent, and Ceylan::CountedPointer< T >::CountedPointer::Referent::_resourcePointer.
TextDisplayable::TextOutputFormat TextDisplayable::GetOutputFormat | ( | ) | [static, inherited] |
Returns the current overall text format to be used by TextDisplayable instances.
Definition at line 63 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::formatStringList(), Ceylan::formatStringMap(), Ceylan::XML::XMLMarkup::toString(), Ceylan::Maths::Linear::Vector3::toString(), Ceylan::Maths::Linear::Vector2::toString(), Ceylan::Maths::Linear::Tripoint::toString(), Ceylan::Module::toString(), Ceylan::Maths::Linear::Matrix3::toString(), Ceylan::Maths::Linear::Matrix2::toString(), Ceylan::Maths::Linear::HomogeneousMatrix3::toString(), and Ceylan::Maths::Linear::Bipoint::toString().
ReferenceCount Ceylan::CountedPointer< T >::getReferenceCount | ( | ) | const [inline] |
Returns the reference count for this counted pointer.
Definition at line 322 of file CeylanCountedPointer.h.
References Ceylan::CountedPointer< T >::CountedPointer::Referent::_refCount, and Ceylan::CountedPointer< T >::_referent.
bool Ceylan::CountedPointer< T >::isUnique | ( | ) | const [inline] |
Tells whether the reference count for the wrapped resource is exactly 1.
Definition at line 309 of file CeylanCountedPointer.h.
References Ceylan::CountedPointer< T >::CountedPointer::Referent::_refCount, and Ceylan::CountedPointer< T >::_referent.
ElementType& Ceylan::CountedPointer< T >::operator* | ( | ) | const [inline] |
Dereferences the counted pointer to access the wrapped resource, and returns a reference to this resource.
Definition at line 269 of file CeylanCountedPointer.h.
ElementType* Ceylan::CountedPointer< T >::operator-> | ( | ) | const [inline] |
CountedPointer<T>& Ceylan::CountedPointer< T >::operator= | ( | const CountedPointer< T > & | source | ) | [inline] |
Definition at line 226 of file CeylanCountedPointer.h.
References Ceylan::CountedPointer< T >::_referent, and Ceylan::CountedPointer< T >::reset().
void Ceylan::CountedPointer< T >::release | ( | ) | [inline, private] |
Release a reference to the wrapped resource.
If no reference left, deallocate this unused resource.
Definition at line 554 of file CeylanCountedPointer.h.
References Ceylan::CountedPointer< T >::CountedPointer::Referent::_refCount, Ceylan::CountedPointer< T >::_referent, and CEYLAN_DISPLAY_REFCOUNT.
Referenced by Ceylan::CountedPointer< T >::reset(), and Ceylan::CountedPointer< T >::~CountedPointer().
void Ceylan::CountedPointer< T >::reset | ( | Referent * | refPointer | ) | [inline, private] |
Each CountedPointer has therefore a member: Referent * _referent ;.
Releases one reference and sets the referent to the specified one.
Definition at line 518 of file CeylanCountedPointer.h.
References Ceylan::CountedPointer< T >::release(), and Ceylan::CountedPointer< T >::setReferent().
Referenced by Ceylan::CountedPointer< T >::operator=().
void TextDisplayable::SetOutputFormat | ( | TextOutputFormat | newOutputFormat | ) | [static, inherited] |
Sets the current overall text format to be used by TextDisplayable instances.
newOutputFormat | the new output format. |
Definition at line 72 of file CeylanTextDisplayable.cc.
References Ceylan::TextDisplayable::_OutputFormat.
Referenced by Ceylan::Log::LogHolder::LogHolder().
void Ceylan::CountedPointer< T >::setReferent | ( | Referent * | refPointer | ) | [inline, private] |
Sets the referent for this counter pointer.
Increments the reference count.
Definition at line 535 of file CeylanCountedPointer.h.
References Ceylan::CountedPointer< T >::CountedPointer::Referent::_refCount, Ceylan::CountedPointer< T >::_referent, and CEYLAN_DISPLAY_REFCOUNT.
Referenced by Ceylan::CountedPointer< T >::CountedPointer(), and Ceylan::CountedPointer< T >::reset().
const std::string TextDisplayable::ToString | ( | std::list< TextDisplayable * > | displayables, | |
Ceylan::VerbosityLevels | level = Ceylan::high | |||
) | [static, inherited] |
Returns a user-friendly description of this list of pointers to text displayable instances.
displayables | a list of pointers to TextDisplayable instances/ | |
level | the requested verbosity level. |
Definition at line 45 of file CeylanTextDisplayable.cc.
References Ceylan::formatStringList().
virtual const std::string Ceylan::CountedPointer< T >::toString | ( | VerbosityLevels | level = high |
) | const [inline, virtual] |
Returns a user-friendly description of this counted pointer.
Implements Ceylan::TextDisplayable.
Definition at line 337 of file CeylanCountedPointer.h.
References Ceylan::CountedPointer< T >::CountedPointer::Referent::_refCount, Ceylan::CountedPointer< T >::_referent, Ceylan::CountedPointer< T >::CountedPointer::Referent::_resourcePointer, and Ceylan::low.
TextDisplayable::TextOutputFormat TextDisplayable::_OutputFormat = rawText [static, protected, inherited] |
The text format to be used currently by TextDisplayable instances.
Definition at line 158 of file CeylanTextDisplayable.h.
Referenced by Ceylan::TextDisplayable::GetOutputFormat(), and Ceylan::TextDisplayable::SetOutputFormat().
struct Ceylan::CountedPointer::Referent * Ceylan::CountedPointer< T >::_referent [private] |
Second: implementation.
The referenced representation of the resource.
Referenced by Ceylan::CountedPointer< T >::CountedPointer(), Ceylan::CountedPointer< T >::get(), Ceylan::CountedPointer< T >::getReferenceCount(), Ceylan::CountedPointer< T >::isUnique(), Ceylan::CountedPointer< T >::operator=(), Ceylan::CountedPointer< T >::release(), Ceylan::CountedPointer< T >::setReferent(), and Ceylan::CountedPointer< T >::toString().