UCommon
Public Member Functions
ucommon::shared_pointer< T > Class Template Reference

Templated shared pointer for singleton shared objects of specific type. More...

#include <thread.h>

Inheritance diagram for ucommon::shared_pointer< T >:
Inheritance graph
[legend]
Collaboration diagram for ucommon::shared_pointer< T >:
Collaboration graph
[legend]

Public Member Functions

const T * dup (void)
 Acquire a shared (duplocate) reference to the typed singleton object. More...
 
T * operator* ()
 Access shared lock typed singleton object by pointer reference. More...
 
void operator= (T *object)
 Replace existing typed singleton object through assignment. More...
 
void replace (T *object)
 Replace existing typed singleton instance with new one. More...
 
 shared_pointer ()
 Created shared locking for typed singleton pointer.
 

Additional Inherited Members

- Protected Member Functions inherited from ucommon::SharedPointer
void replace (SharedObject *object)
 Replace existing singleton instance with new one. More...
 
SharedObjectshare (void)
 Acquire a shared reference to the singleton object. More...
 
 SharedPointer ()
 Created shared locking for pointer. More...
 
 ~SharedPointer ()
 Destroy lock and release any blocked threads.
 
- Protected Member Functions inherited from ucommon::ConditionalAccess
void broadcast (void)
 Signal the conditional to release all broadcast threads.
 
void lock (void)
 Lock the conditional's supporting mutex.
 
void signal (void)
 Signal the conditional to release one signalled thread.
 
void unlock (void)
 Unlock the conditional's supporting mutex.
 
bool waitBroadcast (timeout_t timeout)
 Conditional wait for broadcast on millisecond timeout. More...
 
bool waitBroadcast (struct timespec *timeout)
 Conditional wait for broadcast on timespec timeout. More...
 
void waitBroadcast (void)
 Wait (block) until broadcast.
 
bool waitSignal (timeout_t timeout)
 Conditional wait for signal on millisecond timeout. More...
 
bool waitSignal (struct timespec *timeout)
 Conditional wait for signal on timespec timeout. More...
 
void waitSignal (void)
 Wait (block) until signalled.
 
void access (void)
 Access mode shared thread scheduling.
 
void commit (void)
 Complete exclusive mode write scheduling.
 
 ConditionalAccess ()
 Initialize and construct conditional.
 
void limit_sharing (unsigned max)
 Specify a maximum sharing (access) limit. More...
 
void modify (void)
 Exclusive mode write thread scheduling.
 
void release (void)
 Release access mode read scheduling.
 
 ~ConditionalAccess ()
 Destroy conditional, release any blocked threads.
 
- Static Protected Member Functions inherited from ucommon::ConditionalAccess
static void set (struct timespec *hires, timeout_t timeout)
 Convert a millisecond timeout into use for high resolution conditional timers. More...
 
- Protected Attributes inherited from ucommon::ConditionalAccess
pthread_cond_t bcast
 
unsigned pending
 
unsigned sharing
 
unsigned waiting
 

Detailed Description

template<class T>
class ucommon::shared_pointer< T >

Templated shared pointer for singleton shared objects of specific type.

This is used as typed template for the SharedPointer object reference management class. This is used to supply a typed singleton shared instance to the typed shared_instance template class.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 1645 of file thread.h.

Member Function Documentation

template<class T>
const T* ucommon::shared_pointer< T >::dup ( void  )
inline

Acquire a shared (duplocate) reference to the typed singleton object.

This is a form of shared access lock. Derived classes and templates access conditionallock "release" when the shared pointer is no longer needed.

Returns
typed shared object.

Definition at line 1660 of file thread.h.

Here is the call graph for this function:

template<class T>
T* ucommon::shared_pointer< T >::operator* ( )
inline

Access shared lock typed singleton object by pointer reference.

Returns
typed shared object.

Definition at line 1683 of file thread.h.

Here is the call graph for this function:

template<class T>
void ucommon::shared_pointer< T >::operator= ( T *  object)
inline

Replace existing typed singleton object through assignment.

Parameters
objectto assign.

Definition at line 1676 of file thread.h.

Here is the call graph for this function:

template<class T>
void ucommon::shared_pointer< T >::replace ( T *  object)
inline

Replace existing typed singleton instance with new one.

This happens during exclusive locking, and the commit method of the typed object will be called.

Parameters
objectbeing set.

Definition at line 1669 of file thread.h.

Here is the call graph for this function:


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