CLI  2.9
traces_menu.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2006-2018, Alexis Royer, http://alexis.royer.free.fr/CLI
3 
4  All rights reserved.
5 
6  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
7 
8  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation
10  and/or other materials provided with the distribution.
11  * Neither the name of the CLI library project nor the names of its contributors may be used to endorse or promote products derived from this software
12  without specific prior written permission.
13 
14  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
18  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26 
27 
31 
32 #ifndef _CLI_TRACES_MENU_H_
33 #define _CLI_TRACES_MENU_H_
34 
35 #include "cli/namespace.h"
36 #include "cli/menu.h"
37 #include "cli/traces.h"
38 
39 
41 
42  // Forward declarations.
43  class ParamString;
44 
46  class TracesMenu : public Menu
47  {
48  public:
50  explicit TracesMenu(void);
51 
53  virtual ~TracesMenu(void);
54 
55  private:
57  TracesMenu(const TracesMenu&);
59  TracesMenu& operator=(const TracesMenu&);
60 
61  public:
62  // Inherit doxygen comments from cli::Element documentation.
63  virtual void SetCli(Cli& CLI_Cli);
64  // Inherit doxygen comments from cli::Menu documentation.
65  virtual const bool ExecuteReserved(const CommandLine& CLI_CmdLine) const;
66  // Inherit doxygen comments from cli::Menu documentation.
67  virtual const bool Execute(const CommandLine& CLI_CmdLine) const;
68 
69  private:
71  void ShowAllClasses(void) const;
72 
74  void ShowCurrentFilter(void) const;
75 
77  void DisplayClassList(
78  const TraceClass::List& Q_Classes
79  ) const;
80 
82  void SetFilter(
83  const char* const STR_ClassName,
84  const bool B_Show
85  ) const;
86 
88  void SetAllFilter(
89  const bool B_Show
90  ) const;
91 
92  private:
94  const Keyword& GetShowNode(void) const;
96  const Keyword& GetShowFilterNode(void) const;
98  const Keyword& GetShowClassesNode(void) const;
100  const Keyword& GetNoNode(void) const;
102  const Keyword& GetTraceNode(void) const;
104  const Keyword& GetFilterNode(void) const;
106  const ParamString& GetFilterParam(void) const;
108  const Keyword& GetAllFilterNode(void) const;
109 
110  private:
112  Keyword* m_pcliShowNode;
114  Keyword* m_pcliShowFilterNode;
116  Keyword* m_pcliShowClassesNode;
117 
119  Keyword* m_pcliNoNode;
121  Keyword* m_pcliTraceNode;
123  Keyword* m_pcliTraceFilterNode;
125  ParamString* m_pcliFilterParam;
127  Keyword* m_pcliAllFilterNode;
128  };
129 
131 
132 #endif // _CLI_TRACES_MENU_H_
Main namespace of the CLI library.
TracesMenu(void)
Default constructor.
virtual const bool ExecuteReserved(const CommandLine &CLI_CmdLine) const
Reserved commands execution.
#define CLI_NS_END(__ns)
End a namespace definition.
Definition: namespace.h:45
Command line parsing.
Definition: command_line.h:52
virtual void SetCli(Cli &CLI_Cli)
Cli reference setting.
Namespace management.
Keyword element class.
Definition: keyword.h:47
Traces management system definition.
String parameter element class.
Definition: param_string.h:47
#define CLI_NS_BEGIN(__ns)
Begin a namespace definition.
Definition: namespace.h:38
tk::Queue< TraceClass > List
Trace class list typedef.
Definition: traces.h:56
Menu definition.
Definition: menu.h:51
Traces menu definition.
Definition: traces_menu.h:46
virtual const bool Execute(const CommandLine &CLI_CmdLine) const
User-defined commands execution.
CLI definition class.
Definition: cli.h:97
virtual ~TracesMenu(void)
Destructor.