SBEvent.h revision 9c970a371511a0e31ba9360aa841d445792c1ab0
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    friend class SBThread;
78    friend class SBWatchpoint;
79
80    SBEvent (lldb::EventSP &event_sp);
81
82    lldb::EventSP &
83    GetSP () const;
84
85    void
86    reset (lldb::EventSP &event_sp);
87
88    void
89    reset (lldb_private::Event* event);
90
91    lldb_private::Event *
92    get () const;
93
94private:
95
96    mutable lldb::EventSP m_event_sp;
97    mutable lldb_private::Event *m_opaque_ptr;
98};
99
100} // namespace lldb
101
102#endif  // LLDB_SBEvent_h_
103