mcr_IRegistry Register mcr_Interface instances as id, names, and a reference.
More...
Go to the source code of this file.
|
| MCR_API int | mcr_register (struct mcr_IRegistry *iRegPt, struct mcr_Interface *interfacePt, const char *name, const char *const *addNames, size_t addNamesCount) |
| |
| MCR_API void | mcr_unregister (struct mcr_IRegistry *iRegPt, struct mcr_Interface *interfacePt) |
| |
| MCR_API void | mcr_IRegistry_init (struct mcr_IRegistry *iRegPt) |
| |
| MCR_API void | mcr_IRegistry_deinit (struct mcr_IRegistry *iRegPt) |
| |
|
MCR_API size_t | mcr_IRegistry_id (const struct mcr_IRegistry *iRegPt, struct mcr_Interface *interfacePt) |
| |
| MCR_API struct mcr_Interface * | mcr_IRegistry_from_id (const struct mcr_IRegistry *iRegPt, size_t typeId) |
| |
|
MCR_API const char * | mcr_IRegistry_name (const struct mcr_IRegistry *iRegPt, struct mcr_Interface *interfacePt) |
| |
| MCR_API struct mcr_Interface * | mcr_IRegistry_from_name (const struct mcr_IRegistry *iRegPt, const char *name) |
| |
| MCR_API const char * | mcr_IRegistry_id_name (const struct mcr_IRegistry *iRegPt, size_t id) |
| |
| MCR_API size_t | mcr_IRegistry_name_id (const struct mcr_IRegistry *iRegPt, const char *name) |
| |
| MCR_API int | mcr_IRegistry_set_name (struct mcr_IRegistry *iRegPt, struct mcr_Interface *interfacePt, const char *name) |
| |
| MCR_API int | mcr_IRegistry_add_name (struct mcr_IRegistry *iRegPt, struct mcr_Interface *interfacePt, const char *name) |
| |
| MCR_API int | mcr_IRegistry_add_names (struct mcr_IRegistry *iRegPt, struct mcr_Interface *interfacePt, const char *const *addNames, size_t addNamesCount) |
| |
| MCR_API size_t | mcr_IRegistry_count (const struct mcr_IRegistry *iRegPt) |
| |
| MCR_API void | mcr_IRegistry_trim (struct mcr_IRegistry *iRegPt) |
| |
| MCR_API void | mcr_IRegistry_clear (struct mcr_IRegistry *iRegPt) |
| |
mcr_IRegistry Register mcr_Interface instances as id, names, and a reference.
Definition in file iregistry.h.
§ mcr_IRegistry_add_name()
Add a mapping from name to interface.
- Parameters
-
| interfacePt | Interface to map to |
| name | opt Name to map from |
- Returns
- reterr
§ mcr_IRegistry_add_names()
| MCR_API int mcr_IRegistry_add_names |
( |
struct mcr_IRegistry * |
iRegPt, |
|
|
struct mcr_Interface * |
interfacePt, |
|
|
const char *const * |
addNames, |
|
|
size_t |
addNamesCount |
|
) |
| |
mcr_reg_add_name for all given names
- Parameters
-
| interfacePt | Interface to map to |
| names | opt Array of names to map from |
| bufferLen | Number of elements to use in names |
- Returns
- reterr
§ mcr_IRegistry_clear()
| MCR_API void mcr_IRegistry_clear |
( |
struct mcr_IRegistry * |
iRegPt | ) |
|
Remove all registered interfaces.
§ mcr_IRegistry_count()
| MCR_API size_t mcr_IRegistry_count |
( |
const struct mcr_IRegistry * |
iRegPt | ) |
|
Get the number of registered interfaces.
- Parameters
-
- Returns
- retind
§ mcr_IRegistry_deinit()
| MCR_API void mcr_IRegistry_deinit |
( |
struct mcr_IRegistry * |
iRegPt | ) |
|
§ mcr_IRegistry_from_id()
Get a reference to the interface of the same id.
- Parameters
-
| iRegPt | opt |
| typeId | Id of interface |
- Returns
- Interface of given id, or null if not found
§ mcr_IRegistry_from_name()
Get a reference to the interface from its registered name.
- Parameters
-
| iRegPt | opt |
| typeName | opt Name of interface |
- Returns
- Interface of given name, or null if not found
§ mcr_IRegistry_id_name()
| MCR_API const char* mcr_IRegistry_id_name |
( |
const struct mcr_IRegistry * |
iRegPt, |
|
|
size_t |
id |
|
) |
| |
Get the name of the interface of given id, or null if not found.
- Parameters
-
| iRegPt | opt |
| id | Id of the interface |
- Returns
- Name of the interface, or null if not found
§ mcr_IRegistry_init()
§ mcr_IRegistry_name_id()
| MCR_API size_t mcr_IRegistry_name_id |
( |
const struct mcr_IRegistry * |
iRegPt, |
|
|
const char * |
name |
|
) |
| |
Get the id of the interface of given name.
- Parameters
-
| iRegPt | opt |
| name | Name of the interface |
- Returns
- retid
§ mcr_IRegistry_set_name()
Map a name to an interface, and the interface to that name.
- Parameters
-
| interfacePt | opt Interface to map |
| name | opt Name to map |
- Returns
- reterr
§ mcr_IRegistry_trim()
§ mcr_register()
| MCR_API int mcr_register |
( |
struct mcr_IRegistry * |
iRegPt, |
|
|
struct mcr_Interface * |
interfacePt, |
|
|
const char * |
name, |
|
|
const char *const * |
addNames, |
|
|
size_t |
addNamesCount |
|
) |
| |
Register a new interface. The interface id will be set as the next possible id to be registered. If names are provided, also mcr_reg_set_name, mcr_reg_add_names
- Parameters
-
| interfacePt | The new interface to register |
| name | opt Name to map to and from newType |
| addNames | opt Set of additional names to map to newType |
| bufferLen | Number of names to map in addNames, required if addNames is to be used |
- Returns
- reterr
§ mcr_unregister()
Unregister an interface from this registry.
Remove all id's, names, and references to the interface.