SolarCapture C Bindings User Guide  SF-115721-CD
Issue 3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
sc_subnode_helper Struct Reference

sc_subnode_helper node private state. More...

#include <subnode_helper.h>

Data Fields

void * sh_private
 
struct sc_nodesh_node
 
struct sc_node_linksh_free_link
 
struct sc_node_link ** sh_links
 
struct sc_packet_list sh_backlog
 
uint64_t sh_poll_backlog_ns
 
sc_sh_handle_backlog_fnsh_handle_backlog_fn
 
struct sc_pool * sh_pool
 
sc_sh_handle_end_of_stream_fnsh_handle_end_of_stream_fn
 
int sh_pool_threshold
 
int sh_n_links
 

Related Functions

(Note that these are not member functions.)

typedef void( sc_sh_handle_backlog_fn )(struct sc_subnode_helper *sh)
 Signature of sh_handle_backlog_fn. More...
 
typedef void( sc_sh_handle_end_of_stream_fn )(struct sc_subnode_helper *sh)
 Signature of sh_handle_end_of_stream_fn. More...
 
static struct sc_subnode_helpersc_subnode_helper_from_node (struct sc_node *node)
 Get sc_subnode_helper from sc_node More...
 
void sc_subnode_helper_request_callback (struct sc_subnode_helper *sh)
 Request that sc_subnode_helper calls its backlog handler at a safe time. More...
 

Detailed Description

sc_subnode_helper node private state.

Friends And Related Function Documentation

typedef void( sc_sh_handle_backlog_fn)(struct sc_subnode_helper *sh)
related

Signature of sh_handle_backlog_fn.

Parameters
shThe sc_subnode_helper instance.

The backlog handler is responsible for forwarding packets in the backlog to one of the outgoing links. It is invoked when any of the following events occurs:

  1. The backlog transitions from empty to non-empty and sh_pool (if set) has at least sh_pool_threshold buffers available.
  2. The backlog is non-empty and the pool fill level increases above sh_pool_threshold.
  3. Periodically every sh_backlog_poll_ns (if non-zero) while the backlog is non-empty.
  4. After sc_subnode_helper_request_callback() is called.

The handler is called repeatedly until either the backlog is empty or the length of the backlog remains unmodified across the callback. Note that when the backlog handler is invoked due to timeout or request_callback(), the pool threshold is not considered.

typedef void( sc_sh_handle_end_of_stream_fn)(struct sc_subnode_helper *sh)
related

Signature of sh_handle_end_of_stream_fn.

Parameters
shThe sc_subnode_helper instance.

The end-of-stream handler is invoked when the following conditions are all true:

  1. The node has received the end-of-stream signal.
  2. The backlog is empty.
  3. sh_pool (if set) has at least sh_pool_threshold buffers available.

If this handler is set, it is responsible for propagating end-of-stream to the outgoing links. If no handler is provided, end-of-stream is automatically propagated to all outputs once the backlog is empty.

static struct sc_subnode_helper * sc_subnode_helper_from_node ( struct sc_node node)
related

Get sc_subnode_helper from sc_node

Parameters
nodeNode of type sc_subnode_helper.
Returns
The sc_subnode_helper from the node
void sc_subnode_helper_request_callback ( struct sc_subnode_helper sh)
related

Request that sc_subnode_helper calls its backlog handler at a safe time.

Parameters
shAn sc_subnode_helper instance

Field Documentation

struct sc_packet_list sh_backlog

Unprocessed incoming packets

struct sc_node_link* sh_free_link

A node link for freeing packets (if requested)

sc_sh_handle_backlog_fn* sh_handle_backlog_fn

Handler invoked to process the backlog

sc_sh_handle_end_of_stream_fn* sh_handle_end_of_stream_fn

Handler invoked when end of stream has been signalled and the backlog is empty

struct sc_node_link** sh_links

Outgoing links

int sh_n_links

Number of outgoing links

struct sc_node* sh_node

The node

uint64_t sh_poll_backlog_ns

Interval at which to poll backlog handler when backlog is not empty

struct sc_pool* sh_pool

A packet pool (if requested)

int sh_pool_threshold

Number of buffers that must be available in the pool before calling the backlog handler

void* sh_private

Private state for the user


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