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

Global registry for interfaces (extension points). More...

Go to the source code of this file.

Description

Global registry for interfaces (extension points).

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.h.

#include "lib/mutex.h"
#include "lib/recmutex.h"
#include "lib/psplay.h"
#include "common/interface.h"
#include "common/plugin.h"
#include <nobug.h>

Typedefs

typedef lumiera_interfacenode * LumieraInterfacenode
 

Classes

struct  lumiera_interfacenode
 Interface management node. More...
 

Functions

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
 
lumiera_recmutex lumiera_interface_mutex
 

Typedef Documentation

◆ LumieraInterfacenode

typedef lumiera_interfacenode* LumieraInterfacenode

Definition at line 45 of file interfaceregistry.h.


Class Documentation

◆ lumiera_interfacenode_struct

struct lumiera_interfacenode_struct
Class Members
psplaynode node all known interfaces are registered in a tree
LumieraInterface interface the interface itself
unsigned refcnt reference counters and link used for internal reference management
LumieraPlugin plugin backreference to its plugin if it comes from a plugin, else NULL
LumieraInterfacenode lnk temporary used to stack interfaces when recursively opening/closing them
size_t deps_size allocated size of the following dependency table
LumieraInterfacenode * deps NULL terminated table of all dependencies (interfaces opened on initialisation)
+ Collaboration diagram for lumiera_interfacenode:

Function Documentation

◆ 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_interface_mutex