gwenhywfar 5.12.0
request.h File Reference
#include <gwenhywfar/gwenhywfar.h>
#include <gwenhywfar/msg.h>
#include <gwenhywfar/endpoint.h>
#include <gwenhywfar/inherit.h>
#include <gwenhywfar/tree2.h>
#include <gwenhywfar/timestamp.h>
Include dependency graph for request.h:

Go to the source code of this file.

Macros

#define GWEN_MSG_REQUEST_REASON_ABORTED   1
#define GWEN_MSG_REQUEST_REASON_DISCONNECT   3
#define GWEN_MSG_REQUEST_REASON_DONE   0
#define GWEN_MSG_REQUEST_REASON_TIMEOUT   2
#define GWEN_MSG_REQUEST_RESULT_HANDLED   1
#define GWEN_MSG_REQUEST_RESULT_NOT_HANDLED   0
#define GWEN_MSG_REQUEST_STATE_DONE   1
#define GWEN_MSG_REQUEST_STATE_OPEN   0

Typedefs

typedef struct GWEN_MSG_REQUEST GWEN_MSG_REQUEST
typedef void(* GWEN_MSG_REQUEST_ABORT_FN) (GWEN_MSG_REQUEST *rq, int reason)
typedef int(* GWEN_MSG_REQUEST_HANDLERESPONSE_FN) (GWEN_MSG_REQUEST *rq, GWEN_MSG *msg)
typedef void(* GWEN_MSG_REQUEST_SUBREQUESTFINISHED_FN) (GWEN_MSG_REQUEST *rq, GWEN_MSG_REQUEST *subRq, int reason)

Functions

