Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
ServiceMatcher Struct Reference

A datatype used to find any Services that match given criteria. More...

#include <service_matcher.h>

Inheritance diagram for ServiceMatcher:
[legend]
Collaboration diagram for ServiceMatcher:
[legend]

Public Member Functions

ServiceMatcherAllocateServiceMatcher (void)
 Allocate an empty ServiceMatcher. More...
 
ServiceMatcherAllocateResourceServiceMatcher (DataResource *resource_p, Handler *handler_p)
 Allocate a ResourceServiceMatcher. More...
 
ServiceMatcherAllocateOperationNameServiceMatcher (const char *name_s, const char *alias_s)
 Allocate a NameServiceMatcher. More...
 
ServiceMatcherAllocatePluginNameServiceMatcher (const char *plugin_name_s)
 Allocate a PluginNameServiceMatcher. More...
 
ServiceMatcherAllocatePluginOperationNameServiceMatcher (const char *plugin_name_s, const char *service_name_s)
 Allocate a PluginOperationNameServiceMatcher. More...
 
ServiceMatcherAllocateKeywordServiceMatcher (void)
 Allocate a KeywordServiceMatcher. More...
 
GRASSROOTS_SERVICE_MANAGER_LOCAL void InitServiceMatcher (ServiceMatcher *matcher_p, RunServiceMatcherCallback match_fn)
 Initialise a ServiceMatcher. More...
 
bool RunServiceMatcher (ServiceMatcher *matcher_p, Service *service_p)
 Run a ServiceMatcher on a given Service. More...
 
void FreeServiceMatcher (ServiceMatcher *matcher_p)
 Free a ServiceMatcher. More...
 

Data Fields

RunServiceMatcherCallback sm_match_fn
 Callback function to run against a given Service to see if is a match. More...
 
DestroyServiceMatcherCallback sm_destroy_fn
 Callback to call when destroying a custom ServiceMatcher. More...
 

Detailed Description

A datatype used to find any Services that match given criteria.

Member Function Documentation

◆ AllocateServiceMatcher()

ServiceMatcher * AllocateServiceMatcher ( void  )

Allocate an empty ServiceMatcher.

Returns
A newly-allocated ServiceMatcher or NULL upon error.

◆ AllocateResourceServiceMatcher()

ServiceMatcher * AllocateResourceServiceMatcher ( DataResource resource_p,
Handler handler_p 
)

Allocate a ResourceServiceMatcher.

Parameters
resource_pThe Resource to find matching Services for.
handler_pAn optional Handler to open the Resource with. This can be NULL.
Returns
A newly-allocated ServiceMatcher or NULL upon error.

◆ AllocateOperationNameServiceMatcher()

ServiceMatcher * AllocateOperationNameServiceMatcher ( const char *  name_s,
const char *  alias_s 
)

Allocate a NameServiceMatcher.

Parameters
name_sThe name of the Service to match.
Returns
A newly-allocated NameServiceMatcher or NULL upon error.

◆ AllocatePluginNameServiceMatcher()

ServiceMatcher * AllocatePluginNameServiceMatcher ( const char *  plugin_name_s)

Allocate a PluginNameServiceMatcher.

Parameters
plugin_name_sThe name of the Plugin for a Service to match.
Returns
A newly-allocated ServiceMatcher or NULL upon error.

◆ AllocatePluginOperationNameServiceMatcher()

ServiceMatcher * AllocatePluginOperationNameServiceMatcher ( const char *  plugin_name_s,
const char *  service_name_s 
)

Allocate a PluginOperationNameServiceMatcher.

Parameters
plugin_name_sThe name of the Plugin for a Service to match.
service_name_sThe name of the Service to match.
Returns
A newly-allocated ServiceMatcher or NULL upon error.

◆ AllocateKeywordServiceMatcher()

ServiceMatcher * AllocateKeywordServiceMatcher ( void  )

Allocate a KeywordServiceMatcher.

Returns
A newly-allocated ServiceMatcher or NULL upon error.

◆ InitServiceMatcher()

GRASSROOTS_SERVICE_MANAGER_LOCAL void InitServiceMatcher ( ServiceMatcher matcher_p,
RunServiceMatcherCallback  match_fn 
)

Initialise a ServiceMatcher.

Parameters
matcher_pThe ServiceMatcher to initialise.
match_fnThe callback function to use for determining matching Services.

◆ RunServiceMatcher()

bool RunServiceMatcher ( ServiceMatcher matcher_p,
Service service_p 
)

Run a ServiceMatcher on a given Service.

Parameters
matcher_pThe ServiceMatcher to run
service_pThe Service to check.
Returns
true if the Service was a match, false otherwise.

◆ FreeServiceMatcher()

void FreeServiceMatcher ( ServiceMatcher matcher_p)

Free a ServiceMatcher.

Parameters
matcher_pThe ServiceMatcher to free

Field Documentation

◆ sm_match_fn

Callback function to run against a given Service to see if is a match.

See also
RunServiceMatcher

◆ sm_destroy_fn

Callback to call when destroying a custom ServiceMatcher.

Parameters
matcher_pThe ServiceMatcher to destroy.
See also
FreeServiceMatcher

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