Project
Loading...
Searching...
No Matches
Location.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
16
17#ifndef O2EVE_LOCATION_H
18#define O2EVE_LOCATION_H
19
20#include <string>
21#include <fstream>
22#include <iosfwd>
23
25{
27 std::string fileName;
28 int port = -1;
29 int timeout = 100;
30 std::string host = "localhost";
31 bool toFile = true;
32 bool toSocket = true;
33};
35{
36 std::ofstream* mOut;
37 int mClientSocket;
38 bool mToFile;
39 bool mToSocket;
40 std::string mFileName;
41 int mPort;
42 int mTimeout;
43 std::string mHostName;
44
45 public:
47 {
48 this->mFileName = params.fileName;
49 this->mToFile = !params.fileName.empty() && params.toFile;
50 this->mToSocket = params.port != -1 && params.toSocket;
51 this->mOut = nullptr;
52 this->mPort = params.port;
53 this->mHostName = params.host;
54 this->mClientSocket = -1;
55 this->mTimeout = params.timeout;
56 }
58 {
59 close();
60 }
61 void open();
62 void close();
63 void write(char* buf, std::streamsize size);
64 [[nodiscard]] std::string fileName() const { return this->mFileName; }
65 [[nodiscard]] std::string hostName() const { return this->mHostName; }
66 [[nodiscard]] int port() const { return this->mPort; }
67};
68} // namespace o2::event_visualisation
69
70#endif // O2EVE_LOCATION_H
std::string hostName() const
Definition Location.h:65
void write(char *buf, std::streamsize size)
Definition Location.cxx:159
std::string fileName() const
Definition Location.h:64
Location(const LocationParams &params)
Definition Location.h:46
GLsizeiptr size
Definition glcorearb.h:659
GLenum const GLfloat * params
Definition glcorearb.h:272
GLbitfield GLuint64 timeout
Definition glcorearb.h:1573
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition glcorearb.h:2514