Main MRPT website
>
C++ reference for MRPT 1.4.0
mrpt
otherlibs
tclap
Constraint.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: Constraint.h
13
*
14
* Copyright (c) 2005, 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_CONSTRAINT_H
31
#define TCLAP_CONSTRAINT_H
32
33
#include <string>
34
#include <vector>
35
#include <list>
36
#include <iostream>
37
#include <iomanip>
38
#include <algorithm>
39
40
namespace
TCLAP
{
41
42
/**
43
* The interface that defines the interaction between the Arg and Constraint.
44
*/
45
template
<
class
T>
46
class
Constraint
47
{
48
49
public
:
50
/**
51
* Returns a description of the Constraint.
52
*/
53
virtual
std::string
description
()
const
=0;
54
55
/**
56
* Returns the short ID for the Constraint.
57
*/
58
virtual
std::string
shortID
()
const
=0;
59
60
/**
61
* The method used to verify that the value parsed from the command
62
* line meets the constraint.
63
* \param value - The value that will be checked.
64
*/
65
virtual
bool
check
(
const
T& value)
const
=0;
66
67
/**
68
* Destructor.
69
* Silences warnings about Constraint being a base class with virtual
70
* functions but without a virtual destructor.
71
*/
72
virtual
~Constraint
() { ; }
73
};
74
75
}
//namespace TCLAP
76
#endif
TCLAP::Constraint::check
virtual bool check(const T &value) const =0
The method used to verify that the value parsed from the command line meets the constraint.
TCLAP::Constraint::shortID
virtual std::string shortID() const =0
Returns the short ID for the Constraint.
TCLAP::Constraint::description
virtual std::string description() const =0
Returns a description of the Constraint.
TCLAP
Definition:
Arg.h:44
TCLAP::Constraint::~Constraint
virtual ~Constraint()
Destructor.
Definition:
Constraint.h:108
Page generated by
Doxygen 1.8.17
for MRPT 1.4.0 SVN: at Tue Mar 3 09:15:16 UTC 2020