![]()  | 
  
    Qore Programming Language 2.2.0
    
   | 
 
This is the implementation of the "Counter" Qore class (private data) More...
#include <QoreCounter.h>
Additional Inherited Members | |
  Public Member Methods inherited from AbstractPrivateData | |
| virtual DLLLOCAL void | deref () | 
| decrements the reference count of the object without the possibility of throwing a Qore-language exception  | |
| virtual DLLLOCAL void | deref (ExceptionSink *xsink) | 
| decrements the reference count of the object   | |
| DLLLOCAL void | ref () const | 
| increments the reference count of the object  | |
  Public Member Methods inherited from QoreReferenceCounter | |
| DLLEXPORT | QoreReferenceCounter () | 
| Creates the reference counter object.  | |
| DLLEXPORT | QoreReferenceCounter (const QoreReferenceCounter &old) | 
| Creates a new object with a reference count of 1.   | |
| DLLEXPORT | ~QoreReferenceCounter () | 
| destroys the reference counter object  | |
| DLLEXPORT bool | is_unique () const | 
| Returns true if the reference count is 1.   | |
| DLLEXPORT bool | optRef () | 
| Make a strong reference only if the object is valid.   | |
| DLLEXPORT int | reference_count () const | 
| Gets the reference count.   | |
| DLLEXPORT bool | ROdereference () const | 
| Atomically decrements the reference count.   | |
| DLLEXPORT void | ROreference () const | 
| Atomically increments the reference count.  | |
  Public Member Methods inherited from QoreCounter | |
| DLLEXPORT | QoreCounter (int nc=0) | 
| creates the counter and initializes the count  | |
| DLLEXPORT | ~QoreCounter () | 
| destroys the object and frees all memory  | |
| DLLEXPORT int | dec (ExceptionSink *xsink) | 
| decrements the counter and wakes up any threads if the counter reaches 0   | |
| DLLEXPORT void | destructor (ExceptionSink *xsink) | 
| throws a Qore-language exception if there are any waiting threads and wakes them all up  | |
| DLLEXPORT int | getCount () const | 
| returns the current count  | |
| DLLEXPORT int | getWaiting () const | 
| returns the number of threads blocked on this object  | |
| DLLEXPORT int | inc () | 
| increments the counter   | |
| DLLEXPORT int | waitForZero (ExceptionSink *xsink, int timeout_ms=0) | 
| blocks the calling thread until the counter reaches 0   | |
  Private Member Methods inherited from AbstractPrivateData | |
| virtual DLLLOCAL | ~AbstractPrivateData () | 
| as these objects are reference counted, the destructor should be called only when the reference count = 0 and not manually  | |
This is the implementation of the "Counter" Qore class (private data)