MythTV  master
sockethandler.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 #ifndef SOCKETHANDLER_H
4 #define SOCKETHANDLER_H
5 
6 #include <QString>
7 #include <QMutex>
8 #include <QStringList>
9 
10 #include "libmythbase/mythsocket.h"
12 #include "mythprotoserverexp.h"
13 
14 class MythSocketManager;
15 
17 {
18  public:
20  QString hostname);
21  ~SocketHandler() override;
22 
23  bool DoesBlockShutdown(void) const { return m_blockShutdown; }
24  bool GetsStandardEvents(void) const { return m_standardEvents; }
25  bool GetsSystemEvents(void) const { return m_systemEvents; }
26 
27  QString GetHostname(void) { return m_hostname; }
28 
29  MythSocket *GetSocket(void) { return m_socket; }
30  MythSocketManager *GetParent(void) { return m_parent; }
31 
32  bool WriteStringList(const QStringList &strlist);
33  bool SendReceiveStringList(QStringList &strlist, uint min_reply_length=0);
34 
35  void BlockShutdown(bool block) { m_blockShutdown = block; }
36  void AllowStandardEvents(bool allow){ m_standardEvents = allow; }
37  void AllowSystemEvents(bool allow) { m_systemEvents = allow; }
38 
39  private:
40  bool m_blockShutdown { false };
41  bool m_standardEvents { false };
42  bool m_systemEvents { false };
43 
44  MythSocket *m_socket { nullptr };
45  MythSocketManager *m_parent { nullptr };
46 
47  QString m_hostname;
48 };
49 
50 #endif // SOCKETHANDLER_H
SocketHandler::AllowStandardEvents
void AllowStandardEvents(bool allow)
Definition: sockethandler.h:36
SocketHandler::GetParent
MythSocketManager * GetParent(void)
Definition: sockethandler.h:30
MythSocketManager
Definition: mythsocketmanager.h:21
SocketHandler::GetsSystemEvents
bool GetsSystemEvents(void) const
Definition: sockethandler.h:25
MythSocket
Class for communcating between myth backends and frontends.
Definition: mythsocket.h:25
SocketHandler::GetSocket
MythSocket * GetSocket(void)
Definition: sockethandler.h:29
mythprotoserverexp.h
uint
unsigned int uint
Definition: compat.h:81
PROTOSERVER_PUBLIC
#define PROTOSERVER_PUBLIC
Definition: mythprotoserverexp.h:9
referencecounter.h
SocketHandler::GetHostname
QString GetHostname(void)
Definition: sockethandler.h:27
SocketHandler::m_hostname
QString m_hostname
Definition: sockethandler.h:47
SocketHandler::DoesBlockShutdown
bool DoesBlockShutdown(void) const
Definition: sockethandler.h:23
SocketHandler::BlockShutdown
void BlockShutdown(bool block)
Definition: sockethandler.h:35
SocketHandler
Definition: sockethandler.h:16
SocketHandler::GetsStandardEvents
bool GetsStandardEvents(void) const
Definition: sockethandler.h:24
musicbrainzngs.caa.hostname
string hostname
Definition: caa.py:17
SocketHandler::AllowSystemEvents
void AllowSystemEvents(bool allow)
Definition: sockethandler.h:37
mythsocket.h
ReferenceCounter
General purpose reference counter.
Definition: referencecounter.h:26