SBEvent.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //===-- SBEvent.h -----------------------------------------------*- C++ -*-===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLDB_API_SBEVENT_H
  9. #define LLDB_API_SBEVENT_H
  10. #include "lldb/API/SBDefines.h"
  11. #include <cstdio>
  12. #include <vector>
  13. namespace lldb {
  14. class SBBroadcaster;
  15. class LLDB_API SBEvent {
  16. public:
  17. SBEvent();
  18. SBEvent(const lldb::SBEvent &rhs);
  19. // Make an event that contains a C string.
  20. SBEvent(uint32_t event, const char *cstr, uint32_t cstr_len);
  21. SBEvent(lldb::EventSP &event_sp);
  22. SBEvent(lldb_private::Event *event_sp);
  23. ~SBEvent();
  24. const SBEvent &operator=(const lldb::SBEvent &rhs);
  25. explicit operator bool() const;
  26. bool IsValid() const;
  27. const char *GetDataFlavor();
  28. uint32_t GetType() const;
  29. lldb::SBBroadcaster GetBroadcaster() const;
  30. const char *GetBroadcasterClass() const;
  31. bool BroadcasterMatchesPtr(const lldb::SBBroadcaster *broadcaster);
  32. bool BroadcasterMatchesRef(const lldb::SBBroadcaster &broadcaster);
  33. void Clear();
  34. static const char *GetCStringFromEvent(const lldb::SBEvent &event);
  35. bool GetDescription(lldb::SBStream &description);
  36. bool GetDescription(lldb::SBStream &description) const;
  37. protected:
  38. friend class SBListener;
  39. friend class SBBroadcaster;
  40. friend class SBBreakpoint;
  41. friend class SBDebugger;
  42. friend class SBProcess;
  43. friend class SBTarget;
  44. friend class SBThread;
  45. friend class SBWatchpoint;
  46. lldb::EventSP &GetSP() const;
  47. void reset(lldb::EventSP &event_sp);
  48. void reset(lldb_private::Event *event);
  49. lldb_private::Event *get() const;
  50. private:
  51. mutable lldb::EventSP m_event_sp;
  52. mutable lldb_private::Event *m_opaque_ptr;
  53. };
  54. } // namespace lldb
  55. #endif // LLDB_API_SBEVENT_H