#include <NumberTree.h>
Public Member Functions | |
| NumberTree (Obj number_tree) | |
| NumberTree (const NumberTree &d) | |
| NumberTree & | operator= (const NumberTree &d) |
| bool | IsValid () |
| NumberTreeIterator | GetIterator (Int32 key) |
| NumberTreeIterator | GetIterator () |
| Obj | GetValue (Int32 key) |
| void | Put (Int32 key, Obj value) |
| void | Erase (Int32 key) |
| void | Erase (DictIterator &pos) |
| Obj | GetSDFObj () const |
Protected Attributes | |
| TRN_NumberTree | mp_obj |
A NumberTree is a common data structure in PDF. See section 3.8.6 'Number Trees' in PDF Reference Manual for more details.
A number tree serves a similar purpose to a dictionary - associating keys and values - but by different means. NumberTrees allow efficient storage of very large association collections (number/Obj* maps). A NumberTree can have many more entries than a SDF/Cos dictionary can.
Sample code:
Definition at line 43 of file NumberTree.h.
| pdftron::SDF::NumberTree::NumberTree | ( | Obj | number_tree | ) |
Create a high level NumberTree wrapper around an existing SDF/Cos NumberTree. This does not copy the object.
| number_tree | SDF/Cos root of the NumberTree object. |
| pdftron::SDF::NumberTree::NumberTree | ( | const NumberTree & | d | ) |
Copy constructor
| void pdftron::SDF::NumberTree::Erase | ( | Int32 | key | ) |
Removes the specified object from the tree. Does nothing if no object with that number exists.
| key | A number representing the key of the entry to be removed. |
| void pdftron::SDF::NumberTree::Erase | ( | DictIterator & | pos | ) |
Removes the NumberTree entry pointed by the iterator.
| pos | dictionary iterator object that points to the NumberTree entry to be removed |
| NumberTreeIterator pdftron::SDF::NumberTree::GetIterator | ( | Int32 | key | ) |
Search for the specified key in the NumberTree.
| key | the number representing the key to be found. |
Sample code: NumberTreeIterator i = dests.Find(5); if (i.HasNext()) { cout << "Key: " << i.GetKey()->GetNumber() << endl; cout << "Value: " << i.GetValue()->GetType() << endl; }
| NumberTreeIterator pdftron::SDF::NumberTree::GetIterator | ( | ) |
Sample code: for (NumberTreeIterator i = dests.GetIterator(); i.HasNext(); i.Next()) cout << "Key: " << i.GetKey().GetNumber() << endl;
| Obj pdftron::SDF::NumberTree::GetSDFObj | ( | ) | const |
| bool pdftron::SDF::NumberTree::IsValid | ( | ) |
| NumberTree& pdftron::SDF::NumberTree::operator= | ( | const NumberTree & | d | ) |
Assignment operator
Puts a new entry in the name tree. If an entry with this number is already in the tree, it is replaced.
| key | A number representing the key of the new entry. |
| value | the value associated with the key. It can be any SDF::Obj. |
|
protected |
Definition at line 138 of file NumberTree.h.