1 //===-- MICmdMgrSetCmdDeleteCallback.h --------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
13 // Third party headers:
17 #include "MICmnBase.h"
22 namespace CMICmdMgrSetCmdDeleteCallback
25 //++ ============================================================================
26 // Details: MI Command Manager interface for client call back.
27 // Objects that want to be notified of a command being deleted
28 // inherit this interface and register interest in command object
29 // deletion. An object deleting a command must not do it itself but call
30 // the Command Manager CmdDelete() function to delete a command object.
32 // Authors: Illya Rudkin 21/02/2014.
38 virtual void Delete(SMICmdData &vCmd) = 0;
40 /* dtor */ virtual ~ICallback(void){};
43 //++ ============================================================================
44 // Details: MI Command Manager container for clients registered interest in command
45 // objects being deleted. Objects register an interest so when a command
46 // is to be deleted that object wanting the delete calls the Command
47 // Manager to delete the command object. In so do all other registered
48 // objects get called to about the deletion including the object wanting
49 // to do the delete in the first place.
51 // Authors: Illya Rudkin 21/02/2014.
54 class CSetClients : public std::set<class ICallback *>, public CMICmnBase
58 /* ctor */ CSetClients(void);
60 bool Register(class ICallback &vObject);
61 bool Unregister(class ICallback &vObject);
62 void Delete(SMICmdData &vCmdData);
67 /* dtor */ ~CSetClients(void) override;
71 bool m_bClientUnregistered; // True = yes while deleting a client unregistered, false = no client unregistered during deletion
74 } // namespace CMICmdMgrSetCmdDeleteCallback