SBEvent.h revision 5a15e6927b5b3234fb3e688717297ba6b5dd6ad7
1//===-- SBEvent.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_SBEvent_h_ 11#define LLDB_SBEvent_h_ 12 13#include "lldb/API/SBDefines.h" 14 15#include <stdio.h> 16#include <vector> 17 18 19namespace lldb { 20 21class SBBroadcaster; 22 23class SBEvent 24{ 25public: 26 SBEvent(); 27 28 SBEvent (const lldb::SBEvent &rhs); 29 30 // Make an event that contains a C string. 31 SBEvent (uint32_t event, const char *cstr, uint32_t cstr_len); 32 33 ~SBEvent(); 34 35 const SBEvent & 36 operator = (const lldb::SBEvent &rhs); 37 38 bool 39 IsValid() const; 40 41 const char * 42 GetDataFlavor (); 43 44 uint32_t 45 GetType () const; 46 47 lldb::SBBroadcaster 48 GetBroadcaster () const; 49 50 const char * 51 GetBroadcasterClass () const; 52 53 bool 54 BroadcasterMatchesPtr (const lldb::SBBroadcaster *broadcaster); 55 56 bool 57 BroadcasterMatchesRef (const lldb::SBBroadcaster &broadcaster); 58 59 void 60 Clear(); 61 62 static const char * 63 GetCStringFromEvent (const lldb::SBEvent &event); 64 65 bool 66 GetDescription (lldb::SBStream &description); 67 68 bool 69 GetDescription (lldb::SBStream &description) const; 70 71protected: 72 friend class SBListener; 73 friend class SBBroadcaster; 74 friend class SBBreakpoint; 75 friend class SBDebugger; 76 friend class SBProcess; 77 78 SBEvent (lldb::EventSP &event_sp); 79 80 lldb::EventSP & 81 GetSP () const; 82 83 void 84 reset (lldb::EventSP &event_sp); 85 86 void 87 reset (lldb_private::Event* event); 88 89 lldb_private::Event * 90 get () const; 91 92private: 93 94 mutable lldb::EventSP m_event_sp; 95 mutable lldb_private::Event *m_opaque_ptr; 96}; 97 98} // namespace lldb 99 100#endif // LLDB_SBEvent_h_ 101