The PersisentPointer class (See Figure 3.10) represents the unique location in the persistent storage and serves as the identity of the pointed persistent object.
There are three constructors in the class. The default constructor with no parameters generates a null pointer. The constructor with another PersistentPointer object as the parameter copies the arenaID and offset of the object but does not inherit the two grabbing flags. Otherwise, the new object might have one of the grabbing flags set without grabbing operation, which would lead to inconsistencies of operations. The assignment operator = with another PersistentPointer object has the same feature. The constructor with two parameters (arenaID,offset) is not public and used by the PersistentStorage object to generate new pointers through the allocation.
The four public operations - grab(), release(), grabReadOnly(), and releaseReadOnly() - just invoke the corresponding operations in the PersistentStorage object, which is obtained via the static function PersistentStorage::getThePS().
The comparison operators == and != can be used with both another PersistentPointer object and an integer 0. The assignment operator = can also be used with both types.
The accessors function as their names suggest and need no explanation.