UCommon

ucc Namespace Reference

Common namespace for all ucommon objects. More...

Data Structures

class  auto_protect
 A mutex locked object smart pointer helper class. More...
class  barrier
 A portable implimentation of "barrier" thread sychronization. More...
class  Buffer
 A thread-safe buffer for serializing and streaming class data. More...
class  bufferof
 A templated typed class for buffering of objects. More...
class  charfile
 Access standard files through character protocol. More...
class  Cipher
 A generic data ciphering class. More...
class  Conditional
 The conditional is a common base for other thread synchronizing classes. More...
class  ConditionalAccess
 The conditional rw seperates scheduling for optizming behavior or rw locks. More...
class  ConditionalLock
 An optimized and convertable shared lock. More...
class  DetachedThread
 A detached thread object that is stand-alone. More...
class  Digest
 A cryptographic digest class. More...
class  Exclusive
 An exclusive locking protocol interface base. More...
class  exclusive_lock
 A kind of smart pointer object to support exclusive locking protocol. More...
class  fbuf
 A generic file streaming class built from the buffer protocol. More...
class  fsys
 A container for generic and o/s portable threadsafe file system functions. More...
class  JoinableThread
 A child thread object that may be joined by parent. More...
class  locked_instance
 A templated smart pointer instance for lock protected objects. More...
class  locked_pointer
 Templated locked pointer for referencing locked objects of specific type. More...
class  locked_release
 Auto-pointer support class for locked objects. More...
class  LockedPointer
 An object pointer that uses mutex to assure thread-safe singleton use. More...
class  mutex
 Generic non-recursive exclusive lock class. More...
class  mutex_pointer
 Typed smart locked pointer class. More...
class  queue
 Manage a thread-safe queue of objects through reference pointers. More...
class  queueof
 A templated typed class for thread-safe queue of object pointers. More...
class  Random
 Cryptographically relevant random numbers. More...
class  ReusableAllocator
 Class for resource bound memory pools between threads. More...
class  rexlock
 Portable recursive exclusive lock. More...
class  rwlock
 A generic and portable implimentation of Read/Write locking. More...
class  secure
 Common secure socket support. More...
class  semaphore
 A portable counting semaphore class. More...
class  Shared
 An exclusive locking protocol interface base. More...
class  shared_instance
 A templated smart pointer instance for shared singleton typed objects. More...
class  shared_lock
 A kind of smart pointer object to support shared locking protocol. More...
class  shared_pointer
 Templated shared pointer for singleton shared objects of specific type. More...
class  shared_release
 Auto-pointer support class for shared singleton objects. More...
class  SharedObject
 Shared singleton object. More...
class  SharedPointer
 The shared pointer is used to manage a singleton instance of shared object. More...
class  SSLBuffer
 Secure socket buffer. More...
class  sstream
 Secure socket using std::iostream. More...
class  stack
 Manage a thread-safe stack of objects through reference pointers. More...
class  stackof
 A templated typed class for thread-safe stack of object pointers. More...
class  TCPBuffer
 A generic tcp socket class that offers i/o buffering. More...
class  Thread
 An abstract class for defining classes that operate as a thread. More...
class  TimedEvent
 Event notification to manage scheduled realtime threads. More...

Typedefs

typedef ConditionalAccess accesslock_t
 Convenience type for scheduling access.
typedef barrier barrier_t
 Convenience type for using thread barriers.
typedef Cipher cipher_t
 Convenience type for generic ciphers.
typedef ConditionalLock condlock_t
 Convenience type for using conditional locks.
typedef Digest digest_t
 Convenience type for generic digests.
typedef void * dir_t
 Convenience type for directory scan operations.
typedef exclusive_lock exlock_t
 Convenience type to use for object referencing an exclusive object.
typedef queue fifo_t
 Convenience type for using thread-safe object fifo (queue).
typedef fbuf file_t
 Convenience type for buffered file operations.
typedef fsys fsys_t
 Convience type for fsys.
typedef void * mem_t
 Convenience type for loader operations.
typedef mutex Mutex
 Convenience type for using exclusive mutex on systems which define "mutex" (solaris) already to avoid type confusion.
typedef mutex mutex_t
 Convenience type for using exclusive mutex locks.
