OODuck  0.5
C Oriented Object framework with duck-typing support
Collection Class Reference

Collection of item. More...

Inheritance diagram for Collection:
Iterable Object

Public Member Functions

void add (void *self, const void *object)
 Add object to collection if not already in it. More...
 
void del (void *self, const void *object)
 Remove item from collection. More...
 
- Public Member Functions inherited from Iterable
bool contains (const void *self, const void *object)
 Check if object is in the collection. More...
 
void clear (void *self)
 Remove all items from iterable. More...
 
void * next (const void *self, const void *iterator)
 
- Public Member Functions inherited from Object
void * ref (void *self)
 Increment object's reference counter. More...
 
void unref (void *self)
 Decrement object's reference counter, if equals 0, delete the object. More...
 
bool equal (const void *self, const void *other)
 Check objects equality. More...
 

Detailed Description

Collection of item.

Member Function Documentation

void add ( void *  self,
const void *  object 
)

Add object to collection if not already in it.

Parameters
selfCollection object.
objectObject instance (will be referenced).

The object will be encapsulated in Item object. Calls Collection::contains().

void del ( void *  self,
const void *  object 
)

Remove item from collection.

Parameters
selfCollection object.
objectObject instance (will be unreferenced).

Does nothing if object is not in the collection.