Instrument Neutral Distributed Interface INDI 2.2.5
baseclient_p.h
Go to the documentation of this file.
1#pragma once
2
4#include "indililxml.h"
5
6#include <tcpsocket.h>
7
8namespace INDI
9{
10
11#ifdef ENABLE_INDI_SHARED_MEMORY
12class ClientSharedBlobs
13{
14 public:
15 class Blobs : public std::vector<std::string>
16 {
17 public:
18 ~Blobs();
19 };
20
21 public:
22 void enableDirectBlobAccess(const char * dev, const char * prop);
23 void disableDirectBlobAccess();
24
25 bool parseAttachedBlobs(const INDI::LilXmlElement &root, Blobs &blobs);
26 bool isDirectBlobAccess(const std::string &dev, const std::string &prop) const;
27
28 static bool hasDirectBlobAccessEntry(const std::map<std::string, std::set<std::string>> &directBlobAccess,
29 const std::string &dev, const std::string &prop);
30
31 void addIncomingSharedBuffer(int fd);
32
33 void clear();
34
35 private:
36 std::list<int> incomingSharedBuffers;
37 std::map<std::string, std::set<std::string>> directBlobAccess;
38};
39
40class TcpSocketSharedBlobs : public TcpSocket
41{
42 public:
43 void readyRead() override;
44
45 ClientSharedBlobs sharedBlobs;
46};
47#endif
48
49class BaseDevice;
50
51
53{
54 public:
56 virtual ~BaseClientPrivate();
57
58 public:
59 bool connectToHostAndWait(std::string hostname, unsigned short port);
60
61 public:
62 ssize_t sendData(const void *data, size_t size) override;
63
64#ifdef ENABLE_INDI_SHARED_MEMORY
65 TcpSocketSharedBlobs clientSocket;
66#else
68#endif
70};
71
72}
bool connectToHostAndWait(std::string hostname, unsigned short port)
ssize_t sendData(const void *data, size_t size) override
Class to provide basic client functionality.
Definition baseclient.h:52
int fd
Namespace to encapsulate INDI client, drivers, and mediator classes.