You.i Engine
YiSignalAbstractConnection.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_SIGNAL_ABSTRACT_CONNECTION_H_
3 #define _YI_SIGNAL_ABSTRACT_CONNECTION_H_
4 
7 
8 class CYISignalHandler;
10 
19 enum class EYIConnectionType : uint8_t
20 {
33  Auto = 0,
34 
39  Sync,
40 
49  Async,
50 };
51 
58 {
59 public:
60  virtual ~CYISignalAbstractConnection() = default;
61 
62  void CopyConstructInto(CYISignalConnectionWrapper *pWrapper) const;
63  void CopyConstructInto(CYISignalConnectionWrapper *pWrapper, CYISignalHandler *pNewSignalHandler) const;
64  void CopyConstructInto(CYISignalConnectionWrapper *pWrapper, EYIConnectionType newConnectionType) const;
65 
69  virtual void CopyConstructInto(CYISignalConnectionWrapper *pWrapper, CYISignalHandler *pNewSignalHandler, EYIConnectionType newConnectionType) const = 0;
70 
74  virtual void MoveConstructInto(CYISignalConnectionWrapper *pWrapper);
75 
76  CYISignalHandler *GetSignalHandler() const;
77  EYIConnectionType GetConnectionType() const;
78  CYIThreadHandle GetThreadAffinity() const;
79 
80  bool IsIdentifiedBy(CYISignalConnectionID connectionID) const;
81  CYISignalConnectionID GetConnectionID() const;
82 
83 protected:
84  CYISignalAbstractConnection(CYISignalHandler *pSignalHandler, CYIThreadHandle threadAffinity, EYIConnectionType connectionType, CYISignalConnectionID connectionID);
85 
90 
91 private:
92  // Implicitely-generated functions are marked as deleted to avoid them being generated by the compiler.
93  CYISignalAbstractConnection() = delete;
96  CYISignalAbstractConnection &operator=(const CYISignalAbstractConnection &other) = delete;
97  CYISignalAbstractConnection &operator=(CYISignalAbstractConnection &&other) = delete;
98 };
99 
102 #include "signal/internal/YiSignalAbstractConnection.inl"
103 
104 #endif /* _YI_SIGNAL_ABSTRACT_CONNECTION_H_ */
const CYISignalConnectionID m_connectionID
Definition: YiSignalAbstractConnection.h:88
EYIConnectionType
Definition: YiSignalAbstractConnection.h:19
const EYIConnectionType m_connectionType
Definition: YiSignalAbstractConnection.h:89
CYISignalHandler *const m_pSignalHandler
Definition: YiSignalAbstractConnection.h:86
An object used to identify a specific CYISignal connection.
Definition: YiSignalConnectionID.h:19
Definition: YiSignalConnectionWrapper.h:7
The base abstract class for signal connections.
Definition: YiSignalAbstractConnection.h:57
Definition: YiSignalHandler.h:175
Definition: YiThreadHandle.h:45
const CYIThreadHandle m_threadAffinity
Definition: YiSignalAbstractConnection.h:87