1 //===-- SBEvent.h -----------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SBEvent_h_
10 #define LLDB_SBEvent_h_
12 #include "lldb/API/SBDefines.h"
21 class LLDB_API SBEvent {
25 SBEvent(const lldb::SBEvent &rhs);
27 // Make an event that contains a C string.
28 SBEvent(uint32_t event, const char *cstr, uint32_t cstr_len);
30 SBEvent(lldb::EventSP &event_sp);
32 SBEvent(lldb_private::Event *event_sp);
36 const SBEvent &operator=(const lldb::SBEvent &rhs);
38 explicit operator bool() const;
42 const char *GetDataFlavor();
44 uint32_t GetType() const;
46 lldb::SBBroadcaster GetBroadcaster() const;
48 const char *GetBroadcasterClass() const;
50 bool BroadcasterMatchesPtr(const lldb::SBBroadcaster *broadcaster);
52 bool BroadcasterMatchesRef(const lldb::SBBroadcaster &broadcaster);
56 static const char *GetCStringFromEvent(const lldb::SBEvent &event);
58 bool GetDescription(lldb::SBStream &description);
60 bool GetDescription(lldb::SBStream &description) const;
63 friend class SBListener;
64 friend class SBBroadcaster;
65 friend class SBBreakpoint;
66 friend class SBDebugger;
67 friend class SBProcess;
68 friend class SBTarget;
69 friend class SBThread;
70 friend class SBWatchpoint;
72 lldb::EventSP &GetSP() const;
74 void reset(lldb::EventSP &event_sp);
76 void reset(lldb_private::Event *event);
78 lldb_private::Event *get() const;
81 mutable lldb::EventSP m_event_sp;
82 mutable lldb_private::Event *m_opaque_ptr;
87 #endif // LLDB_SBEvent_h_