1 //===-- SBThreadCollection.cpp ----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "lldb/API/SBThreadCollection.h"
11 #include "lldb/API/SBThread.h"
12 #include "lldb/Target/ThreadList.h"
15 using namespace lldb_private;
18 SBThreadCollection::SBThreadCollection () :
23 SBThreadCollection::SBThreadCollection(const SBThreadCollection &rhs) :
24 m_opaque_sp (rhs.m_opaque_sp)
28 const SBThreadCollection &
29 SBThreadCollection::operator = (const SBThreadCollection &rhs)
32 m_opaque_sp = rhs.m_opaque_sp;
36 SBThreadCollection::SBThreadCollection (const ThreadCollectionSP &threads) :
41 SBThreadCollection::~SBThreadCollection ()
46 SBThreadCollection::SetOpaque (const lldb::ThreadCollectionSP &threads)
48 m_opaque_sp = threads;
51 lldb_private::ThreadCollection *
52 SBThreadCollection::get() const
54 return m_opaque_sp.get();
57 lldb_private::ThreadCollection *
58 SBThreadCollection::operator->() const
60 return m_opaque_sp.operator->();
63 lldb::ThreadCollectionSP &
64 SBThreadCollection::operator*()
69 const lldb::ThreadCollectionSP &
70 SBThreadCollection::operator*() const
77 SBThreadCollection::IsValid () const
79 return m_opaque_sp.get() != NULL;
83 SBThreadCollection::GetSize ()
86 return m_opaque_sp->GetSize();
91 SBThreadCollection::GetThreadAtIndex(size_t idx)
94 if (m_opaque_sp && idx < m_opaque_sp->GetSize())
95 thread = m_opaque_sp->GetThreadAtIndex(idx);