X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fiattribute.h;h=cbda045f4bba5db151a75c11d99d3de82f01d5c2;hb=ec7a5af61127aa50a1839eee5be99ce53494c57b;hp=11dccd10ad178af57a5228c63071b7c3478347ce;hpb=d8f124de0295aea546b6debf5945bfeea2bbeb2a;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/iattribute.h b/ltt/branches/poly/lttv/lttv/iattribute.h index 11dccd10..cbda045f 100644 --- a/ltt/branches/poly/lttv/lttv/iattribute.h +++ b/ltt/branches/poly/lttv/lttv/iattribute.h @@ -16,6 +16,8 @@ * MA 02111-1307, USA. */ +/* FIXME : unnamed attributes not implemented */ + #ifndef IATTRIBUTE_H #define IATTRIBUTE_H @@ -28,6 +30,13 @@ and access functions over a wide range of structures. The names are represented by unique integer identifiers, GQuarks. */ +/* Please note that adding a value of type gobject that is non null does not + * increment the reference count of this object : the actual reference to + * the object is "given" to the attribute tree. When the gobject value + * is removed, the object is unreferenced. A value copy through + * lttv_iattribute_copy_value does increase the reference count of the + * gobject. */ + typedef GQuark LttvAttributeName; typedef enum _LttvAttributeType { @@ -66,12 +75,14 @@ typedef struct _LttvIAttributeClass LttvIAttributeClass; struct _LttvIAttributeClass { GTypeInterface parent; + LttvIAttribute* (*new_attribute) (LttvIAttribute *self); + unsigned int (*get_number) (LttvIAttribute *self); gboolean (*named) (LttvIAttribute *self, gboolean *homogeneous); LttvAttributeType (*get) (LttvIAttribute *self, unsigned i, - LttvAttributeName *name, LttvAttributeValue *v); + LttvAttributeName *name, LttvAttributeValue *v, gboolean *is_named); LttvAttributeType (*get_by_name) (LttvIAttribute *self, LttvAttributeName name, LttvAttributeValue *v); @@ -79,6 +90,10 @@ struct _LttvIAttributeClass { LttvAttributeValue (*add) (LttvIAttribute *self, LttvAttributeName name, LttvAttributeType t); + LttvAttributeValue (*add_unnamed) (LttvIAttribute *self, + LttvAttributeName name, + LttvAttributeType t); + void (*remove) (LttvIAttribute *self, unsigned i); void (*remove_by_name) (LttvIAttribute *self, @@ -86,6 +101,10 @@ struct _LttvIAttributeClass { LttvIAttribute* (*find_subdir) (LttvIAttribute *self, LttvAttributeName name); + + LttvIAttribute* (*find_subdir_unnamed) (LttvIAttribute *self, + LttvAttributeName name); + }; @@ -106,7 +125,7 @@ gboolean lttv_iattribute_named(LttvIAttribute *self, gboolean *homogeneous); /* Get the i th attribute along with its type and a pointer to its value. */ LttvAttributeType lttv_iattribute_get(LttvIAttribute *self, unsigned i, - LttvAttributeName *name, LttvAttributeValue *v); + LttvAttributeName *name, LttvAttributeValue *v, gboolean *is_named); /* Get the named attribute in the table along with its type and a pointer to @@ -123,7 +142,8 @@ LttvAttributeType lttv_iattribute_get_by_name(LttvIAttribute *self, LttvAttributeValue lttv_iattribute_add(LttvIAttribute *self, LttvAttributeName name, LttvAttributeType t); - +LttvAttributeValue lttv_iattribute_add_unnamed(LttvIAttribute *self, + LttvAttributeName name, LttvAttributeType t); /* Remove an attribute */ void lttv_iattribute_remove(LttvIAttribute *self, unsigned i); @@ -140,6 +160,8 @@ void lttv_iattribute_remove_by_name(LttvIAttribute *self, LttvIAttribute* lttv_iattribute_find_subdir(LttvIAttribute *self, LttvAttributeName name); +LttvIAttribute* lttv_iattribute_find_subdir_unnamed(LttvIAttribute *self, + LttvAttributeName name); /* The remaining utility functions are not part of the LttvIAttribute interface but operate on objects implementing it. */