ROOT logo
// $Id: PipeEventor.h 2088 2008-11-23 20:26:46Z 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 GledCore_PipeEventor_H
#define GledCore_PipeEventor_H

#include <Glasses/Eventor.h>

class PipeEventor : public Eventor {
  MAC_RNR_FRIENDS(PipeEventor);

private:
  void _init();

protected:

  TString	mCommand;	// X{GS} 7 Textor();
  FILE*		mPipe;		//!

  UInt_t	mWaitTimeMS;	// X{GS} 7 Value(-range=>[1,1000000,1,1]);

  GCondition	mSendCond;	//!

  list<TString>	mPending;	//!

  void feed_commands();

public:
  PipeEventor(const Text_t* n="PipeEventor", const Text_t* t=0)
    : Eventor(n,t), mSendCond(GMutex::recursive)
  { _init(); }

  virtual void OnStart(Operator::Arg* op_arg);
  virtual void OnExit(Operator::Arg* op_arg);

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

  void PostCommand(TString& command);	// X{E}
  void ClearPendingCommands();		// X{E}

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


#endif
 PipeEventor.h:1
 PipeEventor.h:2
 PipeEventor.h:3
 PipeEventor.h:4
 PipeEventor.h:5
 PipeEventor.h:6
 PipeEventor.h:7
 PipeEventor.h:8
 PipeEventor.h:9
 PipeEventor.h:10
 PipeEventor.h:11
 PipeEventor.h:12
 PipeEventor.h:13
 PipeEventor.h:14
 PipeEventor.h:15
 PipeEventor.h:16
 PipeEventor.h:17
 PipeEventor.h:18
 PipeEventor.h:19
 PipeEventor.h:20
 PipeEventor.h:21
 PipeEventor.h:22
 PipeEventor.h:23
 PipeEventor.h:24
 PipeEventor.h:25
 PipeEventor.h:26
 PipeEventor.h:27
 PipeEventor.h:28
 PipeEventor.h:29
 PipeEventor.h:30
 PipeEventor.h:31
 PipeEventor.h:32
 PipeEventor.h:33
 PipeEventor.h:34
 PipeEventor.h:35
 PipeEventor.h:36
 PipeEventor.h:37
 PipeEventor.h:38
 PipeEventor.h:39
 PipeEventor.h:40
 PipeEventor.h:41
 PipeEventor.h:42
 PipeEventor.h:43
 PipeEventor.h:44
 PipeEventor.h:45
 PipeEventor.h:46
 PipeEventor.h:47
 PipeEventor.h:48
 PipeEventor.h:49