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

Abstract class which allow to iterate over object. More...

Inheritance diagram for Iterable:
Object Collection Hashmap List

Public Member Functions

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

Abstract class which allow to iterate over object.

Exceptions
AbstractErrorMUST be subclassed.

Member Function Documentation

void clear ( void *  self)

Remove all items from iterable.

Parameters
selfIterable object.

MUST be implemented in a subclass.

bool contains ( const void *  self,
const void *  object 
)

Check if object is in the collection.

Parameters
objectObject instance (will be unreferenced).void *self, const void *object)
selfIterable object.
objectObject instance.
Returns
TRUE if object is in collection, FALSE otherwise.

MUST be implemented in a subclass.

void * next ( const void *  self,
const void *  iterator 
)
Parameters
selfIterable object.
iteratorIterator object pointing to current item.
Returns
Next item.
Exceptions
NotImplementedErrorMUST be implemented in a subclass.