[Asterisk-code-review] sorcery.c: Sorcery enhancements for wizard management (...asterisk[13])
George Joseph
asteriskteam at digium.com
Mon Mar 18 08:47:42 CDT 2019
Hello Kevin Harwell, Friendly Automation, Joshua Colp,
I'd like you to reexamine a change. Please visit
https://gerrit.asterisk.org/c/asterisk/+/11154
to look at the new patch set (#4).
Change subject: sorcery.c: Sorcery enhancements for wizard management
......................................................................
sorcery.c: Sorcery enhancements for wizard management
Added ability to specifiy a wizard is read-only when applying
it to a specific object type. This allows you to specify
create, update and delete callbacks for the wizard but limit
which object types can use them.
Added the ability to allow an object type to have multiple
wizards of the same type. This is indicated when a wizard
is added to a specific object type.
Added 3 new sorcery wizard functions:
* ast_sorcery_object_type_insert_wizard which does the same thing
as the existing ast_sorcery_insert_wizard_mapping function but
accepts the new read-only and allot-duplicates flags and also
returns the ast_sorcery_wizard structure used and it's internal
data structure. This allows immediate use of the wizard's
callbacks without having to register a "wizard mapped" observer.
* ast_sorcery_object_type_apply_wizard which does the same
thing as the existing ast_sorcery_apply_wizard_mapping function
but has the added capabilities of
ast_sorcery_object_type_insert_wizard.
* ast_sorcery_object_type_remove_wizard which removes a wizard
matching both its name and its original argument string.
* The original logic in __ast_sorcery_insert_wizard_mapping was moved
to __ast_sorcery_object_type_insert_wizard and enhanced for the
new capabilities, then __ast_sorcery_insert_wizard_mapping was
refactored to just call __ast_sorcery_insert_wizard_mapping.
* Added a unit test to test_sorcery.c to test the read-only
capability.
Change-Id: I40f35840252e4313d99e11dbd80e270a3aa10605
---
M include/asterisk/sorcery.h
M main/sorcery.c
M tests/test_sorcery.c
3 files changed, 337 insertions(+), 28 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/54/11154/4
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11154
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I40f35840252e4313d99e11dbd80e270a3aa10605
Gerrit-Change-Number: 11154
Gerrit-PatchSet: 4
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190318/5ea7db24/attachment.html>
More information about the asterisk-code-review
mailing list