1 //===-- SBValueList.h -------------------------------------------*- C++ -*-===// 2 // 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 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLDB_API_SBVALUELIST_H 10 #define LLDB_API_SBVALUELIST_H 11 12 #include "lldb/API/SBDefines.h" 13 14 class ValueListImpl; 15 16 namespace lldb { 17 18 class LLDB_API SBValueList { 19 public: 20 SBValueList(); 21 22 SBValueList(const lldb::SBValueList &rhs); 23 24 ~SBValueList(); 25 26 explicit operator bool() const; 27 28 bool IsValid() const; 29 30 void Clear(); 31 32 void Append(const lldb::SBValue &val_obj); 33 34 void Append(const lldb::SBValueList &value_list); 35 36 uint32_t GetSize() const; 37 38 lldb::SBValue GetValueAtIndex(uint32_t idx) const; 39 40 lldb::SBValue GetFirstValueByName(const char *name) const; 41 42 lldb::SBValue FindValueObjectByUID(lldb::user_id_t uid); 43 44 const lldb::SBValueList &operator=(const lldb::SBValueList &rhs); 45 46 protected: 47 // only useful for visualizing the pointer or comparing two SBValueLists to 48 // see if they are backed by the same underlying Impl. 49 void *opaque_ptr(); 50 51 private: 52 friend class SBFrame; 53 54 SBValueList(const ValueListImpl *lldb_object_ptr); 55 56 void Append(lldb::ValueObjectSP &val_obj_sp); 57 58 void CreateIfNeeded(); 59 60 ValueListImpl *operator->(); 61 62 ValueListImpl &operator*(); 63 64 const ValueListImpl *operator->() const; 65 66 const ValueListImpl &operator*() const; 67 68 ValueListImpl &ref(); 69 70 std::unique_ptr<ValueListImpl> m_opaque_up; 71 }; 72 73 } // namespace lldb 74 75 #endif // LLDB_API_SBVALUELIST_H 76