#include <CeylanMutex.h>
Public Types | |
enum | TextOutputFormat { rawText, html } |
Defines what text output formats for TextDisplayable instances are available. More... | |
Public Member Functions | |
Mutex () | |
Basic constructor. | |
virtual | ~Mutex () throw () |
Basic virtual destructor. | |
virtual void | lock () |
Locks the mutex. | |
virtual void | unlock () |
Unlocks the mutex. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns a user-friendly description of the state of this object. | |
virtual bool | mustBeLocked () const |
bool | isLocked () const |
Returns the lock state, locked or unlocked. | |
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. | |
Protected Member Functions | |
virtual void | postLock () |
Effective locking of the mutex. | |
virtual void | preUnlock () |
Effective locking of the mutex. | |
SystemSpecificMutexType & | getMutexReference () |
Returns the reference on the mutex itself. | |
Protected Attributes | |
bool | _locked |
This is the actual piece of informations which is used to know the lock state. | |
Static Protected Attributes | |
static TextOutputFormat | _OutputFormat = rawText |
The text format to be used currently by TextDisplayable instances. | |
Private Member Functions | |
Mutex (const Mutex &source) | |
Copy constructor made private to ensure that it will be never called. | |
Mutex & | operator= (const Mutex &source) |
Assignment operator made private to ensure that it will be never called. | |
Private Attributes | |
SystemSpecificMutexType * | _internalMutex |
The internal mutex type, depending on the platform. |
Mostly encapsulates POSIX default initialized mutex.
Definition at line 63 of file CeylanMutex.h.
enum Ceylan::TextDisplayable::TextOutputFormat [inherited] |
Defines what text output formats for TextDisplayable instances are available.
Definition at line 124 of file CeylanTextDisplayable.h.
Mutex::Mutex | ( | ) |
Basic constructor.
Features::FeatureNotAvailableException | if the multithreading feature is available. |
Definition at line 76 of file CeylanMutex.cc.
References _internalMutex.
Mutex::~Mutex | ( | ) | throw () [virtual] |
Ceylan::System::Mutex::Mutex | ( | const Mutex & | source | ) | [private] |
Copy constructor made private to ensure that it will be never called.
Mutex::SystemSpecificMutexType & Mutex::getMutexReference | ( | ) | [protected] |
Returns the reference on the mutex itself.
Definition at line 237 of file CeylanMutex.cc.
References _internalMutex.
Referenced by Ceylan::System::Thread::Thread::Waiter::wait().
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().
bool Ceylan::Lockable::isLocked | ( | ) | const [inline, inherited] |
Returns the lock state, locked or unlocked.
Definition at line 251 of file CeylanLockable.h.
void Mutex::lock | ( | ) | [virtual] |
Locks the mutex.
This method is to be called by the user of the class instances.
It will handle the locking process and will call the 'postLock' method afterwards.
LockException | if the operation failed. |
Reimplemented from Ceylan::Lockable.
Definition at line 117 of file CeylanMutex.cc.
References Ceylan::Lockable::_locked, postLock(), and generalUtils::true.
Referenced by Ceylan::System::Thread::Thread::Waiter::broadcast(), Ceylan::System::Synchronized< bool >::operator++(), Ceylan::System::Synchronized< ThreadCount >::operator++(), Ceylan::System::Synchronized< bool >::operator--(), Ceylan::System::Synchronized< ThreadCount >::operator--(), Ceylan::System::Synchronized< bool >::setValue(), Ceylan::System::Synchronized< ThreadCount >::setValue(), Ceylan::System::Thread::Thread::Waiter::signal(), and Ceylan::System::Thread::Thread::Waiter::wait().
bool Lockable::mustBeLocked | ( | ) | const [virtual, inherited] |
Definition at line 99 of file CeylanLockable.cc.
References generalUtils::true.
Referenced by Ceylan::Lockable::lock(), Ceylan::Lockable::unlock(), and Ceylan::Lockable::~Lockable().
Assignment operator made private to ensure that it will be never called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
void Mutex::postLock | ( | ) | [protected, virtual] |
Effective locking of the mutex.
LockException | if the effective locking failed. |
Reimplemented from Ceylan::Lockable.
Definition at line 139 of file CeylanMutex.cc.
References _internalMutex.
Referenced by lock().
void Mutex::preUnlock | ( | ) | [protected, virtual] |
Effective locking of the mutex.
LockException | if the effective locking failed. |
Reimplemented from Ceylan::Lockable.
Definition at line 183 of file CeylanMutex.cc.
References _internalMutex.
Referenced by unlock().
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().
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().
const std::string Mutex::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns a user-friendly description of the state of this object.
level | the requested verbosity level. |
Reimplemented from Ceylan::Lockable.
Definition at line 228 of file CeylanMutex.cc.
void Mutex::unlock | ( | ) | [virtual] |
Unlocks the mutex.
This method is to be called by the user of the class instances.
It will handle the unlocking process and will call the 'preUnlock' method afterwards.
LockException | if the operation failed. |
Reimplemented from Ceylan::Lockable.
Definition at line 128 of file CeylanMutex.cc.
References Ceylan::Lockable::_locked, generalUtils::false, and preUnlock().
Referenced by Ceylan::System::Thread::Thread::Waiter::broadcast(), Ceylan::System::Synchronized< bool >::operator++(), Ceylan::System::Synchronized< ThreadCount >::operator++(), Ceylan::System::Synchronized< bool >::operator--(), Ceylan::System::Synchronized< ThreadCount >::operator--(), Ceylan::System::Synchronized< bool >::setValue(), Ceylan::System::Synchronized< ThreadCount >::setValue(), Ceylan::System::Thread::Thread::Waiter::signal(), and Ceylan::System::Thread::Thread::Waiter::wait().
SystemSpecificMutexType* Ceylan::System::Mutex::_internalMutex [private] |
The internal mutex type, depending on the platform.
Definition at line 212 of file CeylanMutex.h.
Referenced by getMutexReference(), Mutex(), postLock(), preUnlock(), and ~Mutex().
bool Ceylan::Lockable::_locked [protected, inherited] |
This is the actual piece of informations which is used to know the lock state.
Definition at line 217 of file CeylanLockable.h.
Referenced by lock(), Ceylan::Lockable::lock(), Ceylan::Lockable::toString(), unlock(), Ceylan::Lockable::unlock(), and Ceylan::Lockable::~Lockable().
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().