Container classes

Name

Container classes -- 

Synopsis


#include <gts.h>


#define     GTS_CONTAINER_CLASS             (klass)
#define     GTS_CONTAINER                   (obj)
#define     GTS_IS_CONTAINER                (obj)
struct      GtsContainerClass;
struct      GtsContainer;

GtsContainerClass* gts_container_class      (void);
GtsContainer* gts_container_new             (GtsContainerClass *klass);
void        gts_container_add               (GtsContainer *c,
                                             GtsContainee *item);
void        gts_container_remove            (GtsContainer *c,
                                             GtsContainee *item);
guint       gts_container_size              (GtsContainer *c);
void        gts_container_foreach           (GtsContainer *c,
                                             GtsFunc func,
                                             gpointer data);

#define     GTS_HASH_CONTAINER_CLASS        (klass)
#define     GTS_HASH_CONTAINER              (obj)
#define     GTS_IS_HASH_CONTAINER           (obj)
struct      GtsHashContainerClass;
struct      GtsHashContainer;

GtsHashContainerClass* gts_hash_container_class
                                            (void);

#define     GTS_SLIST_CONTAINER_CLASS       (klass)
#define     GTS_SLIST_CONTAINER             (obj)
#define     GTS_IS_SLIST_CONTAINER          (obj)
struct      GtsSListContainerClass;
struct      GtsSListContainer;

GtsSListContainerClass* gts_slist_container_class
                                            (void);

Description

Details

GTS_CONTAINER_CLASS()

#define     GTS_CONTAINER_CLASS(klass)

klass :


GTS_CONTAINER()

#define     GTS_CONTAINER(obj)

obj :


GTS_IS_CONTAINER()

#define     GTS_IS_CONTAINER(obj)

obj :


struct GtsContainerClass

struct GtsContainerClass {

  GtsSListContaineeClass parent_class;

  void  (* add)     (GtsContainer *, GtsContainee *);
  void  (* remove)  (GtsContainer *, GtsContainee *);
  void  (* foreach) (GtsContainer *, GtsFunc, gpointer);
  guint (* size)    (GtsContainer *);
};


struct GtsContainer

struct GtsContainer {

  GtsSListContainee object;
};

The container object.

GtsSListContainee object

The parent object.


gts_container_class ()

GtsContainerClass* gts_container_class      (void);

Returns :


gts_container_new ()

GtsContainer* gts_container_new             (GtsContainerClass *klass);

klass :

Returns :


gts_container_add ()

void        gts_container_add               (GtsContainer *c,
                                             GtsContainee *item);

c :

item :


gts_container_remove ()

void        gts_container_remove            (GtsContainer *c,
                                             GtsContainee *item);

c :

item :


gts_container_size ()

guint       gts_container_size              (GtsContainer *c);

c :

Returns :


gts_container_foreach ()

void        gts_container_foreach           (GtsContainer *c,
                                             GtsFunc func,
                                             gpointer data);

c :

func :

data :


GTS_HASH_CONTAINER_CLASS()

#define     GTS_HASH_CONTAINER_CLASS(klass)

klass :


GTS_HASH_CONTAINER()

#define     GTS_HASH_CONTAINER(obj)

obj :


GTS_IS_HASH_CONTAINER()

#define     GTS_IS_HASH_CONTAINER(obj)

obj :


struct GtsHashContainerClass

struct GtsHashContainerClass {

  GtsContainerClass parent_class;
};


struct GtsHashContainer

struct GtsHashContainer {

  GtsContainer c;

  GHashTable * items;
  gboolean frozen;
};


gts_hash_container_class ()

GtsHashContainerClass* gts_hash_container_class
                                            (void);

Returns :


GTS_SLIST_CONTAINER_CLASS()

#define     GTS_SLIST_CONTAINER_CLASS(klass)

klass :


GTS_SLIST_CONTAINER()

#define     GTS_SLIST_CONTAINER(obj)

obj :


GTS_IS_SLIST_CONTAINER()

#define     GTS_IS_SLIST_CONTAINER(obj)

obj :


struct GtsSListContainerClass

struct GtsSListContainerClass {

  GtsContainerClass parent_class;
};


struct GtsSListContainer

struct GtsSListContainer {

  GtsContainer c;

  GSList * items;
  gboolean frozen;
};


gts_slist_container_class ()

GtsSListContainerClass* gts_slist_container_class
                                            (void);

Returns :