Wefts Namespace Reference


Detailed Description

The Wefts++ namespace.

All the wefts classes and functions are available under Wefts namespace; they are rather thread specific, so if you are using Wefts++ alone, without any other threading library, you will be pretty safe in adding:

#include <wefts.h> using namespace Wefts;

Otherwise, you will have to prefix all Wefts++ calls with the namespace:

#include <wefts.h> int main( int argc, char *argv[] ) { //sleeping a while.. Wefts::Sleep( 1.5 ); }


Classes

class  Wefts::Barrier
 Programmable fence object. More...

class  Wefts::CondCleanup
 Basic condition cleanup. More...

class  Wefts::CleanupHandler
 Cleanup handler interface. More...

class  Wefts::CleanupItem
 Item representing a cleanup handler and its parameters. More...

class  Wefts::OSFileFuncBase
 Abstracts an OS specific file fucntion set. More...

class  Wefts::OSProcessBase
 Representation of subprocesses on the platform. More...

class  Wefts::OSFileFuncUnix
 OS COFFEE Unix implementation. More...

class  Wefts::OSFileFuncWin
 Implements COFFEE file specific extensions for MS-Windows. More...

class  Wefts::Condition
 Class implementing a condition variable. More...

class  Wefts::Counter
 Syncrhonizable counter. More...

class  Wefts::CriticalSection
 Critical sections implementation support. More...

class  Wefts::Error
 Generic error class This is meant to be overloaded by specific error classes below. More...

class  Wefts::NotJoinableError
 Error risen when the thread tries to join a detached thread. More...

class  Wefts::InvalidError
 Error risen if an object is in an invalid state while being used. More...

class  Wefts::InitError
 Error risen when there is an object can't be initialized. More...

class  Wefts::StartError
 Error risen when is not possible to start other threads anymore. More...

class  Wefts::FastCondition
 Fast mutex + condition structure wrapper. More...

class  Wefts::MoaningThread
 A thread subclass supporting an arbitrary number of joiners. More...

class  Wefts::Mutex
 Implements a very fast, non reentrant mutex. More...

struct  Wefts::tag_ThreadAndReturn
 Utility structure to pass around a thread object along with its return. More...

class  Wefts::OSMutexBase
 Implements an OS specific mutex This mutex class is not supposed to be reentrant, but it is supposed to have an trylock() feature at OS level. More...

class  Wefts::OSConditionBase
 This class implement an os-dependant condition. More...

class  Wefts::OSThreadBase
 Thread OS layer abstraction This class can be rewritten in other header files to implement different os specific threading system. More...

class  Wefts::OSSpecificDataBase
 Wrapper class for thread specific data access (tsd/tls). More...

class  Wefts::OSMutexPthread
class  Wefts::OSConditionPthread
 This class implement an os-dependant condition. More...

class  Wefts::OSThreadPthread
 Wraps Posix threads. More...

class  Wefts::OSSpecificDataPthread
 Wrapper class for pthread specific data access (tsd/tls). More...

class  Wefts::OSMutexWindows
 Windows implementation of mutex. More...

class  Wefts::OSConditionWindows
 This class implement an os-dependant condition. More...

class  Wefts::OSThreadWindows
 Wraps Windows threads. More...

class  Wefts::OSSpecificDataWindows
 Wrapper class for thread specific data access (tsd/tls). More...

class  Wefts::OSProcessPthread
 Representation of subprocesses on the platform. More...

class  Wefts::OSProcessWin
 Representation of subprocesses on the platform. More...

class  Wefts::Queue< T >
 Waitable template FIFO structure. More...

class  Wefts::RCondition
 Reentrant mutex + condition structure wrapper. More...

class  Wefts::Referenced
 Shared object between threads implementing reference count and self-cancellation. More...

class  Wefts::RingBuffer< _T >
 Ring buffer synchronization object. More...

class  Wefts::RMutex
 This is a reentrant mutex with spinlock. More...

class  Wefts::RRWMutex
 This is an advanced (and fully reentrant) read/write mutex. More...

class  Wefts::RWMutex
 This is a read/write mutex. More...

class  Wefts::Semaphore
 Semaphore semantic. More...

class  Wefts::ThreadPtr< _T >
 Implements a very fast thread specific data. More...

class  Wefts::Stack< T >
 Waitable template LIFO structure. More...

class  Wefts::Subscription
 Subscribe/notify model abstraction. More...

class  Wefts::Thread
 Implements the abstraction of a thread. More...

class  Wefts::XMutex
 Advanced mutex class. More...


Typedefs

typedef std::list< CleanupItemCleanupList
 List of cleanup actions to be taken.

