ServicesArray Struct Reference

A datatype for having a set of Services. More...

#include <service.h>

Collaboration diagram for ServicesArray:
[legend]

Public Member Functions

void FreeServicesArray (ServicesArray *services_p)
 Free a ServicesArray and each of its Services. More...
 
ServicesArrayAllocateServicesArray (const uint32 num_services)
 Allocate an empty ServicesArray. More...
 
ServicesArrayGetReferenceServicesFromJSON (json_t *config_p, const char *plugin_name_s, Service *(*get_service_fn)(json_t *config_p, size_t i, GrassrootsServer *grassroots_p), GrassrootsServer *grassroots_p)
 Get the ServicesArray generated from a Services reference file. More...
 

Data Fields

Service ** sa_services_pp
 An array of pointers to Services. More...
 
uint32 sa_num_services
 The number of Services in the array. More...
 

Detailed Description

A datatype for having a set of Services.

Examples
long_running_service.c.

Member Function Documentation

◆ FreeServicesArray()

void FreeServicesArray ( ServicesArray services_p)

Free a ServicesArray and each of its Services.

Parameters
services_pThe ServicesArray to free.
Examples
long_running_service.c.

◆ AllocateServicesArray()

ServicesArray * AllocateServicesArray ( const uint32  num_services)

Allocate an empty ServicesArray.

Parameters
num_servicesThe number of potential Services that the ServicesArray will hold.
Returns
A newly-allocated ServicesArray with space for the given number of Services or NULL upon error.
Examples
long_running_service.c.

◆ GetReferenceServicesFromJSON()

ServicesArray * GetReferenceServicesFromJSON ( json_t *  config_p,
const char *  plugin_name_s,
Service *(*)(json_t *config_p, size_t i, GrassrootsServer *grassroots_p)  get_service_fn,
GrassrootsServer grassroots_p 
)

Get the ServicesArray generated from a Services reference file.

Parameters
config_pThe JSON fragment loaded from a referemce file.
plugin_name_sThe name of the Plugin to use.
get_service_fnThe function used to generate each Service that will be placed in the resultant ServicesArray.
Returns
The ServicesArray containing the generated Services or NULL upon error.

Field Documentation

◆ sa_services_pp

Service** sa_services_pp

An array of pointers to Services.

◆ sa_num_services

uint32 sa_num_services

The number of Services in the array.


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