SBEvent.h revision 7884ab842f7f0be6c583eac2904f5763706816bc
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 <stdio.h> 14#include <vector> 15 16#include "lldb/API/SBDefines.h" 17 18namespace lldb { 19 20class SBBroadcaster; 21 22class SBEvent 23{ 24public: 25 SBEvent(); 26 27 // Make an event that contains a C string. 28 SBEvent (uint32_t event, const char *cstr, uint32_t cstr_len); 29 30 ~SBEvent(); 31 32 bool 33 IsValid() const; 34 35 void 36 Dump (FILE *f) const; 37 38 const char * 39 GetDataFlavor (); 40 41 uint32_t 42 GetType () const; 43 44 lldb::SBBroadcaster 45 GetBroadcaster () const; 46 47 bool 48 BroadcasterMatchesPtr (const lldb::SBBroadcaster *broadcaster); 49 50 bool 51 BroadcasterMatchesRef (const lldb::SBBroadcaster &broadcaster); 52 53 void 54 Clear(); 55 56 static const char * 57 GetCStringFromEvent (const lldb::SBEvent &event); 58 59protected: 60 friend class SBListener; 61 friend class SBBroadcaster; 62 friend class SBDebugger; 63 friend class SBProcess; 64 65 SBEvent (lldb::EventSP &event_sp); 66 67 lldb::EventSP & 68 GetSharedPtr () const; 69 70 void 71 SetEventSP (lldb::EventSP &event_sp); 72 73 void 74 SetLLDBObjectPtr (lldb_private::Event* event); 75 76 lldb_private::Event * 77 GetLLDBObjectPtr (); 78 79 const lldb_private::Event * 80 GetLLDBObjectPtr () const; 81 82private: 83 84 mutable lldb::EventSP m_event_sp; 85 mutable lldb_private::Event *m_lldb_object; 86}; 87 88} // namespace lldb 89 90#endif // LLDB_SBEvent_h_ 91