ROOT logo
// $Id: AEVMlSucker.h 2182 2009-04-12 23:11:16Z 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 AliEnViz_AEVMlSucker_H
#define AliEnViz_AEVMlSucker_H

#include <AliEnViz/AEV_NS.h>

#include <Glasses/ZNameMap.h>
#include <Glasses/ZQueen.h>

#include <TPRegexp.h>

class AEVManager;

class TSocket;

class AEVMlSucker : public ZNameMap
{
  MAC_RNR_FRIENDS(AEVMlSucker);

private:
  void _init();

protected:
  ZLink<AEVManager>  mManager; // X{GS} L{a}

  TString    mSuckHost;     // X{GS} 7 Textor()
  Int_t      mSuckPort;     // X{GS} 7 Value()
  Int_t      mFooSleep;     // X{GS} 7 Value(-range=>[0,1e4,1])

  GThread   *mSuckerThread; //!

  TPMERegexp mGlobWordRE;   //!
  TPMERegexp mGlobVarRE;    //!
  TPMERegexp mUScoreRE;     //!

  TString next_word(const TString& s);
  bool    next_var (const TString& s, TString& var, TString& val);
  bool    next_var (const TString& s, TString& var, Float_t& val);

  static void* tl_Suck(AEVMlSucker* s);
  void Suck();

  template<class TT>
  TT* find_lens(const TString& path)
  {
    TT* lens = dynamic_cast<TT*>(mQueen->FindLensByPath(path));
    if (lens == 0)
      throw(Exc_t("Queen doesn't have '") + path + "'.");
    return lens;
  }

  TSocket    *mSock;     //!

public:
  AEVMlSucker(const Text_t* n="AEVMlSucker", const Text_t* t=0) :
    ZNameMap(n,t) { _init(); }
  virtual ~AEVMlSucker() {}

  void StartSucker(); // X{E} 7 MButt()
  void StopSucker();  // X{E} 7 MButt()

  void SendLine(const TString& cmd);

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


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