Container data types to store a collection of other objects.
SContainer is an abstract container object from which all other container objects must inherit.
An abstract data type which is a collections of other objects.
All containers inherit from this object.
The container class structure.
All containers classes inherit from this class.
SIterator provides an interface for iteration over the objects stored in a container. Specific container implementations must implement the SIteratorClass functions.
Also see SList Iteration Example.
An abstract iterator for container data types.
All container iterators inherit from this object.
The iterator class structure.
All container iterators classes inherit from this class.
Return the given SContainer child class object as a container object.
Parameters: |
|
---|---|
Return: | Given object as SContainer* type. |
Note: | This casting is not safety checked. |
Call the given function method of the given SContainer.
Parameters: |
|
---|---|
Note: | This casting is not safety checked. Example usage: S_CONTAINER_CALL(self, func)(param1, param2, ..., paramN);
|
Return the given SIterator child class object as an iterator object.
Parameters: |
|
---|---|
Return: | Given object as SIterator* type. |
Note: | This casting is not safety checked. |
Get an iterator to the given SContainer object.
If SPCT_DO_SAFE_CAST is defined then the given object, will be safely cast to SContainer and, if successful, SContainerGetIterator called. Otherwise this is just a wrapper with an unsafe cast to SContainerGetIterator.
Parameters: |
|
---|---|
Return: | SIterator to SELF. |
Note: | Of course SELF must be a child type of SObject, or else the behaviour will be undefined. |
See also SPCT_DO_SAFE_CAST
Get an iterator that points to the first object of the container.
If the container is empty then NULL is returned.
Parameters: |
|
---|---|
Return: | Iterator that points to first object in container or NULL if the container is empty. |
See also: |
Return an iterator to the next object of the container associated with the given iterator.
Parameters: |
|
---|---|
Return: | Iterator to the next object of the container. If there are no more objects in the container, the iterator will be deleted and NULL will be returned. |
Note: | If an error occurred, then the iterator self will be deleted, the error will be logged and NULL will be returned. |
Return the key that is pointed to by the iterator.
This is only useful for mapping type containers (e.g. Map) and will return NULL for any other type of container.
Parameters: |
|
---|---|
Return: | The key pointed to by the iterator. |
Return the object that is pointed to by the iterator.
Parameters: |
|
---|---|
Return: | The object pointed to by the iterator. This object can be anything and depends on the specific container iterator implementation. |
Note: | The returned object should not be deleted. |
Unlink the object from the container, and return it.
Parameters: |
|
---|---|
Return: | The unlinked object pointed to by the iterator. This object can be anything and depends on the specific container iterator implementation. |
Note: | The iterator is still valid, but does not point to any objects in the container. The caller is responsible for the memory of the returned object. |