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