gwenhywfar 5.14.1
gwensignal.c File Reference
#include "gwensignal_p.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/inherit.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
Include dependency graph for gwensignal.c:

Go to the source code of this file.

Functions

GWEN_SIGNALGWEN_Signal__List2_freeAll_cb (GWEN_SIGNAL *sig, GWEN_UNUSED void *user_data)
GWEN_SIGNALGWEN_Signal__List2_hasSignal_cb (GWEN_SIGNAL *sig, void *user_data)
void GWEN_Signal_Attach (GWEN_SIGNAL *sig)
int GWEN_Signal_Connect (GWEN_SIGNAL *sig, GWEN_SLOT *slot)
int GWEN_Signal_Disconnect (GWEN_SIGNAL *sig, GWEN_SLOT *slot)
int GWEN_Signal_Emit (GWEN_SIGNAL *sig, void *pArg1, void *pArg2, int iArg3, int iArg4)
void GWEN_Signal_free (GWEN_SIGNAL *sig)
GWEN_SIGNALOBJECTGWEN_Signal_GetSignalObject (const GWEN_SIGNAL *sig)
void GWEN_Signal_List2_freeAll (GWEN_SIGNAL_LIST2 *slist)
int GWEN_Signal_List2_HasSignal (GWEN_SIGNAL_LIST2 *slist, GWEN_SIGNAL *sig)
GWEN_SIGNALGWEN_Signal_new (GWEN_SIGNALOBJECT *so, const char *derivedType, const char *name, const char *typeOfArg1, const char *typeOfArg2)
GWEN_SIGNALGWEN_SignalObject__findSignal (const GWEN_SIGNALOBJECT *so, const char *name, uint32_t typeId1, uint32_t typeId2)
GWEN_SLOTGWEN_SignalObject__findSlot (const GWEN_SIGNALOBJECT *so, const char *name, uint32_t typeId1, uint32_t typeId2)
int GWEN_SignalObject_AddSignal (GWEN_SIGNALOBJECT *so, GWEN_SIGNAL *sig)
int GWEN_SignalObject_AddSlot (GWEN_SIGNALOBJECT *so, GWEN_SLOT *slot)
GWEN_SIGNALGWEN_SignalObject_FindSignal (const GWEN_SIGNALOBJECT *so, const char *name, const char *typeOfArg1, const char *typeOfArg2)
GWEN_SLOTGWEN_SignalObject_FindSlot (const GWEN_SIGNALOBJECT *so, const char *name, const char *typeOfArg1, const char *typeOfArg2)
void GWEN_SignalObject_free (GWEN_SIGNALOBJECT *so)
uint32_t GWEN_SignalObject_MkTypeId (const char *typeName)
GWEN_SIGNALOBJECTGWEN_SignalObject_new (void)
void GWEN_SignalObject_RemoveForDerivedType (GWEN_SIGNALOBJECT *so, const char *derivedType)
GWEN_SLOTGWEN_Slot__List2_freeAll_cb (GWEN_SLOT *slot, GWEN_UNUSED void *user_data)
GWEN_SLOTGWEN_Slot__List2_hasSlot_cb (GWEN_SLOT *slot, void *user_data)
void GWEN_Slot_Attach (GWEN_SLOT *slot)
void GWEN_Slot_free (GWEN_SLOT *slot)
GWEN_SIGNALOBJECTGWEN_Slot_GetSignalObject (const GWEN_SLOT *slot)
void GWEN_Slot_List2_freeAll (GWEN_SLOT_LIST2 *slist)
int GWEN_Slot_List2_HasSlot (GWEN_SLOT_LIST2 *slist, GWEN_SLOT *slot)
GWEN_SLOTGWEN_Slot_new (GWEN_SIGNALOBJECT *so, const char *derivedType, const char *name, const char *typeOfArg1, const char *typeOfArg2, GWEN_SLOT_FUNCTION fn, void *userData)

Function Documentation

◆ GWEN_Signal__List2_freeAll_cb()

GWEN_SIGNAL * GWEN_Signal__List2_freeAll_cb ( GWEN_SIGNAL * sig,
GWEN_UNUSED void * user_data )

Definition at line 363 of file gwensignal.c.

References GWEN_Signal_free(), and GWEN_UNUSED.

Referenced by GWEN_Signal_List2_freeAll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Signal__List2_hasSignal_cb()

GWEN_SIGNAL * GWEN_Signal__List2_hasSignal_cb ( GWEN_SIGNAL * sig,
void * user_data )

Definition at line 379 of file gwensignal.c.

Referenced by GWEN_Signal_List2_HasSignal().

Here is the caller graph for this function:

◆ GWEN_Signal_Attach()

void GWEN_Signal_Attach ( GWEN_SIGNAL * sig)

Definition at line 354 of file gwensignal.c.

◆ GWEN_Signal_Connect()

int GWEN_Signal_Connect ( GWEN_SIGNAL * sig,
GWEN_SLOT * slot )

