Ignore:
Timestamp:
Jun 14, 2005, 1:25:05 PM (20 years ago)
Author:
ansari
Message:

MAJ documentation - Reza 14/6/2005

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/HiStats/swppfdtable.cc

    r2699 r2808  
    99   This class can be used to organize data in table (row-column) form.
    1010   Each column holds homogeneous data (same data type), while different
    11    columns can be used for different data types (integer, float, string ...)
     11   columns can be used for different data types
     12   (integer, float, string ...).
     13   A PPF stream is used as swap space. Due to limitations in the current
     14   implementation of PPF streams, read operations (acces to table data) cannot
     15   be performed when a table is being filled.
     16
     17   \warning
     18   - When creating a table, the output PPF stream (POutPersist) must not be closed
     19   (destroyed) before the call to the SwPPFDataTable object.
     20   - It is not possible to make a complete (deep) copy of a table SwPPFDataTable
     21   Copy constructor and equal operator shares the data.
     22   - Although the destructor  DOES NOT save the
     23   table object itself to the memory. You have to use the << operator on the
     24   output PPF stream being used as swap
     25
    1226   \sa SOPHYA::MuTyV
    13    \sa SOPHYA::BaseDataTable
    14    \sa SOPHYA::ObjFileIO<DataTable>
     27   \sa SOPHYA::DataTable
     28   \sa SOPHYA::SwSegDataBlock  SOPHYA::PPFDataSwapper
    1529
    1630   \code
    1731   #include "swppfdtable.h"
    1832   // ...
    19    DataTable dt(64);
     33   {
     34   // ---- Creation of the table
     35   // Create the swap stream
     36   POutPersist so("myswtable.ppf");
     37   SwPPFDataTable dt(so, 64);
     38   // define table columns
    2039   dt.AddFloatColumn("X0_f");
    2140   dt.AddFloatColumn("X1_f");
    2241   dt.AddDoubleColumn("X0X0pX1X1_d");
    23    double x[5];
     42   // Fill the table
     43   MuTyV x[5];
    2444   for(int i=0; i<63; i++) {
    2545     x[0] = (i%9)-4.;  x[1] = (i/9)-3.;  x[2] = x[0]*x[0]+x[1]*x[1];
     
    2848   // Printing table info
    2949   cout << dt ;
    30    // Saving object into a PPF file
    31    POutPersist po("dtable.ppf");
    32    po << dt ;
     50   // Swap out all data and write the table structure to the PPF stream
     51   so << dt ;
     52   // ....
     53   }
     54   {
     55   // ---- Accessing information from a previously created table
     56   SwPPFDataTable dt;
     57   PInPersist si("myswtable.ppf");
     58   si >> dt;
     59   // Printing table info
     60   cout << dt ;   
     61   }
    3362   \endcode
    3463*/
    35 /*! Default constructor with optional specification of block (or segment) size -
    36     NOT intented for general use
    37 */
     64//! Default constructor with optional specification of block (or segment) size
    3865SwPPFDataTable::SwPPFDataTable(sa_size_t segsz)
    3966  : BaseDataTable(segsz),
     
    205232
    206233
     234/*!
     235  Implements the action defined in the BaseDataTable interface.
     236  In the current implementation, throws an exception (ParmError)
     237  if the table contains some data already.
     238*/
    207239sa_size_t SwPPFDataTable::AddColumn(FieldType ft, string const & cnom)
    208240{
     
    271303}
    272304
     305//! Adds a line (or row to the table) with r_8* input data.
     306/*!
     307  The min/max values for each column is updated, in addition
     308  to the actions performed by the base class AddLine()
     309*/
    273310sa_size_t SwPPFDataTable::AddLine(const r_8* data)
    274311{
     
    284321}
    285322
     323//! Adds a line (or row to the table) with input data as an array of MuTyV
     324/*!
     325  The min/max values for each column is updated, in addition
     326  to the actions performed by the base class AddLine()
     327*/
    286328sa_size_t SwPPFDataTable::AddLine(const MuTyV * data)
    287329{
Note: See TracChangeset for help on using the changeset viewer.