ao2_iterator Struct Reference
You are not supposed to know the internals of an iterator! We would like the iterator to be opaque, unfortunately its size needs to be known if we want to store it around without too much trouble. Anyways... The iterator has a pointer to the container, and a flags field specifying various things e.g. whether the container should be locked or not while navigating on it. The iterator "points" to the current object, which is identified by three values:
- a bucket number;
- the object_id, which is also the container version number when the object was inserted. This identifies the object uniquely, however reaching the desired object requires scanning a list.
- a pointer, and a container version when we saved the pointer. If the container has not changed its version number, then we can safely follow the pointer to reach the object in constant time. Details are in the implementation of ao2_iterator_next() A freshly-initialized iterator has bucket=0, version=0.
Definition at line 555 of file astobj2.h.
The documentation for this struct was generated from the following file: