]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmdMgrSetCmdDeleteCallback.h
MFV r276761: tcpdump 4.6.2.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmdMgrSetCmdDeleteCallback.h
1 //===-- MICmdMgrSetCmdDeleteCallback.h --------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 //++
11 // File:                MICmdMgrSetCmdDeleteCallback.h
12 //
13 // Overview:    ICallback       interface.
14 //                              CSetClients interface.
15 //
16 // Environment: Compilers:      Visual C++ 12.
17 //                                                      gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
18 //                              Libraries:      See MIReadmetxt. 
19 //
20 // Copyright:   None.
21 //--
22
23 #pragma once
24
25 // Third party headers:
26 #include <set>
27
28 // In-house headers:
29 #include "MICmnBase.h"
30
31 // Declarations:
32 struct SMICmdData;
33
34 namespace CMICmdMgrSetCmdDeleteCallback
35 {
36
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.
43 // Gotchas:     None.
44 // Authors:     Illya Rudkin 21/02/2014.
45 // Changes:     None.
46 //--
47 class ICallback
48 {
49 public:
50         virtual void Delete( SMICmdData & vCmd ) = 0;
51
52         /* dtor */ virtual ~ICallback( void ) {};
53 };
54
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. 
62 // Gotchas:     None.
63 // Authors:     Illya Rudkin 21/02/2014.
64 // Changes:     None.
65 //--
66 class CSetClients
67 :       public std::set< class ICallback * >
68 ,       public CMICmnBase
69 {
70 // Methods:
71 public:
72         /* ctor */      CSetClients( void );
73         
74         bool    Register( class ICallback & vObject );
75         bool    Unregister( class ICallback & vObject );
76         void    Delete( SMICmdData & vCmdData );
77
78 // Overridden:
79 public:
80         // From CMICmnBase
81         /* dtor */ virtual ~CSetClients( void );
82
83 // Attributes:
84 private:
85         bool    m_bClientUnregistered;  // True = yes while deleting a client unregistered, false = no client unregistered during deletion
86 };
87
88 } // namespace CMICmdMgrSetCmdDeleteCallback