]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdMgr.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdMgr.h
1 //===-- MICmdMgr.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 // Third party headers
12 #include <set>
13
14 // In-house headers:
15 #include "MICmdBase.h"
16 #include "MICmdMgrSetCmdDeleteCallback.h"
17 #include "MICmnBase.h"
18 #include "MIUtilSingletonBase.h"
19
20 // Declarations:
21 class CMICmdInterpreter;
22 class CMICmdFactory;
23 class CMICmdInvoker;
24 class CMICmdBase;
25
26 //++
27 //============================================================================
28 // Details: MI command manager. Oversees command operations, controls command
29 //          production and the running of commands.
30 //          Command Invoker, Command Factory and Command Monitor while
31 //          independent
32 //          units are overseen/managed by *this manager.
33 //          A singleton class.
34 //--
35 class CMICmdMgr : public CMICmnBase, public MI::ISingleton<CMICmdMgr> {
36   friend class MI::ISingleton<CMICmdMgr>;
37
38   // Methods:
39 public:
40   bool Initialize() override;
41   bool Shutdown() override;
42
43   bool CmdInterpret(const CMIUtilString &vTextLine, bool &vwbYesValid,
44                     bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData);
45   bool CmdExecute(const SMICmdData &vCmdData);
46   bool CmdDelete(SMICmdData vCmdData);
47   bool CmdRegisterForDeleteNotification(
48       CMICmdMgrSetCmdDeleteCallback::ICallback &vObject);
49   bool CmdUnregisterForDeleteNotification(
50       CMICmdMgrSetCmdDeleteCallback::ICallback &vObject);
51
52   // Methods:
53 private:
54   /* ctor */ CMICmdMgr();
55   /* ctor */ CMICmdMgr(const CMICmdMgr &);
56   void operator=(const CMICmdMgr &);
57
58   // Overridden:
59 public:
60   // From CMICmnBase
61   /* dtor */ ~CMICmdMgr() override;
62
63   // Attributes:
64 private:
65   CMICmdInterpreter &m_interpretor;
66   CMICmdFactory &m_factory;
67   CMICmdInvoker &m_invoker;
68   CMICmdMgrSetCmdDeleteCallback::CSetClients m_setCmdDeleteCallback;
69 };