1 //===-- SBBroadcaster.h -----------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #ifndef LLDB_SBBroadcaster_h_ 11 #define LLDB_SBBroadcaster_h_ 12 13 #include "lldb/API/SBDefines.h" 14 15 namespace lldb { 16 17 class SBBroadcaster 18 { 19 public: 20 SBBroadcaster (); 21 22 SBBroadcaster (const char *name); 23 24 SBBroadcaster (const SBBroadcaster &rhs); 25 26 const SBBroadcaster & 27 operator = (const SBBroadcaster &rhs); 28 29 ~SBBroadcaster(); 30 31 bool 32 IsValid () const; 33 34 void 35 Clear (); 36 37 void 38 BroadcastEventByType (uint32_t event_type, bool unique = false); 39 40 void 41 BroadcastEvent (const lldb::SBEvent &event, bool unique = false); 42 43 void 44 AddInitialEventsToListener (const lldb::SBListener &listener, uint32_t requested_events); 45 46 uint32_t 47 AddListener (const lldb::SBListener &listener, uint32_t event_mask); 48 49 const char * 50 GetName () const; 51 52 bool 53 EventTypeHasListeners (uint32_t event_type); 54 55 bool 56 RemoveListener (const lldb::SBListener &listener, uint32_t event_mask = UINT32_MAX); 57 58 // This comparison is checking if the internal opaque pointer value 59 // is equal to that in "rhs". 60 bool 61 operator == (const lldb::SBBroadcaster &rhs) const; 62 63 // This comparison is checking if the internal opaque pointer value 64 // is not equal to that in "rhs". 65 bool 66 operator != (const lldb::SBBroadcaster &rhs) const; 67 68 // This comparison is checking if the internal opaque pointer value 69 // is less than that in "rhs" so SBBroadcaster objects can be contained 70 // in ordered containers. 71 bool 72 operator < (const lldb::SBBroadcaster &rhs) const; 73 74 protected: 75 friend class SBCommandInterpreter; 76 friend class SBCommunication; 77 friend class SBEvent; 78 friend class SBListener; 79 friend class SBProcess; 80 friend class SBTarget; 81 82 SBBroadcaster (lldb_private::Broadcaster *broadcaster, bool owns); 83 84 lldb_private::Broadcaster * 85 get () const; 86 87 void 88 reset (lldb_private::Broadcaster *broadcaster, bool owns); 89 90 private: 91 lldb::BroadcasterSP m_opaque_sp; 92 lldb_private::Broadcaster *m_opaque_ptr; 93 }; 94 95 } // namespace lldb 96 97 #endif // LLDB_SBBroadcaster_h_ 98