SBEvent.h revision 87ffc77824a7ee9f06dba86cfa60e7b75735a6e5
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 // Make an event that contains a C string. 29 SBEvent (uint32_t event, const char *cstr, uint32_t cstr_len); 30 31 ~SBEvent(); 32 33 SBEvent (const lldb::SBEvent &rhs); 34 35#ifndef SWIG 36 const SBEvent & 37 operator = (const lldb::SBEvent &rhs); 38#endif 39 40 bool 41 IsValid() const; 42 43 const char * 44 GetDataFlavor (); 45 46 uint32_t 47 GetType () const; 48 49 lldb::SBBroadcaster 50 GetBroadcaster () const; 51 52 bool 53 BroadcasterMatchesPtr (const lldb::SBBroadcaster *broadcaster); 54 55 bool 56 BroadcasterMatchesRef (const lldb::SBBroadcaster &broadcaster); 57 58 void 59 Clear(); 60 61 static const char * 62 GetCStringFromEvent (const lldb::SBEvent &event); 63 64#ifndef SWIG 65 bool 66 GetDescription (lldb::SBStream &description); 67#endif 68 69 bool 70 GetDescription (lldb::SBStream &description) const; 71 72protected: 73 friend class SBListener; 74 friend class SBBroadcaster; 75 friend class SBBreakpoint; 76 friend class SBDebugger; 77 friend class SBProcess; 78 79 SBEvent (lldb::EventSP &event_sp); 80 81#ifndef SWIG 82 83 lldb::EventSP & 84 GetSP () const; 85 86 void 87 reset (lldb::EventSP &event_sp); 88 89 void 90 reset (lldb_private::Event* event); 91 92 lldb_private::Event * 93 get () const; 94 95#endif 96 97private: 98 99 mutable lldb::EventSP m_event_sp; 100 mutable lldb_private::Event *m_opaque_ptr; 101}; 102 103} // namespace lldb 104 105#endif // LLDB_SBEvent_h_ 106