Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
interfaceregistry.c File Reference

Interface instances are published and activated by registering them into a global registry, which is defined here. More...

Go to the source code of this file.

Description

Interface instances are published and activated by registering them into a global registry, which is defined here.

This instances are identified by their name and major version.

Definition in file interfaceregistry.c.

#include "include/logging.h"
#include "lib/error.h"
#include "lib/psplay.h"
#include "lib/safeclib.h"
#include <nobug.h>
#include "common/plugin.h"
#include "common/interfaceregistry.h"

Functions

static int lumiera_interface_cmp_fn (const void *keya, const void *keyb)
 
static const void * lumiera_interface_key_fn (const PSplaynode node)
 
static LumieraInterfacenode lumiera_interfacenode_new (LumieraInterface iface, LumieraPlugin plugin)
 
static void lumiera_interfacenode_delete (LumieraInterfacenode self)
 
void lumiera_interfaceregistry_init (void)
 Initialise the interface registry.
 
void lumiera_interfaceregistry_destroy (void)
 
void lumiera_interfaceregistry_register_interface (LumieraInterface self, LumieraPlugin plugin)
 
void lumiera_interfaceregistry_bulkregister_interfaces (LumieraInterface *self, LumieraPlugin plugin)
 
void lumiera_interfaceregistry_remove_interface (LumieraInterface self)
 
void lumiera_interfaceregistry_bulkremove_interfaces (LumieraInterface *self)
 
LumieraInterfacenode lumiera_interfaceregistry_interfacenode_find (const char *interface, unsigned version, const char *name)
 
LumieraInterface lumiera_interfaceregistry_interface_find (const char *interface, unsigned version, const char *name)
 

Variables

PSplay lumiera_interfaceregistry
 
PSplay lumiera_pluginregistry
 
lumiera_recmutex lumiera_interface_mutex
 

Function Documentation

◆ lumiera_interface_cmp_fn()

static int lumiera_interface_cmp_fn ( const void *  keya,
const void *  keyb 
)
static

Definition at line 229 of file interfaceregistry.c.

Referenced by lumiera_interfaceregistry_init().

+ Here is the caller graph for this function:

◆ lumiera_interface_key_fn()

static const void * lumiera_interface_key_fn ( const PSplaynode  node)
static

Definition at line 256 of file interfaceregistry.c.

Referenced by lumiera_interfaceregistry_init().

+ Here is the caller graph for this function:

◆ lumiera_interfacenode_new()

static LumieraInterfacenode lumiera_interfacenode_new ( LumieraInterface  iface,
LumieraPlugin  plugin 
)
static

Definition at line 46 of file interfaceregistry.c.

References lumiera_malloc(), NULL, and psplaynode_init().

Referenced by lumiera_interfaceregistry_bulkregister_interfaces(), and lumiera_interfaceregistry_register_interface().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lumiera_interfacenode_delete()

static void lumiera_interfacenode_delete ( LumieraInterfacenode  self)
static

Definition at line 63 of file interfaceregistry.c.

References lumiera_free().

Referenced by lumiera_interfaceregistry_bulkremove_interfaces(), and lumiera_interfaceregistry_remove_interface().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lumiera_interfaceregistry_init()

void lumiera_interfaceregistry_init ( void  )

Initialise the interface registry.

Definition at line 76 of file interfaceregistry.c.

References LUMIERA_DIE, lumiera_interface_cmp_fn(), lumiera_interface_init(), lumiera_interface_key_fn(), lumiera_interface_mutex, lumiera_interfaceregistry, lumiera_plugin_cmp_fn(), lumiera_plugin_delete_fn(), lumiera_plugin_key_fn(), lumiera_pluginregistry, lumiera_recmutex_init(), NULL, and psplay_new().

Referenced by CommandUse2_test::check_DispatcherInvocation(), AppState::init(), SessionCommandFunction_test::run(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lumiera_interfaceregistry_destroy()

void lumiera_interfaceregistry_destroy ( void  )

Definition at line 98 of file interfaceregistry.c.

References lumiera_interface_destroy(), lumiera_interface_mutex, lumiera_interfaceregistry, lumiera_pluginregistry, lumiera_recmutex_destroy(), NULL, psplay_delete(), psplay_destroy(), and psplay_nelements().

Referenced by AppState::~AppState(), CommandUse2_test::check_DispatcherInvocation(), SessionCommandFunction_test::run(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lumiera_interfaceregistry_register_interface()

void lumiera_interfaceregistry_register_interface ( LumieraInterface  self,
LumieraPlugin  plugin 
)

Definition at line 119 of file interfaceregistry.c.

References lumiera_interface_mutex, lumiera_interfacenode_new(), lumiera_interfaceregistry, LUMIERA_RECMUTEX_SECTION, and psplay_insert().

Referenced by lumiera::anonymous_namespace{instancehandle.hpp}::register_and_open().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lumiera_interfaceregistry_bulkregister_interfaces()

void lumiera_interfaceregistry_bulkregister_interfaces ( LumieraInterface self,
LumieraPlugin  plugin 
)

Definition at line 133 of file interfaceregistry.c.

References lumiera_interface_mutex, lumiera_interfacenode_new(), lumiera_interfaceregistry, LUMIERA_RECMUTEX_SECTION, and psplay_insert().

Referenced by lumiera_plugin_register(), TEST(), and TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lumiera_interfaceregistry_remove_interface()

void lumiera_interfaceregistry_remove_interface ( LumieraInterface  self)

Definition at line 151 of file interfaceregistry.c.

References lumiera_interface_mutex, lumiera_interfacenode_delete(), lumiera_interfaceregistry, LUMIERA_RECMUTEX_SECTION, psplay_find(), and psplay_remove().

Referenced by InstanceHandle< I, FA >::~InstanceHandle().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lumiera_interfaceregistry_bulkremove_interfaces()

void lumiera_interfaceregistry_bulkremove_interfaces ( LumieraInterface self)

Definition at line 168 of file interfaceregistry.c.

References lumiera_interface_mutex, lumiera_interfacenode_delete(), lumiera_interfaceregistry, LUMIERA_RECMUTEX_SECTION, psplay_find(), and psplay_remove().

Referenced by lumiera_plugin_delete_fn(), and lumiera_plugin_unload().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lumiera_interfaceregistry_interfacenode_find()

LumieraInterfacenode lumiera_interfaceregistry_interfacenode_find ( const char *  interface,
unsigned  version,
const char *  name 
)

Definition at line 202 of file interfaceregistry.c.

References cmp, lumiera_interface::interface, lumiera_interface_mutex, lumiera_interfaceregistry, LUMIERA_RECMUTEX_SECTION, lumiera_interface::name, NULL, psplay_find(), and lumiera_interface::version.

Referenced by lumiera_interface_open(), and lumiera_interfaceregistry_interface_find().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ lumiera_interfaceregistry_interface_find()

LumieraInterface lumiera_interfaceregistry_interface_find ( const char *  interface,
unsigned  version,
const char *  name 
)

Definition at line 222 of file interfaceregistry.c.

References lumiera_interface::interface, lumiera_interfaceregistry_interfacenode_find(), lumiera_interface::name, and lumiera_interface::version.

Referenced by TEST(), and lumiera::anonymous_namespace{instancehandle.hpp}::verify_validity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ lumiera_interfaceregistry

◆ lumiera_pluginregistry

◆ lumiera_interface_mutex