Definition at line 406 of file gwensignal.c.

References DBG_ERROR, GWEN_ERROR_INVALID, GWEN_LOGDOMAIN, GWEN_Signal_List2_HasSignal(), and GWEN_Slot_List2_HasSlot().

Here is the call graph for this function:

◆ GWEN_Signal_Disconnect()

int GWEN_Signal_Disconnect ( GWEN_SIGNAL * sig,
GWEN_SLOT * slot )

Definition at line 446 of file gwensignal.c.

References DBG_ERROR, GWEN_ERROR_INVALID, GWEN_LOGDOMAIN, GWEN_Signal_List2_HasSignal(), and GWEN_Slot_List2_HasSlot().

Here is the call graph for this function:

◆ GWEN_Signal_Emit()

int GWEN_Signal_Emit ( GWEN_SIGNAL * sig,
void * pArg1,
void * pArg2,
int iArg3,
int iArg4 )

This function calls the slot function of all connected slots. If any of the slot functions called returns with code 1 then this function will return 1, too. Otherwise 0 is returned. This means that this function will only return 0 if every called slot function returns 0.

Definition at line 472 of file gwensignal.c.

References DBG_DEBUG, and GWEN_LOGDOMAIN.

◆ GWEN_Signal_free()

void GWEN_Signal_free ( GWEN_SIGNAL * sig)

Definition at line 315 of file gwensignal.c.

References DBG_ERROR, GWEN_FREE_OBJECT, and GWEN_LOGDOMAIN.

Referenced by GWEN_Signal__List2_freeAll_cb(), GWEN_Signal_new(), and GWEN_SignalObject_RemoveForDerivedType().

Here is the caller graph for this function:

◆ GWEN_Signal_GetSignalObject()

GWEN_SIGNALOBJECT * GWEN_Signal_GetSignalObject ( const GWEN_SIGNAL * sig)

Definition at line 398 of file gwensignal.c.

◆ GWEN_Signal_List2_freeAll()

void GWEN_Signal_List2_freeAll ( GWEN_SIGNAL_LIST2 * slist)

Definition at line 371 of file gwensignal.c.

References GWEN_Signal__List2_freeAll_cb().

Referenced by GWEN_SignalObject_free().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Signal_List2_HasSignal()

int GWEN_Signal_List2_HasSignal ( GWEN_SIGNAL_LIST2 * slist,
GWEN_SIGNAL * sig )

Definition at line 388 of file gwensignal.c.

References GWEN_Signal__List2_hasSignal_cb().

Referenced by GWEN_Signal_Connect(), and GWEN_Signal_Disconnect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Signal_new()

GWEN_SIGNAL * GWEN_Signal_new ( GWEN_SIGNALOBJECT * so,
const char * derivedType,
const char * name,
const char * typeOfArg1,
const char * typeOfArg2 )

Definition at line 284 of file gwensignal.c.

References GWEN_NEW_OBJECT, GWEN_Signal_free(), GWEN_SignalObject_AddSignal(), and GWEN_SignalObject_MkTypeId().

Here is the call graph for this function:

◆ GWEN_SignalObject__findSignal()

GWEN_SIGNAL * GWEN_SignalObject__findSignal ( const GWEN_SIGNALOBJECT * so,
const char * name,
uint32_t typeId1,
uint32_t typeId2 )

Definition at line 77 of file gwensignal.c.

Referenced by GWEN_SignalObject_AddSignal(), and GWEN_SignalObject_FindSignal().

Here is the caller graph for this function:

◆ GWEN_SignalObject__findSlot()

GWEN_SLOT * GWEN_SignalObject__findSlot ( const GWEN_SIGNALOBJECT * so,
const char * name,
uint32_t typeId1,
uint32_t typeId2 )

Definition at line 131 of file gwensignal.c.

Referenced by GWEN_SignalObject_AddSlot(), and GWEN_SignalObject_FindSlot().

Here is the caller graph for this function:

◆ GWEN_SignalObject_AddSignal()

int GWEN_SignalObject_AddSignal ( GWEN_SIGNALOBJECT * so,
GWEN_SIGNAL * sig )

Definition at line 185 of file gwensignal.c.

References DBG_ERROR, DBG_INFO, GWEN_ERROR_INVALID, GWEN_LOGDOMAIN, and GWEN_SignalObject__findSignal().

Referenced by GWEN_Signal_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SignalObject_AddSlot()

int GWEN_SignalObject_AddSlot ( GWEN_SIGNALOBJECT * so,
GWEN_SLOT * slot )

Definition at line 204 of file gwensignal.c.

References DBG_ERROR, DBG_INFO, GWEN_ERROR_INVALID, GWEN_LOGDOMAIN, and GWEN_SignalObject__findSlot().

Referenced by GWEN_Slot_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SignalObject_FindSignal()

GWEN_SIGNAL * GWEN_SignalObject_FindSignal ( const GWEN_SIGNALOBJECT * so,
const char * name,
const char * typeOfArg1,
const char * typeOfArg2 )