typedef rexlock rexlock_t
 Convenience type for using recursive exclusive locks.
typedef rwlock rwlock_t
 Convenience type for using read/write locks.
typedef semaphore semaphore_t
 Convenience type for using counting semaphores.
typedef shared_lock shlock_t
 Convenience type to use for object referencing a shared object.
typedef Cipher::Key skey_t
 Convenience type for generic cipher key.
typedef SSLBuffer ssl_t
 Convenience type for secure socket.
typedef stack stack_t
 Convenience type for using thread-safe object stacks.
typedef TCPBuffer tcp_t
 Convenience type for pure tcp sockets.
typedef TimedEvent timedevent_t
 Convenience type for using timed events.

Functions

void access (Shared *object)
 Convenience function to access (lock) shared object through it's protocol.
void access (accesslock_t &lock)
 Convenience function to shared read schedule conditional access.
void access (condlock_t &lock)
 Convenience function for shared access to a conditional lock.
void acquire (mutex_t &mutex)
 Convenience function to acquire a mutex.
void commit (accesslock_t &lock)
 Convenience function to commit an exclusive access lock.
void commit (condlock_t &lock)
 Convenience function to commit and release an exclusively locked conditional lock.
void exclusive (Shared *object)
 Convenience function to exclusive lock shared object through it's protocol.
void exclusive (condlock_t &lock)
 Convenience function to exclusively lock shared conditional lock.
bool exclusive (rwlock_t &lock, timeout_t timeout=Timer::inf)
 Convenience function for exclusive write access to a read/write lock.
void lock (Exclusive *object)
 Convenience function to exclusively lock an object through it's protocol.
void lock (rexlock_t &lock)
 Convenience function to lock a shared recursive mutex lock.
void modify (accesslock_t &lock)
 Convenience function to exclusively schedule conditional access.
void modify (condlock_t &lock)
 Convenience function to exclusively aquire a conditional lock.
Objectpull (stack_t &stack, timeout_t timeout=Timer::inf)
 Convenience function to pull an object from a stack.
Objectpull (fifo_t &fifo, timeout_t timeout=Timer::inf)
 Convenience function to pull an object from a fifo.
void push (stack_t &stack, Object *object)
 Convenience function to push an object onto a stack.
void push (fifo_t &fifo, Object *object)
 Convenience function to push an object onto a fifo.
void release (shlock_t &reference)
 Convenience function to release a reference to a shared lock.
void release (rexlock_t &lock)
 Convenience function to release a shared recursive mutex lock.
void release (Shared *object)
 Convenience function to unlock shared object through it's protocol.
void release (accesslock_t &lock)
 Convenience function to release an access lock.
void release (semaphore_t &semaphore)
 Convenience function to release a semaphore.
void release (condlock_t &lock)
 Convenience function to release shared access to a conditional lock.
void release (rwlock_t &lock)
 Convenience function to release a shared lock.
void release (exlock_t &reference)
 Convenience function to release a reference to an exclusive lock.
void release (mutex_t &mutex)
 Convenience function to release a mutex.
void remove (stack_t &stack, Object *object)
 Convenience function to remove an object from a stack.
void remove (fifo_t &fifo, Object *object)
 Convenience function to remove an object from a fifo.
void share (Shared *object)
 Convenience function to restore shared locking for object through it's protocol.
void share (condlock_t &lock)
 Convenience function to restore shared access on a conditional lock.
bool share (rwlock_t &lock, timeout_t timeout=Timer::inf)
 Convenience function for shared read access to a read/write lock.
void start (DetachedThread *thread, int priority=0)
 Convenience function to start a detached thread.
void start (JoinableThread *thread, int priority=0)
 Convenience function to start a joinable thread.
String str (charfile &fp, strsize_t size)
void unlock (Exclusive *object)
 Convenience function to unlock an exclusive object through it's protocol.
void wait (barrier_t &barrier)
 Convenience function to wait on a barrier.
void wait (semaphore_t &semaphore, timeout_t timeout=Timer::inf)
 Convenience function to wait on a semaphore.
void zerofill (void *addr, size_t size)

Detailed Description

Common namespace for all ucommon objects.

