ROOT logo
// $Id: Operator.h 2456 2010-10-17 18:31:40Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#ifndef Gled_Operator_H
#define Gled_Operator_H

#include <Glasses/ZList.h>
#include <Gled/GMutex.h>
#include <Gled/GCondition.h>
#include <Gled/GTime.h>
class Eventor;

class Operator : public ZList
{
public:
  struct Arg
  {
    Eventor*	fEventor;

    bool	fMultix;
    bool	fSignalSafe;
    bool	fContinuous;
    bool	fUseDynCast;

    GCondition	fSuspendidor;	// Suspender for *not* signal-safe evtors
    GMutex	fSignalodor;	// Lock for signal-safe evtors

    GTime	fStart,     fStop;
    GTime	fBeatStart, fBeatStop;
    GTime	fBeatSum;

    Int_t	fBeatID;

    // could have execution stack ??

    Arg() {}
    virtual ~Arg() {}
  };

  enum Exc_e { OE_Done, OE_Continue, OE_Wait, OE_Stop, OE_Break };

  struct Exception : public Exc_t {
    Operator*	fSource;
    Exc_e	fExc;

    Exception(Operator* o, Exc_e e, const TString& m) :
      Exc_t(m), fSource(o), fExc(e) {}
    Exception(Operator* o, Exc_e e, const char* m) :
      Exc_t(m), fSource(o), fExc(e) {}
    virtual ~Exception() throw() {}
  };

private:
  void _init();

protected:
  Bool_t	bOpActive;	//  X{GS} 7 Bool(-join=>1)
  Bool_t	bOpRecurse;	//  X{GS} 7 Bool()

public:
  Operator(const Text_t* n="Operator", const Text_t* t=0) :
    ZList(n,t) { _init(); }

  // virtuals
  virtual void ResetRecursively();

  virtual void PreOperate(Operator::Arg* op_arg);
  virtual void Operate(Operator::Arg* op_arg);
  virtual void PostOperate(Operator::Arg* op_arg);

#include "Operator.h7"
  ClassDef(Operator, 1);
}; // endclass Operator

#endif
 Operator.h:1
 Operator.h:2
 Operator.h:3
 Operator.h:4
 Operator.h:5
 Operator.h:6
 Operator.h:7
 Operator.h:8
 Operator.h:9
 Operator.h:10
 Operator.h:11
 Operator.h:12
 Operator.h:13
 Operator.h:14
 Operator.h:15
 Operator.h:16
 Operator.h:17
 Operator.h:18
 Operator.h:19
 Operator.h:20
 Operator.h:21
 Operator.h:22
 Operator.h:23
 Operator.h:24
 Operator.h:25
 Operator.h:26
 Operator.h:27
 Operator.h:28
 Operator.h:29
 Operator.h:30
 Operator.h:31
 Operator.h:32
 Operator.h:33
 Operator.h:34
 Operator.h:35
 Operator.h:36
 Operator.h:37
 Operator.h:38
 Operator.h:39
 Operator.h:40
 Operator.h:41
 Operator.h:42
 Operator.h:43
 Operator.h:44
 Operator.h:45
 Operator.h:46
 Operator.h:47
 Operator.h:48
 Operator.h:49
 Operator.h:50
 Operator.h:51
 Operator.h:52
 Operator.h:53
 Operator.h:54
 Operator.h:55
 Operator.h:56
 Operator.h:57
 Operator.h:58
 Operator.h:59
 Operator.h:60
 Operator.h:61
 Operator.h:62
 Operator.h:63
 Operator.h:64
 Operator.h:65
 Operator.h:66
 Operator.h:67
 Operator.h:68
 Operator.h:69
 Operator.h:70
 Operator.h:71
 Operator.h:72
 Operator.h:73
 Operator.h:74
 Operator.h:75
 Operator.h:76
 Operator.h:77
 Operator.h:78