ifm3d
pcicclient.h
1 // -*- c++ -*-
2 /*
3  * Copyright (C) 2017 Kuhn & Völkel GmbH
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 #ifndef IFM3D_PCICCLIENT_PCICCLIENT_H
7 #define IFM3D_PCICCLIENT_PCICCLIENT_H
8 
9 #include <ifm3d/pcicclient/module_pcicclient.h>
10 #include <string>
11 #include <ifm3d/device.h>
12 
13 namespace ifm3d
14 {
21  class IFM3D_EXPORT PCICClient
22  {
23  public:
24  using Ptr = std::shared_ptr<PCICClient>;
25 
33  PCICClient(ifm3d::LegacyDevice::Ptr cam,
34  const std::uint16_t pcic_port = ifm3d::PCIC_PORT);
35 
40  virtual ~PCICClient();
41 
42  // copy and move semantics
43  PCICClient(PCICClient&&) = delete;
44  PCICClient& operator=(PCICClient&&) = delete;
45  PCICClient(PCICClient&) = delete;
46  PCICClient& operator=(const PCICClient&) = delete;
47 
56  void Stop();
57 
78  long Call(const std::string& request,
79  std::function<void(const std::string& response)> callback);
80 
95  std::string Call(const std::string& request);
96 
120  bool Call(const std::string& request,
121  std::string& response,
122  long timeout_millis);
123 
137  long SetErrorCallback(
138  std::function<void(const std::string& error)> callback);
139 
155  long SetNotificationCallback(
156  std::function<void(const std::string& notification)> callback);
157 
168  void CancelCallback(long callback_id);
169 
170  private:
171  class IFM3D_NO_EXPORT Impl;
172  std::unique_ptr<Impl> pImpl;
173 
174  }; // end: class PCICClient
175 
176 } // end: namespace ifm3d
177 
178 #endif // IFM3D_PCICCLIENT_PCICCLIENT_H
ifm3d::PCICClient
Definition: pcicclient.h:21