Changeset 1699 in Sophya for trunk/ArchTOIPipe/Kernel


Ignore:
Timestamp:
Oct 15, 2001, 11:55:09 AM (24 years ago)
Author:
cmv
Message:

intro des toisegmented + constructeur avec char* pour compat cmv 15/10/01

Location:
trunk/ArchTOIPipe/Kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ArchTOIPipe/Kernel/toimanager.cc

    r1687 r1699  
    11#include "toimanager.h"
     2#include <unistd.h>
    23#include <limits.h>
    34#include <pthread.h>
    45#include <iostream.h>
    56
    6 #ifndef MAXINT
    7 #define MAXINT 2147483647
    8 #endif
    9 
    107TOIManager::TOIManager() {
    118  reqBegin = 0;
    12   reqEnd = MAXINT;
     9  reqEnd = LONG_MAX;
    1310}
    1411
     
    2017}
    2118
    22 void TOIManager::setRequestedSample(int begin, int end) {
     19void TOIManager::setRequestedSample(long begin, long end) {
    2320  reqBegin = begin;
    2421  reqEnd   = end;
    2522}
    2623
    27 int TOIManager::getRequestedBegin() {
     24long TOIManager::getRequestedBegin() {
    2825  return reqBegin;
    2926}
    3027
    31 int TOIManager::getRequestedEnd() {
     28long TOIManager::getRequestedEnd() {
    3229  return reqEnd;
    3330}
     
    9693    processed_samples = ProcessedSampleCount();
    9794    if ( (processed_samples-last_sample_count > dns_print) ||
    98         (processed_samples > total_sample_count-10) ) {
     95        (processed_samples > total_sample_count-10) ) {
    9996      last_sample_count = processed_samples;
    10097      if (nb_dns_print == 0) cout << "\n";
    10198      nb_dns_print++;
    10299      cout << ">>> " << _msg << ": ProcessedSampleCount()= " << last_sample_count
    103            << " Frac done = " << processed_samples*100/total_sample_count << " %" << endl;
     100           << " Frac done = " << processed_samples*100/total_sample_count << " %" << endl;
    104101      if (last_sample_count > total_sample_count-10)  alldone = true;
    105102      nb_sleep = 0;
     
    107104    else if ((nb_sleep+1)%5 == 0)
    108105      cout << "> " << _msg << ": ProcSamples()= " <<  processed_samples
    109            << " Done = " << " %" << processed_samples*100/total_sample_count
    110            << " NbSleep(1) = " << nb_sleep << endl;
     106           << " Done = " << " %" << processed_samples*100/total_sample_count
     107           << " NbSleep(1) = " << nb_sleep << endl;
    111108   
    112109    sleep(1);  nb_sleep++;
  • trunk/ArchTOIPipe/Kernel/toimanager.h

    r1687 r1699  
    1212public:
    1313  static TOIManager* getManager();
    14   void setRequestedSample(int begin, int end);
    15   int getRequestedBegin();
    16   int getRequestedEnd();
     14  void setRequestedSample(long begin, long end);
     15  long getRequestedBegin();
     16  long getRequestedEnd();
    1717  void addThread(pthread_t*);
    1818  void joinAll();
     
    2727};
    2828
     29
    2930// -----------------------------------------------------------------
    3031//    Classe pour affichage de l'avancement des TOIProcessors
     
    3435class RzProcSampleCounter {
    3536public:
    36   RzProcSampleCounter();
     37                RzProcSampleCounter();
    3738  virtual       ~RzProcSampleCounter();
    38   virtual long  ProcessedSampleCount() = 0;
     39  virtual long  ProcessedSampleCount() = 0;
    3940  virtual long  PrintStats();
    4041  inline int &  PrintRate(int pr) { return _rate; }
     
    4849class ProcSampleCounter : public RzProcSampleCounter {
    4950public:
    50   ProcSampleCounter(const T & t) { _t = &t; }
    51   virtual long  ProcessedSampleCount()
    52   { return _t->ProcessedSampleCount(); }
     51                ProcSampleCounter(const T & t) { _t = &t; }
     52  virtual long  ProcessedSampleCount()
     53                      { return _t->ProcessedSampleCount(); }
    5354protected:
    5455  const T * _t;
     
    5657
    5758#endif
    58 
  • trunk/ArchTOIPipe/Kernel/toisegment.cc

    r1697 r1699  
    2828
    2929TOISegmented::TOISegmented(string nm, int bufsz, int maxseg) {
     30  master = new MasterView(bufsz, maxseg);
     31  setName(nm);
     32}
     33
     34TOISegmented::TOISegmented(char* cnm, int bufsz, int maxseg) {
     35  string nm = cnm;
    3036  master = new MasterView(bufsz, maxseg);
    3137  setName(nm);
  • trunk/ArchTOIPipe/Kernel/toisegment.h

    r1692 r1699  
    2020  TOISegmented(int bufsz=256, int maxseg=20);
    2121  TOISegmented(string nm, int bufsz=256, int maxseg=20);
     22  TOISegmented(char* cnm, int bufsz=256, int maxseg=20);
    2223  ~TOISegmented();
    2324
Note: See TracChangeset for help on using the changeset viewer.