2014-05-16 18:51:01 +08:00
|
|
|
//===-- MICmdMgr.h ----------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// Third party headers
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
// In-house headers:
|
|
|
|
#include "MICmdBase.h"
|
|
|
|
#include "MICmdMgrSetCmdDeleteCallback.h"
|
2016-09-07 04:57:50 +08:00
|
|
|
#include "MICmnBase.h"
|
2014-05-16 18:51:01 +08:00
|
|
|
#include "MIUtilSingletonBase.h"
|
|
|
|
|
|
|
|
// Declarations:
|
|
|
|
class CMICmdInterpreter;
|
|
|
|
class CMICmdFactory;
|
2014-11-18 02:06:21 +08:00
|
|
|
class CMICmdInvoker;
|
2014-05-16 18:51:01 +08:00
|
|
|
class CMICmdBase;
|
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
//++
|
|
|
|
//============================================================================
|
2014-11-18 02:06:21 +08:00
|
|
|
// Details: MI command manager. Oversees command operations, controls command
|
|
|
|
// production and the running of commands.
|
2016-09-07 04:57:50 +08:00
|
|
|
// Command Invoker, Command Factory and Command Monitor while
|
|
|
|
// independent
|
2014-11-18 02:06:21 +08:00
|
|
|
// units are overseen/managed by *this manager.
|
|
|
|
// A singleton class.
|
2014-05-16 18:51:01 +08:00
|
|
|
//--
|
2016-09-07 04:57:50 +08:00
|
|
|
class CMICmdMgr : public CMICmnBase, public MI::ISingleton<CMICmdMgr> {
|
|
|
|
friend class MI::ISingleton<CMICmdMgr>;
|
2014-05-16 18:51:01 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
// Methods:
|
|
|
|
public:
|
|
|
|
bool Initialize() override;
|
|
|
|
bool Shutdown() override;
|
2014-05-16 18:51:01 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
bool CmdInterpret(const CMIUtilString &vTextLine, bool &vwbYesValid,
|
|
|
|
bool &vwbCmdNotInCmdFactor, SMICmdData &rwCmdData);
|
|
|
|
bool CmdExecute(const SMICmdData &vCmdData);
|
|
|
|
bool CmdDelete(SMICmdData vCmdData);
|
|
|
|
bool CmdRegisterForDeleteNotification(
|
|
|
|
CMICmdMgrSetCmdDeleteCallback::ICallback &vObject);
|
|
|
|
bool CmdUnregisterForDeleteNotification(
|
|
|
|
CMICmdMgrSetCmdDeleteCallback::ICallback &vObject);
|
2014-05-16 18:51:01 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
// Methods:
|
|
|
|
private:
|
|
|
|
/* ctor */ CMICmdMgr();
|
|
|
|
/* ctor */ CMICmdMgr(const CMICmdMgr &);
|
|
|
|
void operator=(const CMICmdMgr &);
|
2014-11-18 02:06:21 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
// Overridden:
|
|
|
|
public:
|
|
|
|
// From CMICmnBase
|
|
|
|
/* dtor */ ~CMICmdMgr() override;
|
2014-11-18 02:06:21 +08:00
|
|
|
|
2016-09-07 04:57:50 +08:00
|
|
|
// Attributes:
|
|
|
|
private:
|
|
|
|
CMICmdInterpreter &m_interpretor;
|
|
|
|
CMICmdFactory &m_factory;
|
|
|
|
CMICmdInvoker &m_invoker;
|
|
|
|
CMICmdMgrSetCmdDeleteCallback::CSetClients m_setCmdDeleteCallback;
|
2014-11-18 02:06:21 +08:00
|
|
|
};
|