Main MRPT website > C++ reference for MRPT 1.4.0
HelpVisitor.h
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2016, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 /******************************************************************************
11  *
12  * file: HelpVisitor.h
13  *
14  * Copyright (c) 2003, Michael E. Smoot .
15  * All rights reverved.
16  *
17  * See the file COPYING in the top directory of this distribution for
18  * more information.
19  *
20  * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  * DEALINGS IN THE SOFTWARE.
27  *
28  *****************************************************************************/
29 
30 #ifndef TCLAP_HELP_VISITOR_H
31 #define TCLAP_HELP_VISITOR_H
32 
36 
37 namespace TCLAP {
38 
39 /**
40  * A Visitor object that calls the usage method of the given CmdLineOutput
41  * object for the specified CmdLine object.
42  */
43 class HelpVisitor: public Visitor
44 {
45  protected:
46 
47  /**
48  * The CmdLine the output will be generated for.
49  */
51 
52  /**
53  * The output object.
54  */
56 
57  public:
58 
59  /**
60  * Constructor.
61  * \param cmd - The CmdLine the output will be generated for.
62  * \param out - The type of output.
63  */
65  : Visitor(), _cmd( cmd ), _out( out ) { }
66 
67  /**
68  * Calls the usage method of the CmdLineOutput for the
69  * specified CmdLine.
70  */
71  void visit() { (*_out)->usage(*_cmd); throw ActionDoneException(); }
72 
73 };
74 
75 }
76 
77 #endif
The interface that any output object must implement.
Definition: CmdLineOutput.h:49
void visit()
Calls the usage method of the CmdLineOutput for the specified CmdLine.
Definition: HelpVisitor.h:71
CmdLineOutput ** _out
The output object.
Definition: HelpVisitor.h:55
(Added by JLBC for MRPT): An exception that indicates to CmdLine::parse that help,version,...
Definition: ArgException.h:199
Definition: Arg.h:44
HelpVisitor(CmdLineInterface *cmd, CmdLineOutput **out)
Constructor.
Definition: HelpVisitor.h:64
A base class that defines the interface for visitors.
Definition: Visitor.h:39
A Visitor object that calls the usage method of the given CmdLineOutput object for the specified CmdL...
Definition: HelpVisitor.h:43
CmdLineInterface * _cmd
The CmdLine the output will be generated for.
Definition: HelpVisitor.h:50
The base class that manages the command line definition and passes along the parsing to the appropria...



Page generated by Doxygen 1.8.14 for MRPT 1.4.0 SVN: at Sat Jul 14 16:13:21 UTC 2018