Top | ![]() |
![]() |
![]() |
![]() |
void * | (*librdf_iterator_map_handler) () |
void | (*librdf_iterator_map_free_context_handler) () |
librdf_iterator * | librdf_new_iterator () |
void | librdf_free_iterator () |
int | librdf_iterator_end () |
int | librdf_iterator_have_elements () |
int | librdf_iterator_next () |
void * | librdf_iterator_get_object () |
void * | librdf_iterator_get_context () |
void * | librdf_iterator_get_key () |
void * | librdf_iterator_get_value () |
int | librdf_iterator_add_map () |
librdf_iterator * | librdf_new_empty_iterator () |
Provides a way to operate across a sequence of objects that are
generated one-by-one on demand. The returned objects can be of any
type but the main public methods are on the librdf_model classs and
return sequence of librdf_node objects such as librdf_model_get_sources()
.
void * (*librdf_iterator_map_handler) (librdf_iterator *iterator
,void *map_context
,void *item
);
Map function for a librdf_iterator map operation.
void
(*librdf_iterator_map_free_context_handler)
(void *map_context
);
Free handler function for a librdf_iterator map operation.
librdf_iterator * librdf_new_iterator (librdf_world *world
,void *context
,int (*is_end_method) (void*)
,int (*next_method) (void*)
,void* (*get_method) (void*, int)
,void (*finished_method) (void*)
);
Constructor - create a new librdf_iterator object.
The iterator object takes ownership of context
and frees it with finished_method
.
The finished method is not called if librdf_new_iterator fails and returns NULL.
world |
redland world object |
|
context |
context to pass to the iterator functions |
|
is_end_method |
function to call to see if the iteration has ended |
|
next_method |
function to get the next element |
|
get_method |
function to get the next element |
|
finished_method |
function to destroy the iterator context (or NULL if not needed) |
void
librdf_free_iterator (librdf_iterator *iterator
);
Destructor - destroy a librdf_iterator object.
int
librdf_iterator_end (librdf_iterator *iterator
);
Test if the iterator has finished.
int
librdf_iterator_have_elements (librdf_iterator *iterator
);
librdf_iterator_have_elements
is deprecated and should not be used in newly-written code.
Test if the iterator has finished.
DEPRECATED - use !librdf_iterator_end(iterator)
int
librdf_iterator_next (librdf_iterator *iterator
);
Move to the next iterator element.
void *
librdf_iterator_get_object (librdf_iterator *iterator
);
Get the current object from the iterator.
This method returns a SHARED pointer to the current iterator object which should be copied by the caller to preserve it if the iterator is moved on librdf_iterator_next or if it should last after the iterator is closed.
void *
librdf_iterator_get_context (librdf_iterator *iterator
);
Get the context of the current object on the iterator.
This method returns a SHARED pointer to the current context node object which should be copied by the caller to preserve it if the iterator is moved on librdf_iterator_next or if it should last after the iterator is closed.
void *
librdf_iterator_get_key (librdf_iterator *iterator
);
Get the key of the current object on the iterator.
void *
librdf_iterator_get_value (librdf_iterator *iterator
);
Get the value of the current object on the iterator.
int librdf_iterator_add_map (librdf_iterator *iterator
,librdf_iterator_map_handler map_function
,librdf_iterator_map_free_context_handler free_context
,void *map_context
);
Add a librdf_iterator mapping function.
Adds an iterator mapping function which operates over the iterator to select which elements are returned; it will be applied as soon as this method is called.
Several mapping functions can be added and they are applied in the order given
The mapping function should return non 0 to allow the element to be returned.
librdf_iterator *
librdf_new_empty_iterator (librdf_world *world
);
Constructor - create a new librdf_iterator with no content.
Flags for librdf_new_iterator()
get_method function pointer.
get object from iterator - implementing |
||
get context from iterator - implementing |
||
get iterator key object from iterator - implementing |
||
get iterator value from iterator - implementing |