Main MRPT website > C++ reference
MRPT logo
VersionVisitor.h
Go to the documentation of this file.
1 
2 /******************************************************************************
3  *
4  * file: VersionVisitor.h
5  *
6  * Copyright (c) 2003, Michael E. Smoot .
7  * All rights reverved.
8  *
9  * See the file COPYING in the top directory of this distribution for
10  * more information.
11  *
12  * THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
13  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
17  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
18  * DEALINGS IN THE SOFTWARE.
19  *
20  *****************************************************************************/
21 
22 
23 #ifndef TCLAP_VERSION_VISITOR_H
24 #define TCLAP_VERSION_VISITOR_H
25 
29 
30 namespace TCLAP {
31 
32 /**
33  * A Vistor that will call the version method of the given CmdLineOutput
34  * for the specified CmdLine object and then exit.
35  */
36 class VersionVisitor: public Visitor
37 {
38  protected:
39 
40  /**
41  * The CmdLine of interest.
42  */
44 
45  /**
46  * The output object.
47  */
49 
50  public:
51 
52  /**
53  * Constructor.
54  * \param cmd - The CmdLine the output is generated for.
55  * \param out - The type of output.
56  */
58  : Visitor(), _cmd( cmd ), _out( out ) { }
59 
60  /**
61  * Calls the version method of the output object using the
62  * specified CmdLine.
63  */
64  void visit() { (*_out)->version(*_cmd); throw ActionDoneException(); }
65 
66 };
67 
68 }
69 
70 #endif



Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013