Project
Loading...
Searching...
No Matches
WSDriverClient.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#ifndef O2_FRAMEWORK_WSDRIVERCLIENT_H_
12#define O2_FRAMEWORK_WSDRIVERCLIENT_H_
13
16#include <uv.h>
17#include <functional>
18#include <memory>
19#include <string>
20#include <vector>
21#include <mutex>
22#include <atomic>
23
24typedef struct uv_connect_s uv_connect_t;
25typedef struct uv_async_s uv_async_t;
26
27namespace o2::framework
28{
29
30struct ServiceRegistry;
31struct DeviceState;
32struct WSDPLClient;
33struct DeviceSpec;
34
39{
40 public:
41 WSDriverClient(ServiceRegistryRef registry, char const* ip, unsigned short port);
43 void tell(const char* msg, size_t s, bool flush = true) final;
44 void flushPending(ServiceRegistryRef mainThreadRef) final;
45 void setDPLClient(std::unique_ptr<WSDPLClient>);
46 void setConnection(uv_connect_t* connection) { mConnection = connection; };
47 // Initiate a websocket session
48 void sendHandshake();
49 std::mutex& mutex() { return mClientMutex; }
50
51 private:
53 void awake();
54 // Whether or not we managed to connect.
55 std::atomic<bool> mConnected = false;
56 std::mutex mClientMutex;
57 ServiceRegistryRef mRegistry;
58 std::vector<uv_buf_t> mBacklog;
59 std::vector<char*> mFreeChunks;
60 uv_async_t* mAwakeMainThread = nullptr;
61 uv_connect_t* mConnection = nullptr;
62 std::unique_ptr<WSDPLClient> mClient;
63};
64
65} // namespace o2::framework
66
67#endif // O2_FRAMEWORK_WSDRIVERCLIENT_H_
struct uv_async_s uv_async_t
Timeframe settings Average distance in cm of events merged into Randomize distance around average distance of merged events Simulate correct bunch interactions instead of placing only the average number of events A value[n] sets TFlen for[n] collisions in Number of bunches per trainsort Number of bunch trains Instantaneous interaction rate Do not simulate border Total number of collisions to be placed in the interior of all time Do not select random but walk over array of events in stride steps h Event generator settings h configStandalone Use CPU for GPU Force usage of the specified GPU device no CPU fallback Continue processing after an error s
struct uv_connect_s uv_connect_t
A service API to communicate with the driver.
void setDPLClient(std::unique_ptr< WSDPLClient >)
void tell(const char *msg, size_t s, bool flush=true) final
void flushPending(ServiceRegistryRef mainThreadRef) final
void setConnection(uv_connect_t *connection)
Defining ITS Vertex explicitly as messageable.
Definition Cartesian.h:288
uint64_t const void const *restrict const msg
Definition x9.h:153