1 //===-- SBProcessInfoList.cpp ---------------------------------------------===//
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 #include "lldb/API/SBProcessInfoList.h"
10 #include "lldb/API/SBProcessInfo.h"
11 #include "lldb/Utility/Instrumentation.h"
12 #include "lldb/Utility/ProcessInfo.h"
17 using namespace lldb_private
;
19 SBProcessInfoList::SBProcessInfoList() = default;
21 SBProcessInfoList::~SBProcessInfoList() = default;
23 SBProcessInfoList::SBProcessInfoList(const ProcessInfoList
&impl
)
24 : m_opaque_up(std::make_unique
<ProcessInfoList
>(impl
)) {
25 LLDB_INSTRUMENT_VA(this, impl
);
28 SBProcessInfoList::SBProcessInfoList(const lldb::SBProcessInfoList
&rhs
) {
30 LLDB_INSTRUMENT_VA(this, rhs
);
32 m_opaque_up
= clone(rhs
.m_opaque_up
);
35 const lldb::SBProcessInfoList
&
36 SBProcessInfoList::operator=(const lldb::SBProcessInfoList
&rhs
) {
38 LLDB_INSTRUMENT_VA(this, rhs
);
41 m_opaque_up
= clone(rhs
.m_opaque_up
);
45 uint32_t SBProcessInfoList::GetSize() const {
46 LLDB_INSTRUMENT_VA(this);
49 return m_opaque_up
->GetSize();
54 void SBProcessInfoList::Clear() {
55 LLDB_INSTRUMENT_VA(this);
61 bool SBProcessInfoList::GetProcessInfoAtIndex(uint32_t idx
,
62 SBProcessInfo
&info
) {
63 LLDB_INSTRUMENT_VA(this, idx
, info
);
66 lldb_private::ProcessInstanceInfo process_instance_info
;
67 if (m_opaque_up
->GetProcessInfoAtIndex(idx
, process_instance_info
)) {
68 info
.SetProcessInfo(process_instance_info
);