EventConsumer Struct Reference

An EvenetConsumer is a datatype to allow an object to be notified when an AsyncTask has completed running. More...

#include <event_consumer.h>

Public Member Functions

EventConsumerAllocateEventConsumer (void(*consumer_fn)(EventConsumer *consumer_p, struct AsyncTask *task_p))
 Allocate an EventConsumer to receive notification when an AsyncTask completes. More...
 
bool InitEventConsumer (EventConsumer *consumer_p, void(*consumer_fn)(EventConsumer *consumer_p, struct AsyncTask *task_p))
 Initialise an EventConsumer with a given callback function. More...
 
void ClearEventConsumer (EventConsumer *consumer_p)
 Clear an EventConsumer. More...
 
void FreeEventConsumer (EventConsumer *consumer_p)
 Free an EventConsumer. More...
 
void RunEventConsumer (EventConsumer *consumer_p, struct AsyncTask *task_p)
 Fire an EventConsumer's callback function to notify that the given AsyncTask has completed. More...
 

Data Fields

void(* at_consumer_fn )(struct EventConsumer *consumer_p, struct AsyncTask *task_p)
 The callback function to call when an AsyncTask has completed. More...
 

Detailed Description

An EvenetConsumer is a datatype to allow an object to be notified when an AsyncTask has completed running.

Member Function Documentation

◆ AllocateEventConsumer()

EventConsumer * AllocateEventConsumer ( void(*)(EventConsumer *consumer_p, struct AsyncTask *task_p)  consumer_fn)

Allocate an EventConsumer to receive notification when an AsyncTask completes.

Parameters
consumer_fnThe callback function to be called when the AsyncTask completes.
Returns
The newly-allocated EventCustomer or NULL upon error.

◆ InitEventConsumer()

bool InitEventConsumer ( EventConsumer consumer_p,
void(*)(EventConsumer *consumer_p, struct AsyncTask *task_p)  consumer_fn 
)

Initialise an EventConsumer with a given callback function.

Parameters
consumer_pThe EventConsumer to initialise.
consumer_fnThe callback function to be called when the AsyncTask completes.
Returns
true if the EventConsumer was initialiseD successfully, false otherwise.

◆ ClearEventConsumer()

void ClearEventConsumer ( EventConsumer consumer_p)

Clear an EventConsumer.

Parameters
consumer_pThe EventConsumer to clear.

◆ FreeEventConsumer()

void FreeEventConsumer ( EventConsumer consumer_p)

Free an EventConsumer.

Parameters
consumer_pThe EventConsumer to free.

◆ RunEventConsumer()

void RunEventConsumer ( EventConsumer consumer_p,
struct AsyncTask task_p 
)

Fire an EventConsumer's callback function to notify that the given AsyncTask has completed.

Parameters
consumer_pThe EventConsumer whose callback function will be ran.
task_pThe AsyncTask that has completed.

Field Documentation

◆ at_consumer_fn

void(* at_consumer_fn) (struct EventConsumer *consumer_p, struct AsyncTask *task_p)

The callback function to call when an AsyncTask has completed.

Parameters
consumer_pThis EventConsumer.
task_pThe AsyncTask that has finished running.

The documentation for this struct was generated from the following file: