optional_unlabeled_tracker.hpp
Go to the documentation of this file.
1 
11 /*****************************************************************************
12 ** Ifdefs
13 *****************************************************************************/
14 
15 #ifndef TCLAP_OPTIONAL_UNLABELED_TRACKER_H
16 #define TCLAP_OPTIONAL_UNLABELED_TRACKER_H
17 
18 #include <string>
19 
20 namespace ecl {
21 
22 class OptionalUnlabeledTracker
23 {
24 
25  public:
26 
27  static void check( bool req, const std::string& argName );
28 
29  static void gotOptional() { alreadyOptionalRef() = true; }
30 
31  static bool& alreadyOptional() { return alreadyOptionalRef(); }
32 
33  private:
34 
35  static bool& alreadyOptionalRef() { static bool ct = false; return ct; }
36 };
37 
38 
39 inline void OptionalUnlabeledTracker::check( bool req, const std::string& argName )
40 {
42  throw( SpecificationException(
43  "You can't specify ANY Unlabeled Arg following an optional Unlabeled Arg",
44  argName ) );
45 
46  if ( !req )
48 }
49 
50 }; // namespace ecl
51 
52 
53 #endif
static bool & alreadyOptionalRef()
static void check(bool req, const std::string &argName)
static bool & alreadyOptional()


xbot_node
Author(s): Roc, wangpeng@droid.ac.cn
autogenerated on Sat Oct 10 2020 03:28:13