GWENHYWFAR_API void GWEN_MsgRequest_Abort (GWEN_MSG_REQUEST *rq, int reason)
GWENHYWFAR_API void GWEN_MsgRequest_AddMsgToList (GWEN_MSG_REQUEST *rq, GWEN_MSG *msg)
GWENHYWFAR_API void GWEN_MsgRequest_free (GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API const GWEN_TIMESTAMPGWEN_MsgRequest_GetCreatedAt (const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API GWEN_MSG_ENDPOINTGWEN_MsgRequest_GetEndpoint (const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API const GWEN_TIMESTAMPGWEN_MsgRequest_GetExpiresAt (const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API GWEN_MSGGWEN_MsgRequest_GetFirstMsgFromList (const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API GWEN_MSG_LISTGWEN_MsgRequest_GetMsgList (const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API void * GWEN_MsgRequest_GetPrivateData (const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API GWEN_MSGGWEN_MsgRequest_GetRequestMsg (const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API uint32_t GWEN_MsgRequest_GetRequestMsgId (const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API int GWEN_MsgRequest_GetRequestType (const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API int GWEN_MsgRequest_GetResult (const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API int GWEN_MsgRequest_GetState (const GWEN_MSG_REQUEST *rq)
GWENHYWFAR_API int GWEN_MsgRequest_HandleResponse (GWEN_MSG_REQUEST *rq, GWEN_MSG *msg)
GWENHYWFAR_API GWEN_MSG_REQUESTGWEN_MsgRequest_new ()
GWENHYWFAR_API GWEN_MSG_REQUEST_ABORT_FN GWEN_MsgRequest_SetAbortFn (GWEN_MSG_REQUEST *rq, GWEN_MSG_REQUEST_ABORT_FN f)
GWENHYWFAR_API void GWEN_MsgRequest_SetCreatedAt (GWEN_MSG_REQUEST *rq, GWEN_TIMESTAMP *ts)
GWENHYWFAR_API void GWEN_MsgRequest_SetEndpoint (GWEN_MSG_REQUEST *rq, GWEN_MSG_ENDPOINT *ep)
GWENHYWFAR_API void GWEN_MsgRequest_SetExpiresAt (GWEN_MSG_REQUEST *rq, GWEN_TIMESTAMP *ts)
GWENHYWFAR_API GWEN_MSG_REQUEST_HANDLERESPONSE_FN GWEN_MsgRequest_SetHandleResponseFn (GWEN_MSG_REQUEST *rq, GWEN_MSG_REQUEST_HANDLERESPONSE_FN fn)
GWENHYWFAR_API void GWEN_MsgRequest_SetPrivateData (GWEN_MSG_REQUEST *rq, void *p)
GWENHYWFAR_API void GWEN_MsgRequest_SetRequestMsg (GWEN_MSG_REQUEST *rq, GWEN_MSG *msg)
GWENHYWFAR_API void GWEN_MsgRequest_SetRequestMsgId (GWEN_MSG_REQUEST *rq, uint32_t id)
GWENHYWFAR_API void GWEN_MsgRequest_SetRequestType (GWEN_MSG_REQUEST *rq, int t)
GWENHYWFAR_API void GWEN_MsgRequest_SetResult (GWEN_MSG_REQUEST *rq, int result)
GWENHYWFAR_API void GWEN_MsgRequest_SetState (GWEN_MSG_REQUEST *rq, int i)
GWENHYWFAR_API GWEN_MSG_REQUEST_SUBREQUESTFINISHED_FN GWEN_MsgRequest_SetSubRequestFinishedFn (GWEN_MSG_REQUEST *rq, GWEN_MSG_REQUEST_SUBREQUESTFINISHED_FN f)
GWENHYWFAR_API void GWEN_MsgRequest_SetTimestamps (GWEN_MSG_REQUEST *rq, int expiresInSecs)
GWENHYWFAR_API void GWEN_MsgRequest_SubRequestFinished (GWEN_MSG_REQUEST *rq, GWEN_MSG_REQUEST *subRq, int reason)
GWENHYWFAR_API GWEN_MSG_REQUESTGWEN_MsgRequest_Tree2_FindByEndpointAndMsgId (GWEN_MSG_REQUEST *rootRq, GWEN_MSG_ENDPOINT *ep, uint32_t refMsgId)

Macro Definition Documentation

◆ GWEN_MSG_REQUEST_REASON_ABORTED

#define GWEN_MSG_REQUEST_REASON_ABORTED   1

Definition at line 25 of file request.h.

Referenced by GWEN_MsgRequest_Abort().

◆ GWEN_MSG_REQUEST_REASON_DISCONNECT

#define GWEN_MSG_REQUEST_REASON_DISCONNECT   3

Definition at line 27 of file request.h.

◆ GWEN_MSG_REQUEST_REASON_DONE

#define GWEN_MSG_REQUEST_REASON_DONE   0

Definition at line 24 of file request.h.

◆ GWEN_MSG_REQUEST_REASON_TIMEOUT

#define GWEN_MSG_REQUEST_REASON_TIMEOUT   2

Definition at line 26 of file request.h.

◆ GWEN_MSG_REQUEST_RESULT_HANDLED

#define GWEN_MSG_REQUEST_RESULT_HANDLED   1

Definition at line 22 of file request.h.

◆ GWEN_MSG_REQUEST_RESULT_NOT_HANDLED

#define GWEN_MSG_REQUEST_RESULT_NOT_HANDLED   0

Definition at line 21 of file request.h.

Referenced by GWEN_MsgRequest_HandleResponse().

◆ GWEN_MSG_REQUEST_STATE_DONE

#define GWEN_MSG_REQUEST_STATE_DONE   1

Definition at line 30 of file request.h.

Referenced by GWEN_MsgRequest_Abort().

◆ GWEN_MSG_REQUEST_STATE_OPEN

#define GWEN_MSG_REQUEST_STATE_OPEN   0

Definition at line 29 of file request.h.

Typedef Documentation

◆ GWEN_MSG_REQUEST

Definition at line 34 of file request.h.

◆ GWEN_MSG_REQUEST_ABORT_FN

typedef void(* GWEN_MSG_REQUEST_ABORT_FN) (GWEN_MSG_REQUEST *rq, int reason)

Definition at line 41 of file request.h.

◆ GWEN_MSG_REQUEST_HANDLERESPONSE_FN

typedef int(* GWEN_MSG_REQUEST_HANDLERESPONSE_FN) (GWEN_MSG_REQUEST *rq, GWEN_MSG *msg)

Definition at line 39 of file request.h.

◆ GWEN_MSG_REQUEST_SUBREQUESTFINISHED_FN

typedef void(* GWEN_MSG_REQUEST_SUBREQUESTFINISHED_FN) (GWEN_MSG_REQUEST *rq, GWEN_MSG_REQUEST *subRq, int reason)

Definition at line 40 of file request.h.

Function Documentation

◆ GWEN_MsgRequest_Abort()

GWENHYWFAR_API void GWEN_MsgRequest_Abort ( GWEN_MSG_REQUEST * rq,
int reason )

Definition at line 219 of file request.c.

References GWEN_MSG_REQUEST_REASON_ABORTED, GWEN_MSG_REQUEST_STATE_DONE, GWEN_MsgRequest_SetState(), and GWEN_MsgRequest_SubRequestFinished().

Here is the call graph for this function:

◆ GWEN_MsgRequest_AddMsgToList()

GWENHYWFAR_API void GWEN_MsgRequest_AddMsgToList ( GWEN_MSG_REQUEST * rq,
GWEN_MSG * msg )

Definition at line 141 of file request.c.

References GWEN_Msg_List_Add(), GWEN_Msg_List_new(), and NULL.

Here is the call graph for this function:

◆ GWEN_MsgRequest_free()

GWENHYWFAR_API void GWEN_MsgRequest_free ( GWEN_MSG_REQUEST * rq)

Definition at line 42 of file request.c.

References GWEN_FREE_OBJECT, GWEN_INHERIT_FINI, GWEN_Msg_free(), GWEN_Msg_List_free(), GWEN_MsgEndpoint_free(), GWEN_Timestamp_free(), and GWEN_TREE2_FINI.

Here is the call graph for this function:

◆ GWEN_MsgRequest_GetCreatedAt()

GWENHYWFAR_API const GWEN_TIMESTAMP * GWEN_MsgRequest_GetCreatedAt ( const GWEN_MSG_REQUEST * rq)

Definition at line 152 of file request.c.

References NULL.

◆ GWEN_MsgRequest_GetEndpoint()

GWENHYWFAR_API GWEN_MSG_ENDPOINT * GWEN_MsgRequest_GetEndpoint ( const GWEN_MSG_REQUEST * rq)

Definition at line 92 of file request.c.

References NULL.

◆ GWEN_MsgRequest_GetExpiresAt()

GWENHYWFAR_API const GWEN_TIMESTAMP * GWEN_MsgRequest_GetExpiresAt ( const GWEN_MSG_REQUEST * rq)

Definition at line 169 of file request.c.

References NULL.

◆ GWEN_MsgRequest_GetFirstMsgFromList()

GWENHYWFAR_API GWEN_MSG * GWEN_MsgRequest_GetFirstMsgFromList ( const GWEN_MSG_REQUEST * rq)

Definition at line 134 of file request.c.

References GWEN_Msg_List_First(), and NULL.

Here is the call graph for this function:

◆ GWEN_MsgRequest_GetMsgList()

GWENHYWFAR_API GWEN_MSG_LIST * GWEN_MsgRequest_GetMsgList ( const GWEN_MSG_REQUEST * rq)

Definition at line 127 of file request.c.

References NULL.

◆ GWEN_MsgRequest_GetPrivateData()

GWENHYWFAR_API void * GWEN_MsgRequest_GetPrivateData ( const GWEN_MSG_REQUEST * rq)

Definition at line 285 of file request.c.

References NULL.

◆ GWEN_MsgRequest_GetRequestMsg()

GWENHYWFAR_API GWEN_MSG * GWEN_MsgRequest_GetRequestMsg ( const GWEN_MSG_REQUEST * rq)

Definition at line 75 of file request.c.

References NULL.

◆ GWEN_MsgRequest_GetRequestMsgId()

GWENHYWFAR_API uint32_t GWEN_MsgRequest_GetRequestMsgId ( const GWEN_MSG_REQUEST * rq)

Definition at line 112 of file request.c.

◆ GWEN_MsgRequest_GetRequestType()

GWENHYWFAR_API int GWEN_MsgRequest_GetRequestType ( const GWEN_MSG_REQUEST * rq)

Definition at line 60 of file request.c.

◆ GWEN_MsgRequest_GetResult()

GWENHYWFAR_API int GWEN_MsgRequest_GetResult ( const GWEN_MSG_REQUEST * rq)

Definition at line 300 of file request.c.

◆ GWEN_MsgRequest_GetState()

GWENHYWFAR_API int GWEN_MsgRequest_GetState ( const GWEN_MSG_REQUEST * rq)

Definition at line 315 of file request.c.

◆ GWEN_MsgRequest_HandleResponse()

GWENHYWFAR_API int GWEN_MsgRequest_HandleResponse ( GWEN_MSG_REQUEST * rq,
GWEN_MSG * msg )

Definition at line 202 of file request.c.

References GWEN_MSG_REQUEST_RESULT_NOT_HANDLED.

◆ GWEN_MsgRequest_new()

GWENHYWFAR_API GWEN_MSG_REQUEST * GWEN_MsgRequest_new ( )

Definition at line 29 of file request.c.

References GWEN_INHERIT_INIT, GWEN_MsgRequest_new(), GWEN_NEW_OBJECT, and GWEN_TREE2_INIT.

Referenced by GWEN_MsgRequest_new().

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

◆ GWEN_MsgRequest_SetAbortFn()

Definition at line 268 of file request.c.

References NULL.

◆ GWEN_MsgRequest_SetCreatedAt()

GWENHYWFAR_API void GWEN_MsgRequest_SetCreatedAt ( GWEN_MSG_REQUEST * rq,
GWEN_TIMESTAMP * ts )

Definition at line 159 of file request.c.

References GWEN_Timestamp_free().

Here is the call graph for this function:

◆ GWEN_MsgRequest_SetEndpoint()

GWENHYWFAR_API void GWEN_MsgRequest_SetEndpoint ( GWEN_MSG_REQUEST * rq,
GWEN_MSG_ENDPOINT * ep )

Definition at line 99 of file request.c.

References GWEN_MsgEndpoint_Attach(), and GWEN_MsgEndpoint_free().

Here is the call graph for this function:

◆ GWEN_MsgRequest_SetExpiresAt()

GWENHYWFAR_API void GWEN_MsgRequest_SetExpiresAt ( GWEN_MSG_REQUEST * rq,
GWEN_TIMESTAMP * ts )

Definition at line 176 of file request.c.

References GWEN_Timestamp_free().

Here is the call graph for this function:

◆ GWEN_MsgRequest_SetHandleResponseFn()

Definition at line 237 of file request.c.

References NULL.

◆ GWEN_MsgRequest_SetPrivateData()

GWENHYWFAR_API void GWEN_MsgRequest_SetPrivateData ( GWEN_MSG_REQUEST * rq,
void * p )

Definition at line 292 of file request.c.

◆ GWEN_MsgRequest_SetRequestMsg()

GWENHYWFAR_API void GWEN_MsgRequest_SetRequestMsg ( GWEN_MSG_REQUEST * rq,
GWEN_MSG * msg )

Definition at line 82 of file request.c.

References GWEN_Msg_free().

Here is the call graph for this function:

◆ GWEN_MsgRequest_SetRequestMsgId()

GWENHYWFAR_API void GWEN_MsgRequest_SetRequestMsgId ( GWEN_MSG_REQUEST * rq,
uint32_t id )

Definition at line 119 of file request.c.

◆ GWEN_MsgRequest_SetRequestType()

GWENHYWFAR_API void GWEN_MsgRequest_SetRequestType ( GWEN_MSG_REQUEST * rq,
int t )

Definition at line 67 of file request.c.

◆ GWEN_MsgRequest_SetResult()

GWENHYWFAR_API void GWEN_MsgRequest_SetResult ( GWEN_MSG_REQUEST * rq,
int result )

Definition at line 307 of file request.c.

◆ GWEN_MsgRequest_SetState()

GWENHYWFAR_API void GWEN_MsgRequest_SetState ( GWEN_MSG_REQUEST * rq,
int i )

Definition at line 322 of file request.c.

Referenced by GWEN_MsgRequest_Abort().

Here is the caller graph for this function:

◆ GWEN_MsgRequest_SetSubRequestFinishedFn()

Definition at line 252 of file request.c.

References NULL.

◆ GWEN_MsgRequest_SetTimestamps()

GWENHYWFAR_API void GWEN_MsgRequest_SetTimestamps ( GWEN_MSG_REQUEST * rq,
int expiresInSecs )

Definition at line 186 of file request.c.

References GWEN_Timestamp_AddSeconds(), GWEN_Timestamp_dup(), GWEN_Timestamp_free(), and GWEN_Timestamp_NowInLocalTime().

Here is the call graph for this function:

◆ GWEN_MsgRequest_SubRequestFinished()

GWENHYWFAR_API void GWEN_MsgRequest_SubRequestFinished ( GWEN_MSG_REQUEST * rq,
GWEN_MSG_REQUEST * subRq,
int reason )

Definition at line 211 of file request.c.

Referenced by GWEN_MsgRequest_Abort().

Here is the caller graph for this function:

◆ GWEN_MsgRequest_Tree2_FindByEndpointAndMsgId()

GWENHYWFAR_API GWEN_MSG_REQUEST * GWEN_MsgRequest_Tree2_FindByEndpointAndMsgId ( GWEN_MSG_REQUEST * rootRq,
GWEN_MSG_ENDPOINT * ep,
uint32_t refMsgId )

Definition at line 335 of file request.c.

References NULL.