error_info objects, that is, it implements a variable length list of error_info objects.
More...
#include <err_info_list.hxx>


Public Member Functions | |
| void | add (const error_info_list &ei) |
Adds an error_info_list by adding all the individual error_info objects that are contained in the incoming error_info_list. | |
| void | add (const error_info *ei) |
Adds an error_info object to the list if not already there. | |
| void | clear () |
Empties the list by removing all of the error_info_base objects that it contains. | |
| int | count () const |
Returns a count of how many error_info objects are pointed to by the list. | |
| const error_info * | first () const |
Returns a pointer to the first undeleted error_info object and updates the iterator correctly for the next method. | |
| void | init () const |
Initializes the iterator, which is used by the next method, to the beginning of the list. | |
| const error_info * | next () const |
Returns a pointer to an error_info object in list order. | |
| void | remove (const error_info_base *ei) |
Removes an error_info_base object from the list. | |
error_info objects, that is, it implements a variable length list of error_info objects.
Role: The class provides a list mechanism for storing a variable length list of error_info objects. By default, the constructor of error_info_list makes an empty list with no error_info objects in it. The class provides the interface that is necessary to add or remove an error_info object and to traverse through the list to get the error_info objects stored in it.
The correct way of accessing the stored error_info objects is to call error_info_list::init that rewinds the list and then call error_info_list::next to iterate through the list till error_info_list::next returns NULL.
This class takes the ownership of all the error_info objects that are added to it. So any call to error_info_list::add would increment the use count of error_info object that is added given that the error_info object that is being added does not exist in the list already. Similarly, when an error_info object that is stored by the error_info_list is removed from the list, then error_info_list would decrement the use count of the error_info object that is being removed. Since the error_info_list owns all the error_info objects that it stores, it decrements the use count of all the contained error_info objects when the error_info_list::clear is called or the error_info_list is destructed. In general, customers need not worry about the reference counting of error_info stored by error_info_list, unless they want to explicitly call add on the error_info object.
| void error_info_list::add | ( | const error_info_list & | ei | ) |
Adds an error_info_list by adding all the individual error_info objects that are contained in the incoming error_info_list.
| ei | error_info_list to add |
| void error_info_list::add | ( | const error_info * | ei | ) |
| void readonly_error_info_base_list::clear | ( | ) | [inherited] |
Empties the list by removing all of the error_info_base objects that it contains.
| int error_info_list::count | ( | ) | const |
Returns a count of how many error_info objects are pointed to by the list.
Reimplemented from readonly_error_info_base_list.
| const error_info* error_info_list::first | ( | ) | const |
Returns a pointer to the first undeleted error_info object and updates the iterator correctly for the next method.
Reimplemented from readonly_error_info_base_list.
| void readonly_error_info_base_list::init | ( | ) | const [inherited] |
Initializes the iterator, which is used by the next method, to the beginning of the list.
| const error_info* error_info_list::next | ( | ) | const |
Returns a pointer to an error_info object in list order.
Role: It returns the error_info most closely following the one that returned by the last call to next, except that if the last returned value was NULL, then the value of next is undefined. In case next is called after init, then it returns the first entry in the list. If the list is empty, it returns NULL.
Usage: Call init once, then next repeatedly until it returns NULL.
Reimplemented from readonly_error_info_base_list.
| void readonly_error_info_base_list::remove | ( | const error_info_base * | ei | ) | [inherited] |