In file ref.hxx:

namespace vos template class ORef

ORef template type to implement handle/body behaviour with reference-counting

Public Methods

void addTail (const TELEMENT& element)
blocks if capacity != Infinite and isFull() is True until another element has been removed
void bind (T* pBody)
Binds the body to this handle
T& getBody ()
Gives access to the handles body
T* getBodyPtr ()
Can be used instead of operator->
int getCapacity ()
returns the max
TELEMENT getHead ()
Removes the front element from the queue and returns it
unsigned getLength ()
returns actual amount of entries in the queue
Boolean isEmpty ()
returns True is getLength() is 0
Boolean isEmpty ()
Returns True is the body is empty (the handle does not point to a valid body)
Boolean isEqualBody (const ORef& handle)
Returns True is handle points to the same body
Boolean isFull ()
if capacity is Infinite, always returns False
Boolean isValid ()
Returns True is the body is "full" (the handle does point to a valid body)
Boolean operator!= (const ORef& handle)
Delegates comparison to the body
T& operator) ()
Just in case you want to call handle()
T& operator* ()
Allows (*handle)
T* operator-> ()
Probably most common used: handle->someBodyOp()
Boolean operator< (const ORef& handle)
Needed to place ORefs into STL collection
ORef & operator= (const ORef& handle)
Overload assignment-operator to implement ref-counting
void operator= (T* pBody)
Same as bind()
Boolean operator== (const ORef& handle)
Delegates comparison to the body
Boolean operator== (const T* pBody)
Returns True is "this" points to pBody
Boolean operator> (const ORef& handle)
Needed to place ORefs into STL collection
OQueue (int capacity= Infinite )
default queue has no length-limitation (capacity= Infinite)
ORef ()
Creates an "empty" reference, use "create()" or assignment/copy-operator to make it a valid reference
ORef (const ORef& handle)
Overload copy-constr
ORef (T* pBody)
Creates a reference which points to pBody
void remove (const TELEMENT& element)
Removes "element" from the queue, if it is found
void removeHead ()
Removes head from queue. If the queue is empty, it will NOT block.
ORef & unbind ()
Unbind the body from this handle
~OQueue ()
removes all elements
~ORef ()
Decreases ref-count of underlying body

Documentation

ORef template type to implement handle/body behaviour with reference-counting. Note that the template-type T MUST implement IReferenceCounter.
OQueue(int capacity= Infinite )
default queue has no length-limitation (capacity= Infinite)

~OQueue()
removes all elements

Boolean isEmpty()
returns True is getLength() is 0

Boolean isFull()
if capacity is Infinite, always returns False

int getCapacity()
returns the max.length of the queue, if capacity is limited, otherwise returns "Infinite"

unsigned getLength()
returns actual amount of entries in the queue

void addTail(const TELEMENT& element)
blocks if capacity != Infinite and isFull() is True until another element has been removed

TELEMENT getHead()
Removes the front element from the queue and returns it. The call blocks if the queue is emty (isEmpty()==True).

void removeHead()
Removes head from queue. If the queue is empty, it will NOT block.

void remove(const TELEMENT& element)
Removes "element" from the queue, if it is found. The call will NOT block, even if the queue is empty or "element" is not found.

ORef()
Creates an "empty" reference, use "create()" or assignment/copy-operator to make it a valid reference

ORef(T* pBody)
Creates a reference which points to pBody. pBodys reference is not changed!. (like create(...)).

ORef(const ORef& handle)
Overload copy-constr. to implement ref-counting. As a result of the following code: ORef h1, h2; h1.create(); h2= h1; h1 and h2 will represent the same body.

~ORef()
Decreases ref-count of underlying body

ORef & operator= (const ORef& handle)
Overload assignment-operator to implement ref-counting. Unbinds this instance from its body (if bound) and bind it to the body represented by the handle.

void bind(T* pBody)
Binds the body to this handle. The "pBody"s reference-count is increased. If you call bind() on an existing body, the old body is unbound before the new one is assigned.

ORef & unbind()
Unbind the body from this handle. Note that for a handle representing a large body, "handle.unbind().bind(new body());" _might_ perform a little bit better than "handle.bind(new body());", since in the second case two large objects exist in memory (the old body and the new body).

void operator= (T* pBody)
Same as bind()

T& operator) ()
Just in case you want to call handle().someBodyOp()...

T& operator* ()
Allows (*handle).someBodyOp().

T* operator->()
Probably most common used: handle->someBodyOp()

T& getBody()
Gives access to the handles body

T* getBodyPtr()
Can be used instead of operator->. I.e. handle->someBodyOp() and handle.getBodyPtr()->someBodyOp() are the same.

Boolean isEmpty()
Returns True is the body is empty (the handle does not point to a valid body)

Boolean isValid()
Returns True is the body is "full" (the handle does point to a valid body)

Boolean isEqualBody(const ORef& handle)
Returns True is handle points to the same body

Boolean operator== (const ORef& handle)
Delegates comparison to the body

Boolean operator!= (const ORef& handle)
Delegates comparison to the body

Boolean operator== (const T* pBody)
Returns True is "this" points to pBody

Boolean operator< (const ORef& handle)
Needed to place ORefs into STL collection. Delegates comparison to the body.

Boolean operator> (const ORef& handle)
Needed to place ORefs into STL collection. Delegates comparison to the body.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de