VersionVisitor.h
Go to the documentation of this file.
// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-
/******************************************************************************
*
* file: VersionVisitor.h
*
* Copyright (c) 2003, Michael E. Smoot .
* All rights reserved.
*
* See the file COPYING in the top directory of this distribution for
* more information.
*
* THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*****************************************************************************/
#ifndef TCLAP_VERSION_VISITOR_H
#define TCLAP_VERSION_VISITOR_H
#include <tclap/CmdLineInterface.h>
#include <tclap/CmdLineOutput.h>
#include <tclap/Visitor.h>
namespace TCLAP {
class VersionVisitor: public Visitor
{
private:
VersionVisitor(const VersionVisitor& rhs);
VersionVisitor& operator=(const VersionVisitor& rhs);
protected:
CmdLineInterface* _cmd;
CmdLineOutput** _out;
public:
VersionVisitor( CmdLineInterface* cmd, CmdLineOutput** out )
: Visitor(), _cmd( cmd ), _out( out ) { }
void visit() {
(*_out)->version(*_cmd);
throw ExitException(0);
}
};
}
#endif
CmdLineInterface.h
CmdLineOutput.h
Visitor.h
TCLAP::CmdLineInterface
The base class that manages the command line definition and passes along the parsing to the appropria...
Definition: CmdLineInterface.h:47
TCLAP::CmdLineOutput
The interface that any output object must implement.
Definition: CmdLineOutput.h:45
TCLAP::ExitException
Thrown when TCLAP thinks the program should exit.
Definition: ArgException.h:200
TCLAP::VersionVisitor
A Visitor that will call the version method of the given CmdLineOutput for the specified CmdLine obje...
Definition: VersionVisitor.h:38
TCLAP::VersionVisitor::visit
void visit()
Calls the version method of the output object using the specified CmdLine.
Definition: VersionVisitor.h:72
TCLAP::VersionVisitor::VersionVisitor
VersionVisitor(CmdLineInterface *cmd, CmdLineOutput **out)
Constructor.
Definition: VersionVisitor.h:65
TCLAP::VersionVisitor::_out
CmdLineOutput ** _out
The output object.
Definition: VersionVisitor.h:56
TCLAP::VersionVisitor::_cmd
CmdLineInterface * _cmd
The CmdLine of interest.
Definition: VersionVisitor.h:51
TCLAP::Visitor
A base class that defines the interface for visitors.
Definition: Visitor.h:35
TCLAP
Definition: Arg.h:48