res_sorcery_memory_cache: Add basic module implementation.

This change adds a basic res_sorcery_memory_cache module which implements
configuration option parsing, configuration file parsing for threading,
sorcery interface implementation, and unit tests.

Objects can be added, updated, deleted, and retrieved from the memory
cache. Automatic expiration and stale handling will be added in the
future.

Note that unit tests exist within the module itself in case the
threading done as a result of expiration results in asynchronous
actions (which it likely will). Providing access and a notification
mechanism for an external test module would be complicated and
not worth it.

ASTERISK-25067 #close
Reported by: Matt Jordan

Change-Id: Id8a6a357ef5a83d466f81eee56a67d13eeb118b9
changes/98/498/4
Joshua Colp 10 years ago
parent 44d82b9479
commit f2cc766d81

@ -1279,6 +1279,15 @@ struct ast_sorcery_object_type *ast_sorcery_get_object_type(const struct ast_sor
int ast_sorcery_is_object_field_registered(const struct ast_sorcery_object_type *object_type,
const char *field_name);
/*!
* \brief Get the module that has opened the provided sorcery instance.
*
* \param sorcery The sorcery instance
*
* \return The module
*/
const char *ast_sorcery_get_module(const struct ast_sorcery *sorcery);
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif

@ -2328,3 +2328,8 @@ int ast_sorcery_is_object_field_registered(const struct ast_sorcery_object_type
ao2_cleanup(object_field);
return res;
}
const char *ast_sorcery_get_module(const struct ast_sorcery *sorcery)
{
return sorcery->module_name;
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save