1 //===-- MICmdMgrSetCmdDeleteCallback.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 // Third party headers:
16 #include "MICmnBase.h"
21 namespace CMICmdMgrSetCmdDeleteCallback {
24 //============================================================================
25 // Details: MI Command Manager interface for client call back.
26 // Objects that want to be notified of a command being deleted
27 // inherit this interface and register interest in command object
28 // deletion. An object deleting a command must not do it itself but
30 // the Command Manager CmdDelete() function to delete a command object.
34 virtual void Delete(SMICmdData &vCmd) = 0;
36 /* dtor */ virtual ~ICallback() {}
40 //============================================================================
41 // Details: MI Command Manager container for clients registered interest in
43 // objects being deleted. Objects register an interest so when a
45 // is to be deleted that object wanting the delete calls the Command
46 // Manager to delete the command object. In so do all other registered
47 // objects get called to about the deletion including the object
49 // to do the delete in the first place.
51 class CSetClients : public std::set<class ICallback *>, public CMICmnBase {
54 /* ctor */ CSetClients();
56 bool Register(class ICallback &vObject);
57 bool Unregister(class ICallback &vObject);
58 void Delete(SMICmdData &vCmdData);
63 /* dtor */ ~CSetClients() override;
67 bool m_bClientUnregistered; // True = yes while deleting a client
68 // unregistered, false = no client unregistered
72 } // namespace CMICmdMgrSetCmdDeleteCallback