#include <ResultSet.h>

A ResultSet is a list of hash tables, used primarily in the interfaces to the sipdb in-memory databases.
Care should be taken in managing memory - all objects inserted in the set must be dynamically allocated (using new) and should be considered owned by the set; see addValue.
Public Member Functions | |
| ResultSet () | |
| Construct a container for rows. | |
| virtual | ~ResultSet () |
| Destroy a set - implicitly destroys all contents. | |
| int | getSize () const |
| Get the number of rows in the set. | |
| OsStatus | getIndex (const int &index, UtlHashMap &rRecord) const |
| Retrieve the Nth row in a set. | |
| void | addValue (const UtlHashMap &record) |
| Add a row to the set. | |
| void | clear () |
| void | destroyAll () |
| Deletes all objects in the set. | |
Private Member Functions | |
| ResultSet (const ResultSet &rhs) | |
| No copy constructor. | |
| ResultSet | operator= (const ResultSet &rhs) |
| No assignment operator. | |
| ResultSet | ( | ) |
Construct a container for rows.
| ~ResultSet | ( | ) | [virtual] |
Destroy a set - implicitly destroys all contents.
| int getSize | ( | ) | const |
Get the number of rows in the set.
| OsStatus getIndex | ( | const int & | index, | |
| UtlHashMap & | rRecord | |||
| ) | const |
Retrieve the Nth row in a set.
This makes a shallow copy, so the elements in the returned rRecord must not be deleted (the values are still owned by the ResultSet).
| index | the row to return. |
| rRecord | the returned row (must be empty when passed) |
| void addValue | ( | const UtlHashMap & | record | ) |
Add a row to the set.
This makes a shallow copy, so the elements in the record must not be deleted (consider them owned by the ResultSet following the copy).
ResultSet registrations; UtlHashMap regRow; UtlString* uriKey = new UtlString("uri"); UtlString* uriValue = new UtlString(regdata[row].uri); regRow.insertKeyAndValue(uriKey, uriValue); UtlString* callidKey = new UtlString("callid"); UtlString* callidValue = new UtlString(regdata[row].callid); regRow.insertKeyAndValue(callidKey, callidValue); UtlString* contactKey = new UtlString("contact"); UtlString* contactValue = new UtlString(regdata[row].contact); regRow.insertKeyAndValue(contactKey, contactValue); registrations.addValue(regRow);
| void clear | ( | ) |
| void destroyAll | ( | ) | [virtual] |