1 //===-- SBBroadcaster.h -----------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SBBroadcaster_h_
10 #define LLDB_SBBroadcaster_h_
12 #include "lldb/API/SBDefines.h"
16 class LLDB_API SBBroadcaster {
20 SBBroadcaster(const char *name);
22 SBBroadcaster(const SBBroadcaster &rhs);
24 const SBBroadcaster &operator=(const SBBroadcaster &rhs);
28 explicit operator bool() const;
34 void BroadcastEventByType(uint32_t event_type, bool unique = false);
36 void BroadcastEvent(const lldb::SBEvent &event, bool unique = false);
38 void AddInitialEventsToListener(const lldb::SBListener &listener,
39 uint32_t requested_events);
41 uint32_t AddListener(const lldb::SBListener &listener, uint32_t event_mask);
43 const char *GetName() const;
45 bool EventTypeHasListeners(uint32_t event_type);
47 bool RemoveListener(const lldb::SBListener &listener,
48 uint32_t event_mask = UINT32_MAX);
50 // This comparison is checking if the internal opaque pointer value is equal
52 bool operator==(const lldb::SBBroadcaster &rhs) const;
54 // This comparison is checking if the internal opaque pointer value is not
55 // equal to that in "rhs".
56 bool operator!=(const lldb::SBBroadcaster &rhs) const;
58 // This comparison is checking if the internal opaque pointer value is less
59 // than that in "rhs" so SBBroadcaster objects can be contained in ordered
61 bool operator<(const lldb::SBBroadcaster &rhs) const;
64 friend class SBCommandInterpreter;
65 friend class SBCommunication;
67 friend class SBListener;
68 friend class SBProcess;
69 friend class SBTarget;
71 SBBroadcaster(lldb_private::Broadcaster *broadcaster, bool owns);
73 lldb_private::Broadcaster *get() const;
75 void reset(lldb_private::Broadcaster *broadcaster, bool owns);
78 lldb::BroadcasterSP m_opaque_sp;
79 lldb_private::Broadcaster *m_opaque_ptr;
84 #endif // LLDB_SBBroadcaster_h_