next up previous contents index
Next: Using DVList Up: Module SysTools Previous: SOPHYA persistence   Contents   Index

NDataBlock$<$T$>$

\begin{figure}
\framebox [40mm][c]{\mbox{\rule[-1mm]{0mm}{5mm} \bf AnyDataObj} ...
...]{\mbox{\rule[-1mm]{0mm}{5mm} \bf FIO\_NDataBlock$<$T$>$} }\\ [2mm]
\end{figure}

The NDataBlock$<$T$>$ is designed to handle reference counting and sharing of memory blocs (contiguous arrays) for numerical data types. Initialisation, resizing, basic arithmetic operations, as well as persistence handling services are provided. The persistence handler class ( FIO_NDataBlock$<$T$>$) insures that a single copy of data is written for multiply referenced objects, and the data is shared among objects when reading.

The example below shows writing of NDataBlock objects through the use of overloaded operator $ << $ :


#include "fiondblock.h"
// ...
POutPersist pos("aa.ppf");
NDataBlock<r_4> rdb(40);
rdb = 567.89;
pos << rdb;
// We can also use the PutObject method
NDataBlock<int_4> idb(20);
idb = 123;
pos.PutObject(idb);
The following sample programs show the reading of the created PPF file :

PInPersist pis("aa.ppf");
NDataBlock<r_4> rdb;
pis >> rdb;
cout << rdb;
NDataBlock<int_4> idb;
cout << idb;



Reza Ansari
2001-03-07