We are using a common namespace to easily separate ucommon from other libraries. This namespace may be changed from ucc to gnu when we merge code with GNU Common C++. In any case, it is controlled by macros and so any changes will be hidden from user applications so long as the namespace macros (UCOMMON_NAMESPACE, NAMESPACE_UCOMMON, END_NAMESPACE) are used in place of direct namespace declarations.


Function Documentation

void ucc::access ( Shared *  object) [inline]

Convenience function to access (lock) shared object through it's protocol.

Parameters:
objectto share lock.

Definition at line 241 of file access.h.

void ucc::access ( accesslock_t &  lock) [inline]

Convenience function to shared read schedule conditional access.

Parameters:
lockto access shared.

Definition at line 2659 of file thread.h.

Here is the call graph for this function:

void ucc::access ( condlock_t &  lock) [inline]

Convenience function for shared access to a conditional lock.

Parameters:
lockto access.

Definition at line 2710 of file thread.h.

Here is the call graph for this function:

void ucc::acquire ( mutex_t &  mutex) [inline]

Convenience function to acquire a mutex.

Parameters:
mutexto acquire.

Definition at line 2638 of file thread.h.

Here is the call graph for this function:

void ucc::commit ( accesslock_t &  lock) [inline]

Convenience function to commit an exclusive access lock.

lock.

Parameters:
lockto commit.

Definition at line 2674 of file thread.h.

Here is the call graph for this function:

void ucc::commit ( condlock_t &  lock) [inline]

Convenience function to commit and release an exclusively locked conditional lock.

Parameters:
lockto commit.

Definition at line 2703 of file thread.h.

Here is the call graph for this function:

void ucc::exclusive ( Shared *  object) [inline]

Convenience function to exclusive lock shared object through it's protocol.

Parameters:
objectto exclusive lock.

Definition at line 255 of file access.h.

void ucc::exclusive ( condlock_t &  lock) [inline]

Convenience function to exclusively lock shared conditional lock.

Parameters:
lockto make exclusive.

Definition at line 2681 of file thread.h.

Here is the call graph for this function:

bool ucc::exclusive ( rwlock_t &  lock,
timeout_t  timeout = Timer::inf 
) [inline]

Convenience function for exclusive write access to a read/write lock.

Parameters:
lockto write lock.
timeoutto wait for exclusive locking.

Definition at line 2725 of file thread.h.

Here is the call graph for this function:

void ucc::lock ( Exclusive *  object) [inline]

Convenience function to exclusively lock an object through it's protocol.

Parameters:
objectto lock.

Definition at line 227 of file access.h.

void ucc::lock ( rexlock_t &  lock) [inline]

Convenience function to lock a shared recursive mutex lock.

Parameters:
lockto acquire.

Definition at line 2747 of file thread.h.

Here is the call graph for this function:

void ucc::modify ( accesslock_t &  lock) [inline]

Convenience function to exclusively schedule conditional access.

Parameters:
lockto make exclusive.

Definition at line 2652 of file thread.h.

Here is the call graph for this function:

void ucc::modify ( condlock_t &  lock) [inline]

Convenience function to exclusively aquire a conditional lock.

Parameters:
lockto acquire for modify.

Definition at line 2695 of file thread.h.

Here is the call graph for this function:

Object* ucc::pull ( stack_t &  stack,
timeout_t  timeout = Timer::inf 
) [inline]

Convenience function to pull an object from a stack.

Parameters:
stackto pull from.
timeoutto wait to pull.
Returns:
object pulled.

Definition at line 2771 of file thread.h.

Here is the call graph for this function:

Object* ucc::pull ( fifo_t &  fifo,
timeout_t  timeout = Timer::inf 
) [inline]

Convenience function to pull an object from a fifo.

Parameters:
fifoto pull from.
timeoutto wait to pull.
Returns:
object pulled.

Definition at line 2796 of file thread.h.

Here is the call graph for this function:

void ucc::push ( stack_t &  stack,
Object object 
) [inline]

Convenience function to push an object onto a stack.

Parameters:
stackto push into.
objectto push.

Definition at line 2762 of file thread.h.

Here is the call graph for this function:

void ucc::push ( fifo_t &  fifo,
Object object 
) [inline]

Convenience function to push an object onto a fifo.

Parameters:
fifoto push into.
objectto push.

Definition at line 2787 of file thread.h.

Here is the call graph for this function:

