Add ability to clone ao2 containers.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 28 Feb 2012 00:42:38 +0000 (00:42 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 28 Feb 2012 00:42:38 +0000 (00:42 +0000)
commit50c8557f03a31ade74147998058110c601f30a75
tree10c289a7bd5124b7ea9418f3ce988975228e554e
parentae07610d73c329312bbb393573ac0f0ba4d8853d
Add ability to clone ao2 containers.

Occasionally there is a need to put all objects in one container also into
another container.

Some reasons you might need to do this:

1) You need to reconfigure a container.  You would do this by creating a
new container with the new configuration and ao2_container_dup the old
container into it.  Then replace the old container with the new.  Then
destroy the old container.

2) You need the contents of a container to remain stable while operating
on all of the objects.  You would do this by creating a cloned container
of the original with ao2_container_clone.  The cloned container is a
snapshot of the objects at the time of the cloning.  When done, just
destroy the cloned container.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/astobj2.h
main/astobj2.c
tests/test_astobj2.c