Definition at line 114 of file gwensignal.c.

References GWEN_SignalObject__findSignal(), and GWEN_SignalObject_MkTypeId().

Here is the call graph for this function:

◆ GWEN_SignalObject_FindSlot()

GWEN_SLOT * GWEN_SignalObject_FindSlot ( const GWEN_SIGNALOBJECT * so,
const char * name,
const char * typeOfArg1,
const char * typeOfArg2 )

Definition at line 168 of file gwensignal.c.

References GWEN_SignalObject__findSlot(), and GWEN_SignalObject_MkTypeId().

Here is the call graph for this function:

◆ GWEN_SignalObject_free()

void GWEN_SignalObject_free ( GWEN_SIGNALOBJECT * so)

Definition at line 59 of file gwensignal.c.

References GWEN_FREE_OBJECT, GWEN_Signal_List2_freeAll(), and GWEN_Slot_List2_freeAll().

Here is the call graph for this function:

◆ GWEN_SignalObject_MkTypeId()

uint32_t GWEN_SignalObject_MkTypeId ( const char * typeName)

Definition at line 70 of file gwensignal.c.

References GWEN_Inherit_MakeId().

Referenced by GWEN_Signal_new(), GWEN_SignalObject_FindSignal(), GWEN_SignalObject_FindSlot(), GWEN_SignalObject_RemoveForDerivedType(), and GWEN_Slot_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SignalObject_new()

GWEN_SIGNALOBJECT * GWEN_SignalObject_new ( void )

Definition at line 46 of file gwensignal.c.

References GWEN_NEW_OBJECT, and GWEN_SignalObject_new().

Referenced by GWEN_SignalObject_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_SignalObject_RemoveForDerivedType()

void GWEN_SignalObject_RemoveForDerivedType ( GWEN_SIGNALOBJECT * so,
const char * derivedType )

This function removes all signals and slots for the given derived type. This function can be used from within the FREEDATA function of the GWEN_INHERIT framework.

Definition at line 222 of file gwensignal.c.

References GWEN_Signal_free(), GWEN_SignalObject_MkTypeId(), and GWEN_Slot_free().

Here is the call graph for this function:

◆ GWEN_Slot__List2_freeAll_cb()

GWEN_SLOT * GWEN_Slot__List2_freeAll_cb ( GWEN_SLOT * slot,
GWEN_UNUSED void * user_data )

Definition at line 592 of file gwensignal.c.

References GWEN_Slot_free(), and GWEN_UNUSED.

Referenced by GWEN_Slot_List2_freeAll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Slot__List2_hasSlot_cb()

GWEN_SLOT * GWEN_Slot__List2_hasSlot_cb ( GWEN_SLOT * slot,
void * user_data )

Definition at line 608 of file gwensignal.c.

Referenced by GWEN_Slot_List2_HasSlot().

Here is the caller graph for this function:

◆ GWEN_Slot_Attach()

void GWEN_Slot_Attach ( GWEN_SLOT * slot)

Definition at line 583 of file gwensignal.c.

◆ GWEN_Slot_free()

void GWEN_Slot_free ( GWEN_SLOT * slot)

Definition at line 547 of file gwensignal.c.

References DBG_ERROR, GWEN_FREE_OBJECT, and GWEN_LOGDOMAIN.

Referenced by GWEN_SignalObject_RemoveForDerivedType(), GWEN_Slot__List2_freeAll_cb(), and GWEN_Slot_new().

Here is the caller graph for this function:

◆ GWEN_Slot_GetSignalObject()

GWEN_SIGNALOBJECT * GWEN_Slot_GetSignalObject ( const GWEN_SLOT * slot)

Definition at line 627 of file gwensignal.c.

◆ GWEN_Slot_List2_freeAll()

void GWEN_Slot_List2_freeAll ( GWEN_SLOT_LIST2 * slist)

Definition at line 600 of file gwensignal.c.

References GWEN_Slot__List2_freeAll_cb().

Referenced by GWEN_SignalObject_free().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Slot_List2_HasSlot()

int GWEN_Slot_List2_HasSlot ( GWEN_SLOT_LIST2 * slist,
GWEN_SLOT * slot )

Definition at line 618 of file gwensignal.c.

References GWEN_Slot__List2_hasSlot_cb().

Referenced by GWEN_Signal_Connect(), and GWEN_Signal_Disconnect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Slot_new()

GWEN_SLOT * GWEN_Slot_new ( GWEN_SIGNALOBJECT * so,
const char * derivedType,
const char * name,
const char * typeOfArg1,
const char * typeOfArg2,
GWEN_SLOT_FUNCTION fn,
void * userData )

Definition at line 513 of file gwensignal.c.

References GWEN_NEW_OBJECT, GWEN_SignalObject_AddSlot(), GWEN_SignalObject_MkTypeId(), and GWEN_Slot_free().

Here is the call graph for this function: