Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
Typedefs | Functions
missive.h File Reference

A Missive is a status message sent over a broadcast channel inside hicn-light. More...

#include <hicn/messenger/missiveType.h>
Include dependency graph for missive.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef struct missive Missive
 

Functions

Missive * missive_Create (MissiveType missiveType, unsigned connectionid)
 
Missive * missive_Acquire (const Missive *missive)
 
void missive_Release (Missive **missivePtr)
 
MissiveType missive_GetType (const Missive *missive)
 
unsigned missive_GetConnectionId (const Missive *missive)
 

Detailed Description

A Missive is a status message sent over a broadcast channel inside hicn-light.

Recipients use messenger_Register to receive missives. They are broadcast to all recipients.

Function Documentation

◆ missive_Acquire()

Missive* missive_Acquire ( const Missive *  missive)

Acquire a reference counted copy

Increases the reference count by 1 and returns the original object.

Parameters
[in]missiveAn allocated missive
Returns
non-null The original missive with increased reference count

◆ missive_Create()

Missive* missive_Create ( MissiveType  missiveType,
unsigned  connectionid 
)

Creates a Missive and sets the reference count to 1

A Missive may be sent to listeners of the Messenger to inform them of events on a connection id.

Parameters
[in]MissiveTypeThe event type
[in]connectionidThe relevant conneciton id
Returns
non-null A message @retrun null An error

◆ missive_GetConnectionId()

unsigned missive_GetConnectionId ( const Missive *  missive)

Returns the connection ID of the missive

An event is usually associated with a connection id (i.e. the I/O channel that originaged the event).

Parameters
[in]missiveAn allocated missive
Returns
number The relevant connection id.

◆ missive_GetType()

MissiveType missive_GetType ( const Missive *  missive)

Returns the type of the missive

Returns the type of event the missive represents

Parameters
[in]missiveAn allocated missive
Returns
MissiveType The event type

◆ missive_Release()

void missive_Release ( Missive **  missivePtr)

Releases a reference counted copy.

If it is the last reference, the missive is freed.

Parameters
[in,out]missivePtrDouble pointer to a missive, will be nulled.