tclap 1.2.2
Constraint.h
Go to the documentation of this file.
1
2/******************************************************************************
3 *
4 * file: Constraint.h
5 *
6 * Copyright (c) 2005, Michael E. Smoot
7 * All rights reserved.
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#ifndef TCLAP_CONSTRAINT_H
23#define TCLAP_CONSTRAINT_H
24
25#include <string>
26#include <vector>
27#include <list>
28#include <iostream>
29#include <iomanip>
30#include <algorithm>
31
32namespace TCLAP {
33
37template<class T>
39{
40
41 public:
45 virtual std::string description() const =0;
46
50 virtual std::string shortID() const =0;
51
57 virtual bool check(const T& value) const =0;
58
64 virtual ~Constraint() { ; }
65};
66
67} //namespace TCLAP
68#endif
The interface that defines the interaction between the Arg and Constraint.
Definition Constraint.h:39
virtual std::string shortID() const =0
Returns the short ID for the Constraint.
virtual bool check(const T &value) const =0
The method used to verify that the value parsed from the command line meets the constraint.
virtual std::string description() const =0
Returns a description of the Constraint.
virtual ~Constraint()
Destructor.
Definition Constraint.h:64
Definition Arg.h:58