rtcom-eventlogger/eventlogger-iter.h File Reference

Describes an RTComElIter class. More...

#include <glib-object.h>
#include "rtcom-eventlogger/eventlogger-types.h"
#include "rtcom-eventlogger/eventlogger-attach-iter.h"
#include "rtcom-eventlogger/event.h"

Go to the source code of this file.

Functions

gboolean rtcom_el_iter_first (RTComElIter *it)
gboolean rtcom_el_iter_next (RTComElIter *it)
G_GNUC_DEPRECATED GValueArray * rtcom_el_iter_get_valuearray (RTComElIter *it,...)
GHashTable * rtcom_el_iter_get_value_map (RTComElIter *it,...)
gboolean rtcom_el_iter_get_values (RTComElIter *it,...)
RTComElAttachIter * rtcom_el_iter_get_attachments (RTComElIter *it)
gboolean rtcom_el_iter_get_raw (RTComElIter *it, const gchar *col, GValue *value)
gboolean rtcom_el_iter_get_full (RTComElIter *it, RTComElEvent *ev)
G_GNUC_DEPRECATED gboolean rtcom_el_iter_get (RTComElIter *it, RTComElEvent *ev)
const GHashTable * rtcom_el_iter_get_columns (RTComElIter *it)
gchar * rtcom_el_iter_get_header_raw (RTComElIter *it, const gchar *key)


Detailed Description

Describes an RTComElIter class.

Copyright (C) 2005-06 Nokia Corporation. Contact: Naba Kumar <naba.kumar@nokia.com>

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

An RTComElIter lets you iterate through events.

Definition in file eventlogger-iter.h.


Function Documentation

gboolean rtcom_el_iter_first ( RTComElIter *  it  ) 

Resets the iterator to its first event.

Parameters:
it The RTComElIter.
Returns:
TRUE if success, FALSE if failed.
Examples:
check_el.c.

G_GNUC_DEPRECATED gboolean rtcom_el_iter_get ( RTComElIter *  it,
RTComElEvent *  ev 
)

Deprecated name of rtcom_el_iter_get_full(). Consider using rtcom_el_get_columns() if possible.

RTComElAttachIter* rtcom_el_iter_get_attachments ( RTComElIter *  it  ) 

Returns an iterator to the attachments of the event this iterator points to.

Parameters:
it The iterator for this event.
Returns:
An RTComElAttachIter.
Examples:
check_el.c.

const GHashTable* rtcom_el_iter_get_columns ( RTComElIter *  it  ) 

Gets a GHashTable of (gchar* -> GValue) mapping event fields to their GValues. Both the keys and values are borrowed. Plugins are *not* queried, only the fields directly from the database are returned. This guarantees no additional SQL queries will be done, so it can be used in tight loops.

Parameters:
it The iterator
Returns:
GHashTable with the event fields

gboolean rtcom_el_iter_get_full ( RTComElIter *  it,
RTComElEvent *  ev 
)

Gets a RTComElEvent representing the current iterator. Note: this calls into plugin and can result in additional SQL queries, avoid calling it in tight loops. Consider using rtcom_el_iter_get_columns() where possible.

Parameters:
it The iterator
ev A pointer to the RTComElEvent to populate, which should be zero-filled
Returns:
TRUE in case of success, FALSE in case of failure
Examples:
check_el.c.

gchar* rtcom_el_iter_get_header_raw ( RTComElIter *  it,
const gchar *  key 
)

Gets a raw header value from the db. This function should only be used by plugins.

Parameters:
it The iterator.
key The header's key.
Returns:
The header's value.

gboolean rtcom_el_iter_get_raw ( RTComElIter *  it,
const gchar *  col,
GValue *  value 
)

Gets a raw field from the db. This function should only be used by plugins.

Parameters:
it The iterator.
col The column name.
value A placeholder for the velua.
Returns:
TRUE on success, FALSE on failure.

GHashTable* rtcom_el_iter_get_value_map ( RTComElIter *  it,
  ... 
)

Returns a GHashTable* (or NULL if error) containing all the requested items.

Parameters:
it The RTComElIter
... variable number of strings (NULL terminated) representing requested item names.
Returns:
A GHashTable containing the (gchar * -> GValue) mapping with the requested items. The hashtable is owned by the caller and should destroy when no longer needed.
Examples:
check_el.c.

G_GNUC_DEPRECATED GValueArray* rtcom_el_iter_get_valuearray ( RTComElIter *  it,
  ... 
)

Returns a GValueArray* (or NULL if error), containing all the requested items. E.g.: values = rtcom_el_iter_get_valuearray(it, "local-uid", "channel", NULL); This will put the appropriate values in the GValueArray*. The property name can be anything the appropriate plugin will understand.

Note: This is deprecated function, use rtcom_el_iter_get_value_map() or rtcom_el_iter_get_values() where possible.

Parameters:
it The RTComElIter.
Returns:
A GValueArray.

gboolean rtcom_el_iter_get_values ( RTComElIter *  it,
  ... 
)

Returns the requested item values, similar to g_object_get().

Example: gchar *service; gint event_id; if (rtcom_el_iter_get_values (it, "service", &service, "event-id", &event_id, NULL)) { ...success... }

Parameters:
it The RTComElIter
... variable number of (item name, buffer to store item value reference) pairs. The buffer type must be appropriate for the value extraced (one of gint *, gchar**, gboolean*).
Returns:
TRUE on success, FALSE on failure.
Examples:
check_el.c.

gboolean rtcom_el_iter_next ( RTComElIter *  it  ) 

Advances the iterator to its next event.

Parameters:
it The RTComElIter.
Returns:
FALSE if there’s no next event.
Examples:
check_el.c.


Generated on Thu Jun 17 14:07:13 2010 for rtcom-eventlogger by  doxygen 1.5.6