]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm-project/lldb/tools/lldb-mi/MICmdArgValThreadGrp.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm-project / lldb / tools / lldb-mi / MICmdArgValThreadGrp.h
1 //===-- MICmdArgValThreadGrp.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 #pragma once
10
11 // In-house headers:
12 #include "MICmdArgValBase.h"
13
14 // Declarations:
15 class CMICmdArgContext;
16
17 //++
18 //============================================================================
19 // Details: MI common code class. Command argument class. Arguments object
20 //          needing specialization derived from the CMICmdArgValBase class.
21 //          An argument knows what type of argument it is and how it is to
22 //          interpret the options (context) string to find and validate a
23 //          matching
24 //          argument and so extract a value from it. Thread group looks like
25 //          "i1" in the options text.
26 //          Based on the Interpreter pattern.
27 //--
28 class CMICmdArgValThreadGrp : public CMICmdArgValBaseTemplate<MIuint> {
29   // Methods:
30 public:
31   /* ctor */ CMICmdArgValThreadGrp();
32   /* ctor */ CMICmdArgValThreadGrp(const CMIUtilString &vrArgName,
33                                    const bool vbMandatory,
34                                    const bool vbHandleByCmd);
35   //
36   bool IsArgThreadGrp(const CMIUtilString &vrTxt) const;
37
38   // Overridden:
39 public:
40   // From CMICmdArgValBase
41   /* dtor */ ~CMICmdArgValThreadGrp() override;
42   // From CMICmdArgSet::IArg
43   bool Validate(CMICmdArgContext &vArgContext) override;
44
45   // Methods:
46 private:
47   bool ExtractNumber(const CMIUtilString &vrTxt);
48   MIuint GetNumber() const;
49
50   // Attributes:
51 private:
52   MIuint m_nThreadGrp;
53 };