Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:41

0001 //===-- SBBroadcaster.h -----------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_API_SBBROADCASTER_H
0010 #define LLDB_API_SBBROADCASTER_H
0011 
0012 #include "lldb/API/SBDefines.h"
0013 
0014 namespace lldb {
0015 
0016 class LLDB_API SBBroadcaster {
0017 public:
0018   SBBroadcaster();
0019 
0020   SBBroadcaster(const char *name);
0021 
0022   SBBroadcaster(const SBBroadcaster &rhs);
0023 
0024   const SBBroadcaster &operator=(const SBBroadcaster &rhs);
0025 
0026   ~SBBroadcaster();
0027 
0028   explicit operator bool() const;
0029 
0030   bool IsValid() const;
0031 
0032   void Clear();
0033 
0034   void BroadcastEventByType(uint32_t event_type, bool unique = false);
0035 
0036   void BroadcastEvent(const lldb::SBEvent &event, bool unique = false);
0037 
0038   void AddInitialEventsToListener(const lldb::SBListener &listener,
0039                                   uint32_t requested_events);
0040 
0041   uint32_t AddListener(const lldb::SBListener &listener, uint32_t event_mask);
0042 
0043   const char *GetName() const;
0044 
0045   bool EventTypeHasListeners(uint32_t event_type);
0046 
0047   bool RemoveListener(const lldb::SBListener &listener,
0048                       uint32_t event_mask = UINT32_MAX);
0049 
0050   // This comparison is checking if the internal opaque pointer value is equal
0051   // to that in "rhs".
0052   bool operator==(const lldb::SBBroadcaster &rhs) const;
0053 
0054   // This comparison is checking if the internal opaque pointer value is not
0055   // equal to that in "rhs".
0056   bool operator!=(const lldb::SBBroadcaster &rhs) const;
0057 
0058   // This comparison is checking if the internal opaque pointer value is less
0059   // than that in "rhs" so SBBroadcaster objects can be contained in ordered
0060   // containers.
0061   bool operator<(const lldb::SBBroadcaster &rhs) const;
0062 
0063 protected:
0064   friend class SBCommandInterpreter;
0065   friend class SBCommunication;
0066   friend class SBDebugger;
0067   friend class SBEvent;
0068   friend class SBListener;
0069   friend class SBProcess;
0070   friend class SBTarget;
0071 
0072   SBBroadcaster(lldb_private::Broadcaster *broadcaster, bool owns);
0073 
0074   lldb_private::Broadcaster *get() const;
0075 
0076   void reset(lldb_private::Broadcaster *broadcaster, bool owns);
0077 
0078 private:
0079   lldb::BroadcasterSP m_opaque_sp;
0080   lldb_private::Broadcaster *m_opaque_ptr = nullptr;
0081 };
0082 
0083 } // namespace lldb
0084 
0085 #endif // LLDB_API_SBBROADCASTER_H