Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ast_channel_iterator to use it.

This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the
case where multiple results need to be returned; OBJ_NODATA mode
already was supported). In addition, it converts ast_channel_iterators
(only the targeted versions, not the ones that iterate over all
channels) to use this method.

During this work, I removed the 'ao2_flags' arguments to the
ast_channel_iterator constructor functions; there were no uses of that
argument yet, there is only one possible flag to pass, and it made the
iterators less 'opaque'. If at some point in the future someone really
needs an ast_channel_iterator that does not lock the container, we can
provide constructor(s) for that purpose.

Review: https://reviewboard.asterisk.org/r/379/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kevin P. Fleming
2009-10-21 21:08:47 +00:00
parent 1ebf7767d0
commit cdd1f9e296
12 changed files with 184 additions and 198 deletions

View File

@@ -2210,7 +2210,6 @@ struct ast_channel_iterator *ast_channel_iterator_destroy(struct ast_channel_ite
/*!
* \brief Create a new channel iterator based on extension
*
* \arg ao2_flags astobj2 iterator flags
* \arg exten The extension that channels must be in
* \arg context The context that channels must be in (optional)
*
@@ -2223,13 +2222,11 @@ struct ast_channel_iterator *ast_channel_iterator_destroy(struct ast_channel_ite
*
* \since 1.6.3
*/
struct ast_channel_iterator *ast_channel_iterator_by_exten_new(int ao2_flags, const char *exten,
const char *context);
struct ast_channel_iterator *ast_channel_iterator_by_exten_new(const char *exten, const char *context);
/*!
* \brief Create a new channel iterator based on name
*
* \arg ao2_flags astobj2 iterator flags
* \arg name channel name or channel uniqueid to match
* \arg name_len number of characters in the channel name to match on. This
* would be used to match based on name prefix. If matching on the full
@@ -2244,14 +2241,11 @@ struct ast_channel_iterator *ast_channel_iterator_by_exten_new(int ao2_flags, co
*
* \since 1.6.3
*/
struct ast_channel_iterator *ast_channel_iterator_by_name_new(int ao2_flags, const char *name,
size_t name_len);
struct ast_channel_iterator *ast_channel_iterator_by_name_new(const char *name, size_t name_len);
/*!
* \brief Create a new channel iterator
*
* \arg ao2_flags astobj2 iterator flags
*
* After creating an iterator using this function, the ast_channel_iterator_next()
* function can be used to iterate through all channels that exist.
*
@@ -2260,7 +2254,7 @@ struct ast_channel_iterator *ast_channel_iterator_by_name_new(int ao2_flags, con
*
* \since 1.6.3
*/
struct ast_channel_iterator *ast_channel_iterator_all_new(int ao2_flags);
struct ast_channel_iterator *ast_channel_iterator_all_new(void);
/*!
* \brief Get the next channel for a channel iterator