1 //===-- MICmdArgValThreadGrp.h ----------------------------------*- C++ -*-===//
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 //===----------------------------------------------------------------------===//
12 #include "MICmdArgValBase.h"
15 class CMICmdArgContext;
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
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.
28 class CMICmdArgValThreadGrp : public CMICmdArgValBaseTemplate<MIuint> {
31 /* ctor */ CMICmdArgValThreadGrp();
32 /* ctor */ CMICmdArgValThreadGrp(const CMIUtilString &vrArgName,
33 const bool vbMandatory,
34 const bool vbHandleByCmd);
36 bool IsArgThreadGrp(const CMIUtilString &vrTxt) const;
40 // From CMICmdArgValBase
41 /* dtor */ ~CMICmdArgValThreadGrp() override;
42 // From CMICmdArgSet::IArg
43 bool Validate(CMICmdArgContext &vArgContext) override;
47 bool ExtractNumber(const CMIUtilString &vrTxt);
48 MIuint GetNumber() const;