ROOT logo
// $Id: AEVMlClient.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 AliEnViz_AEVMlClient_H
#define AliEnViz_AEVMlClient_H

#include <Glasses/ZNameMap.h>
#include <Gled/GTime.h>
#include <AliEnViz/AEV_NS.h>

class AEVMlClient : public ZNameMap
{
  MAC_RNR_FRIENDS(AEVMlClient);
  friend class AEVDemoDriver;

public:
  struct MonaEntry
  {
    TString fFarm, fCluster, fNode, fParam, fValue;
    GTime   fTime;
    TString fDateStr;

    virtual ~MonaEntry() {}
    const Text_t* StdFormat();

    ClassDef(MonaEntry, 1);
  };

  struct monaentry_time_lt
  {
    bool operator()(const MonaEntry& a, const MonaEntry& b) const
    { return a.fTime < b.fTime; }
  };

  struct monaentry_time_gt
  {
    bool operator()(const MonaEntry& a, const MonaEntry& b) const
    { return a.fTime > b.fTime; }
  };

  enum SortMode_e { SM_Ascending=-1, SM_None, SM_Descending };

private:
  void _init();
  GMutex  hMonaLock;

protected:
  TString mServer;    // X{GS} 7 Textor()
  TString mFarm;      // X{GS} 7 Textor()
  TString mCluster;   // X{GS} 7 Textor()
  TString mNode;      // X{GS} 7 Textor()
  TString mParam;     // X{GS} 7 Textor()

  Float_t mFromHrs;   // X{GS} 7 Value(-range=>[-1e8,1e8,1,1000], -join=>1)
  Float_t mToHrs;     // X{GS} 7 Value(-range=>[-1e8,1e8,1,1000])

  SortMode_e mFLSort; // X{GS} 7 PhonyEnum()

  Bool_t  bConnected; // X{GS} 7 BoolOut()

  AEV_NS::BiDiPipe mBDP;  //!
  void check_connection(const Exc_t& eh);

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

  void OpenConn();  // X{E} 7 MButt(-join=>1)
  void CloseConn(); // X{E} 7 MButt()

  void GetValues(list<AEVMlClient::MonaEntry>& results);
  void GetFLValues(list<AEVMlClient::MonaEntry>& results);

  void PrintValues();   //! X{Ed} 7 MButt()
  void PrintFLValues(); //! X{Ed} 7 MButt()

  void FindJobs();      //  X{Ed} 7 MButt()
  void FakeFindJobs();  //  X{Ed}

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


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