void ucc::release ( shlock_t &  reference) [inline]

Convenience function to release a reference to a shared lock.

Parameters:
referenceto object referencing shared locked object.

Definition at line 286 of file access.h.

Here is the call graph for this function:

void ucc::release ( rexlock_t &  lock) [inline]

Convenience function to release a shared recursive mutex lock.

Parameters:
lockto release.

Definition at line 2754 of file thread.h.

Here is the call graph for this function:

void ucc::release ( Shared *  object) [inline]

Convenience function to unlock shared object through it's protocol.

Parameters:
objectto unlock.

Definition at line 248 of file access.h.

void ucc::release ( accesslock_t &  lock) [inline]

Convenience function to release an access lock.

Parameters:
lockto release.

Definition at line 2666 of file thread.h.

Here is the call graph for this function:

void ucc::release ( semaphore_t &  semaphore) [inline]

Convenience function to release a semaphore.

Parameters:
semaphoreto release.

Definition at line 2631 of file thread.h.

Here is the call graph for this function:

void ucc::release ( condlock_t &  lock) [inline]

Convenience function to release shared access to a conditional lock.

Parameters:
lockto release.

Definition at line 2717 of file thread.h.

Here is the call graph for this function:

void ucc::release ( rwlock_t &  lock) [inline]

Convenience function to release a shared lock.

Parameters:
lockto release.

Definition at line 2740 of file thread.h.

Here is the call graph for this function:

void ucc::release ( exlock_t &  reference) [inline]

Convenience function to release a reference to an exclusive lock.

Parameters:
referenceto object referencing exclusive locked object.

Definition at line 279 of file access.h.

Here is the call graph for this function:

void ucc::release ( mutex_t &  mutex) [inline]

Convenience function to release a mutex.

Parameters:
mutexto release.

Definition at line 2645 of file thread.h.

Here is the call graph for this function:

void ucc::remove ( stack_t &  stack,
Object object 
) [inline]

Convenience function to remove an object from a stack.

Parameters:
stackto remove from.
objectto remove.

Definition at line 2779 of file thread.h.

Here is the call graph for this function:

void ucc::remove ( fifo_t &  fifo,
Object object 
) [inline]

Convenience function to remove an object from a fifo.

Parameters:
fifoto remove from.
objectto remove.

Definition at line 2804 of file thread.h.

void ucc::share ( Shared *  object) [inline]

Convenience function to restore shared locking for object through it's protocol.

Parameters:
objectto restore shared locking.

Definition at line 262 of file access.h.

void ucc::share ( condlock_t &  lock) [inline]

Convenience function to restore shared access on a conditional lock.

Parameters:
lockto make shared.

Definition at line 2688 of file thread.h.

Here is the call graph for this function:

bool ucc::share ( rwlock_t &  lock,
timeout_t  timeout = Timer::inf 
) [inline]

Convenience function for shared read access to a read/write lock.

Parameters:
lockto share read lock.
timeoutto wait for shared access.

Definition at line 2733 of file thread.h.

Here is the call graph for this function:

void ucc::start ( DetachedThread *  thread,
int  priority = 0 
) [inline]

Convenience function to start a detached thread.

Parameters:
threadto start.
priorityof thread.

Definition at line 2553 of file thread.h.

Here is the call graph for this function:

void ucc::start ( JoinableThread *  thread,
int  priority = 0 
) [inline]

Convenience function to start a joinable thread.

Parameters:
threadto start.
priorityof thread.
Examples:
thread.cpp.

Definition at line 2545 of file thread.h.

Here is the call graph for this function:

void ucc::unlock ( Exclusive *  object) [inline]

Convenience function to unlock an exclusive object through it's protocol.

Parameters:
objectto unlock.

Definition at line 234 of file access.h.

void ucc::wait ( barrier_t &  barrier) [inline]

Convenience function to wait on a barrier.

Parameters:
barrierto wait.

Definition at line 2616 of file thread.h.

Here is the call graph for this function:

void ucc::wait ( semaphore_t &  semaphore,
timeout_t  timeout = Timer::inf 
) [inline]

Convenience function to wait on a semaphore.

Parameters:
semaphoreto wait on.
timeoutto wait for.

Definition at line 2624 of file thread.h.

Here is the call graph for this function: