next up previous contents index
Next: Arena Class Up: Persistent Storage Classes Previous: PersistentStorage Class

PersistentPointer Class

 


  
Figure 3.10: PersistentPointer Class
\begin{figure}
\begin{center}

\includegraphics [scale=1]{PersistentPointer.ps}
\end{center}\end{figure}

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.


next up previous contents index
Next: Arena Class Up: Persistent Storage Classes Previous: PersistentStorage Class
Mori Tetsuya / t2y3141592@gmail.com