Changeset 3392 in Sophya for trunk/SophyaLib/HiStats/datatable.cc


Ignore:
Timestamp:
Nov 22, 2007, 7:25:40 PM (18 years ago)
Author:
ansari
Message:

Implementation NTuple::Fill(), BaseDataTable:;AddRow()/GetRow() thread-safe - Reza 22/11/2007

File:
1 edited

Legend:

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

    r2849 r3392  
    11#include "datatable.h"
    2 #include "sopnamsp.h"
    32#include "strutil.h"
    43#include "pexceptions.h"
    54#include "fiosegdb.h"
    6 
     5#include "thsafeop.h"
     6
     7namespace SOPHYA {
    78
    89/*!
    9    \class SOPHYA::DataTable
     10   \class DataTable
    1011   \ingroup HiStats
    1112   This class can be used to organize data in table (row-column) form.
     
    6162  The copy constructur shares the data if \b share=true.
    6263  Otherwise, the Clone() method is called to make a complete copy.
     64  This constructor copies also the thread safety state from \b a .
    6365*/
    6466DataTable::DataTable(DataTable const & a, bool share)
     
    7173  if (a.mInfo)  mInfo = new DVList(*(a.mInfo));
    7274}
    73 //! Copy the table structure from \b a and shares the data (columns content)
     75/*!
     76  Copy the table structure from \b a and shares the data (columns content).
     77  The tread-safety state is copied from \b a .
     78*/
    7479void DataTable::Share(DataTable const & a)
    7580{
    7681  // On copie la structure de table
    7782  CopyStructure(a);
     83  if (a.IsThreadSafe())  SetThreadSafe(true);
     84  else SetThreadSafe(false);
    7885  // Et on partage les donnees des colonnes
    7986  for (size_t kk=0; kk<mNames.size(); kk++) {
     
    115122  // On copie la structure de table
    116123  CopyStructure(a);
    117   // Et on partage les donnees des colonnes
     124  if (a.IsThreadSafe())  SetThreadSafe(true);
     125  else SetThreadSafe(false);
     126  // Et on copie les donnees des colonnes
    118127  for (size_t kk=0; kk<mNames.size(); kk++) {
    119128    sa_size_t sk = mNames[kk].ser;
     
    161170  if (mInfo) delete mInfo;
    162171  mInfo = NULL;
     172  if (mThS) delete mThS;
     173  mThS = NULL;
    163174  mMin.clear();
    164175  mMax.clear();
     
    278289}
    279290
     291} // FIN namespace SOPHYA
Note: See TracChangeset for help on using the changeset viewer.