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 //===----------------------------------------------------------------------===//
11 // File: MICmdMgrSetCmdDeleteCallback.h
13 // Overview: ICallback interface.
14 // CSetClients interface.
16 // Environment: Compilers: Visual C++ 12.
17 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
18 // Libraries: See MIReadmetxt.
25 // Third party headers:
29 #include "MICmnBase.h"
34 namespace CMICmdMgrSetCmdDeleteCallback
37 //++ ============================================================================
38 // Details: MI Command Manager interface for client call back.
39 // Objects that want to be notified of a command being deleted
40 // inherit this interface and register interest in command object
41 // deletion. An object deleting a command must not do it itself but call
42 // the Command Manager CmdDelete() function to delete a command object.
44 // Authors: Illya Rudkin 21/02/2014.
50 virtual void Delete(SMICmdData &vCmd) = 0;
52 /* dtor */ virtual ~ICallback(void){};
55 //++ ============================================================================
56 // Details: MI Command Manager container for clients registered interest in command
57 // objects being deleted. Objects register an interest so when a command
58 // is to be deleted that object wanting the delete calls the Command
59 // Manager to delete the command object. In so do all other registered
60 // objects get called to about the deletion including the object wanting
61 // to do the delete in the first place.
63 // Authors: Illya Rudkin 21/02/2014.
66 class CSetClients : public std::set<class ICallback *>, public CMICmnBase
70 /* ctor */ CSetClients(void);
72 bool Register(class ICallback &vObject);
73 bool Unregister(class ICallback &vObject);
74 void Delete(SMICmdData &vCmdData);
79 /* dtor */ virtual ~CSetClients(void);
83 bool m_bClientUnregistered; // True = yes while deleting a client unregistered, false = no client unregistered during deletion
86 } // namespace CMICmdMgrSetCmdDeleteCallback