typedef long long file_size_t
 The longest integer available on the platform.

typedef OSFileFuncUnix OSFileFunc
 Definition that hooks COFFEE in your application.

typedef Wefts::tag_ThreadAndReturn ThreadAndReturn
 Utility structure to pass around a thread object along with its return.

typedef OSSpecificDataPthread OSSpecificData
 Function to execute the thread RUN procedure guarded by OS cleanup.

typedef OSThreadPthread OSThread
typedef OSConditionPthread OSCondition
typedef OSMutexPthread OSMutex
typedef OSProcessPthread Process

Enumerations

enum  LockMode { LM_SHARED, LM_SHARED_RO, LM_EXCLUSIVE }
 Basic locking schemes used by various systems at open time. More...

enum  OpenMode {
  OM_RO, OM_WO, OM_RW, OM_TRUNC_WO,
  OM_TRUNC_RW, OM_APPEND_WO, OM_APPEND_RW
}
 Basic open modes used by various systems. More...

enum  CreateMode {
  CM_ARCHIVE, CM_SYSTEM, CM_EXECUTABLE, CM_PRIVATE,
  CM_PRIVATE_EX
}
 Creation modes. More...

enum  CffStatus {
  CFF_DONE, CFF_WAITING, CFF_TIMEDOUT, CFF_SOFTERROR,
  CFF_HARDERROR, CFF_PROGERROR
}
 Cooperative File Functions Status. More...

enum  SeekWhence { SW_FROM_BEGIN = 0, SW_FROM_CUR = 1, SW_FROM_CURENT = 1, SW_FROM_END = 2 }
 Position indicators for file seeks. More...

enum  OSPriority {
  PrioRealTime = 0, PrioHigh = 1, PrioNormal = 2, PrioLow = 3,
  PrioIdle = 4
}
 Portable priority concept. More...


Functions

std::string OSErrorDescription (int osCode)
 Function to report OS specific error.

bool OSSleep (long nSeconds, long nNanoseconds)
 Function to provide a wefts-interruptable wait.

void * getCurrentThreadObject ()
 Function that returns the thread object running in the current OS thread.

void setCurrentThreadObject (void *thread)
 Function used to set current thread object.

void wefts_pthread_cond_guard (void *param)
 This function is used internally by pthread module to safely guard the condition on async cancellation.

void wefts_pthread_cond_reset (void *param)
bool Sleep (long seconds, long nanoseconds)
 Sleeps a certain amount of time.

bool Sleep (double seconds)
 Sleeps a certain amount of time.

CounterstartedThreads ()
 Incremental counter of started threads.

std::ostream & operator<< (std::ostream &stream, Error &err)
void * s_followDetached (void *param)
void s_ThreadCleanupper (void *param)
 Function used (internally) to invoke thread->cleanup() in case of cancellation.

void * s_ThreadRunner (void *data)
void * s_ThreadRunFunc (void *param)
 Function used (internally) to invoke thread->run().

Counter runningThreads (1)
 Counter of currently active (or near-to-be active) threads.


Variables

CondCleanup BasicConditionCleanup
DWORD s_tlsThreadObj
void(* s_cleanerPointer )(void *)
Counter runningThreads
 Counter of currently active (or near-to-be active) threads.


Typedef Documentation

typedef std::list< CleanupItem > Wefts::CleanupList
 

List of cleanup actions to be taken.

typedef OSProcessWin Wefts::Process
 


Function Documentation

std::ostream& operator<< std::ostream &  stream,
Error &  err
 

Use this operator to display what kind of error has happened

Counter runningThreads  ) 
 

Counter of currently active (or near-to-be active) threads.

Initialized to 1: if we initialized it, the main thread is running...

void* s_followDetached void *  param  )  [static]
 

void s_ThreadCleanupper void *  param  ) 
 

Function used (internally) to invoke thread->cleanup() in case of cancellation.

As this function is the only one that has the right to delete the thread object in case of detached thread, this function is also responsible to set the m_runReturn parameter in case the thread is NOT detached. For this reasion, this function is fed with a ThreadAndReturn pointer as parameter.

Parameters:
param a ThreadAndReturn structure pointer, containing the thread object and the run return value, if the run function had the chance to return, or 0 otherwise.

void* s_ThreadRunFunc void *  param  ) 
 

Function used (internally) to invoke thread->run().

void* s_ThreadRunner void *  data  ) 
 


Variable Documentation

CondCleanup Wefts::BasicConditionCleanup
 

void(* Wefts::s_cleanerPointer)(void *)
 

DWORD Wefts::s_tlsThreadObj
 


Generated on Tue Oct 5 14:57:01 2004 for Wefts by doxygen 1.3.7