CFEL - ASG Software Suite  2.5.0
CASS
lucassview/tcpclient.h
Go to the documentation of this file.
1 //Copyright (C) 2011 Lutz Foucar
2 
3 /**
4  * @file lucassview/tcpclient.h file contains the classes connect to cass
5  *
6  * @author Lutz Foucar
7  */
8 #ifndef _TCPCLIENT_H
9 #define _TCPCLIENT_H
10 
11 #include <string>
12 #include <list>
13 #include <tr1/memory>
14 
15 #include "result.hpp"
16 
17 namespace lucassview
18 {
19  /** the tcp client that connects to the cass server
20  *
21  * @author Lutz Foucar
22  */
23  class TCPClient
24  {
25  public:
26  /** constructor
27  *
28  * @param server string containing the server ip and port
29  */
30  TCPClient(const std::string &server);
31 
32  /** retrieve the list of available histograms */
33  std::list<std::string> operator() ()const;
34 
35  /** retrieve a specific histogram
36  *
37  * @return Histogram for requested key
38  * @param histogramkey the key of the requested histogram
39  */
40  cass::Result<float>::shared_pointer operator() (const std::string &histogramkey)const;
41 
42  /** reload .ini file */
43  void reloadIni() const;
44 
45  /** reload .ini file */
46  void controlCalibration(const std::string& command) const;
47 
48  /** retrieve the transferred bytes */
49  size_t receivedBytes()const {return _transferredBytes;}
50 
51  private:
52  /** the server to connect to */
53  std::string _server;
54 
55  /** the amount of bytes transferred */
56  mutable size_t _transferredBytes;
57  };
58 }
59 #endif
std::tr1::shared_ptr< self_type > shared_pointer
a shared pointer of this class
Definition: result.hpp:323
TCPClient(const std::string &server)
constructor
result classes
void reloadIni() const
reload .ini file
void controlCalibration(const std::string &command) const
reload .ini file
size_t receivedBytes() const
retrieve the transferred bytes
std::list< std::string > operator()() const
retrieve the list of available histograms
std::string _server
the server to connect to
size_t _transferredBytes
the amount of bytes transferred
the tcp client that connects to the cass server