Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
option_macros.hh
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file basic/options/option_macros.hh
11 /// @brief macros to define options on a per-application basis at the top of app files (those with main)
12 /// @details macros to define options on a per-application basis at the top of app files (those with main). Used in place of putting the options in the option system proper for single-use / silly / testing stuff
13 /// @author Oliver Lange
14 
15 #ifndef INCLUDED_basic_options_option_macros_hh
16 #define INCLUDED_basic_options_option_macros_hh
17 
18 #include <basic/options/option.hh>
21 
22 #include <platform/types.hh>
23 #include <utility/Bound.fwd.hh>
24 #include <utility/Bound.hh>
25 #include <utility/down_cast.hh>
26 #include <utility/exit.hh>
27 #include <utility/vector1.fwd.hh>
28 #include <utility/vector1.hh>
29 #include <utility/vector1_bool.hh>
30 #include <utility/vectorL.fwd.hh>
31 #include <utility/vectorL.hh>
33 #include <utility/vectorL_bool.hh>
35 #include <utility/file/FileName.hh>
37 #include <utility/file/PathName.hh>
39 #include <utility/keys/AutoKey.hh>
40 #include <utility/keys/Key.fwd.hh>
41 #include <utility/keys/Key.hh>
46 #include <utility/keys/NoClient.hh>
131 #include <ObjexxFCL/TypeTraits.hh>
134 #include <algorithm>
135 #include <cassert>
136 #include <cstddef>
137 #include <cstdlib>
138 #include <iomanip>
139 #include <iosfwd>
140 #include <iostream>
141 #include <list>
142 #include <map>
143 #include <set>
144 #include <sstream>
145 #include <string>
146 #include <utility>
147 #include <vector>
148 
149 
150 #define OPT(akey) \
151  basic::options::option.add_relevant( basic::options::OptionKeys::akey )
152 
153 #define NEW_OPT(akey,help,adef) \
154  basic::options::option.add( basic::options::OptionKeys::akey , help ).def( adef ); \
155  OPT( akey )
156 
157 // option macros for Vector options with multiple default values...
158 #define NEW_OPT2(akey,help,adef,adef2) \
159  basic::options::option.add( basic::options::OptionKeys::akey , help ).def( adef ).def( adef2 ); \
160  OPT( akey )
161 
162 #define NEW_OPT3(akey,help,adef,adef2,adef3) \
163  basic::options::option.add( basic::options::OptionKeys::akey , help ).def( adef ).def( adef2 ).def(adef3); \
164  OPT( akey )
165 
166 #define NEW_OPT4(akey,help,adef,adef2,adef3,adef4) \
167  basic::options::option.add( basic::options::OptionKeys::akey , help ).def( adef ).def( adef2 ).def(adef3).def(adef4); \
168  OPT( akey )
169 
170 #define NEW_OPT5(akey,help,adef,adef2,adef3,adef4,adef5) \
171  basic::options::option.add( basic::options::OptionKeys::akey , help ).def( adef ).def( adef2 ).def(adef3).def(adef4).def(adef5); \
172  OPT( akey )
173 
174 #define NEW_OPT6(akey,help,adef,adef2,adef3,adef4,adef5,adef6) \
175  basic::options::option.add( basic::options::OptionKeys::akey , help ).def( adef ).def( adef2 ).def(adef3).def(adef4).def(adef5).def(adef6); \
176  OPT( akey )
177 
178 #define NEW_OPT7(akey,help,adef,adef2,adef3,adef4,adef5,adef6,adef7) \
179  basic::options::option.add( basic::options::OptionKeys::akey , help ).def( adef ).def( adef2 ).def(adef3).def(adef4).def(adef5).def(adef6).def(adef7); \
180  OPT( akey )
181 
182 #define NEW_OPT8(akey,help,adef,adef2,adef3,adef4,adef5,adef6,adef7,adef8) \
183  basic::options::option.add( basic::options::OptionKeys::akey , help ).def( adef ).def( adef2 ).def(adef3).def(adef4).def(adef5).def(adef6).def(adef7).def(adef8); \
184  OPT( akey )
185 
186 #define NEW_OPT9(akey,help,adef,adef2,adef3,adef4,adef5,adef6,adef7,adef8,adef9) \
187  basic::options::option.add( basic::options::OptionKeys::akey , help ).def( adef ).def( adef2 ).def(adef3).def(adef4).def(adef5).def(adef6).def(adef7).def(adef8).def(adef9); \
188  OPT( akey )
189 
190 #define NEW_OPT10(akey,help,adef,adef2,adef3,adef4,adef5,adef6,adef7,adef8,adef9,adef10) \
191  basic::options::option.add( basic::options::OptionKeys::akey , help ).def( adef ).def( adef2 ).def(adef3).def(adef4).def(adef5).def(adef6).def(adef7).def(adef8).def(adef9).def(adef10); \
192  OPT( akey )
193 
194 #define OPT_KEY( type, key ) \
195  namespace basic { namespace options { namespace OptionKeys { \
196  basic::options::type##OptionKey const key( #key ); \
197  }}}
198 
199 #define OPT_1GRP_KEY( type, grp, key ) \
200  namespace basic { namespace options { namespace OptionKeys { namespace grp { \
201  basic::options::type##OptionKey const key( #grp":"#key ); \
202  }}}}
203 
204 
205 #define OPT_2GRP_KEY( type, grp1, grp2, key ) \
206  namespace basic { namespace options { namespace OptionKeys { namespace grp1 { namespace grp2 { \
207  basic::options::type##OptionKey const key( #grp1":"#grp2":"#key ); \
208  }}}}}
209 
210 #define OPT_3GRP_KEY( type, grp1, grp2, grp3, key ) \
211  namespace basic { namespace options { namespace OptionKeys { namespace grp1 { namespace grp2 { namespace grp3 { \
212  basic::options::type##OptionKey const key( #grp1":"#grp2":"#grp3":"#key ); \
213  }}}}}}
214 
215 
216 #define EXTERN_OPT_KEY( type, key ) \
217  namespace basic { namespace options { namespace OptionKeys { \
218  extern basic::options::type##OptionKey const key; \
219  }}}
220 
221 #define EXTERN_OPT_1GRP_KEY( type, grp, key ) \
222  namespace basic { namespace options { namespace OptionKeys { namespace grp { \
223  extern basic::options::type##OptionKey const key; \
224  }}}}
225 
226 #define EXTERN_OPT_2GRP_KEY( type, grp1, grp2, key ) \
227  namespace basic { namespace options { namespace OptionKeys { namespace grp1 { namespace grp2 { \
228  extern basic::options::type##OptionKey const key; \
229  }}}}}
230 
231 #define EXTERN_OPT_3GRP_KEY( type, grp1, grp2, grp3, key ) \
232  namespace basic { namespace options { namespace OptionKeys { namespace grp1 { namespace grp2 { namespace grp3 { \
233  extern basic::options::type##OptionKey const key; \
234  }}}}}}
235 
236 
237 #endif
Program file option class.
utility::options::IntegerOption forward declarations
Automatic hidden index key for file options.
Automatic hidden index key for integer options.
Automatic hidden index key for file options.
Program path option class.
Fast polymorphic down-casting functions.
utility::vectorL forward declarations
utility::options::AnyOptionKey forward declarations
Keyed-access vector with key subset map.
utility::options::StringVectorOption forward declarations
utility::options::BooleanOption forward declarations
utility::keys::NoClient forward declarations
utility::file::FileName forward declarations
vector1: std::vector with 1-based indexing: bool specialization
utility::options::OptionKeys collection
utility::options::OptionKey forward declarations
utility::options::RealVectorOptionKey forward declarations
Automatic hidden index key for string options.
utility::options::FileOptionKey forward declarations
Program file vector option class.
utility::options::RealOption forward declarations
Program real option class.
utility::options::IntegerOptionKey forward declarations
Program options collection.
Automatic hidden index key for any vector-valued options.
utility::keys::KeyLookup forward declarations
Program scalar-valued option interface class.
Program string vector option class.
utility::options::PathOptionKey forward declarations
utility::file::PathName forward declarations
Variant option class.
Automatic hidden index key for real options.
Program string option class.
Program vector-valued option abstract base class.
utility::options::BooleanVectorOption forward declarations
utility::keys::SmallKeyVector forward declarations
utility::options::VectorOption forward declarations
Abstract automatic hidden index key for scalar-valued options.
Automatic hidden index key for integer options.
utility::options::ScalarOption forward declarations
Program boolean option class.
Program scalar-valued option abstract base class.
utility::options::PathOption forward declarations
Key lookup map and collection and functors.
Abstract automatic hidden index key for options.
Program option interface class.
Variant key class.
utility::options::FileVectorOptionKey forward declarations
utility::options::FileVectorOption forward declarations
utility::options::AnyVectorOption forward declarations
utility::options::BooleanVectorOptionKey forward declarations
utility::keys::VariantKey forward declarations
utility::options::AnyOption forward declarations
utility::options::StringOption forward declarations
utility::options::Option forward declarations
Automatic hidden index key for boolean options.
Program path vector option class.
Bound value class.
Program any vector-valued option abstract base class.
Abstract automatic hidden index key for vector-valued options.
Program exit functions and macros.
utility::options::ScalarOptionKey forward declarations
basic::options::OptionKeys collection
vectorL: std::vector with L-based indexing
vectorL: std::vector with L-based indexing: bool specialization
Program boolean vector option class.
utility::options::StringVectorOptionKey forward declarations
File name class supporting Windows and UN*X/Linux format names.
utility::keys::KeyLess forward declarations
utility::options::PathVectorOption forward declarations
vectorL lower index selectors
utility::options::VectorOptionKey forward declarations
utility::keys::UserKey forward declarations
Automatic hidden index key for boolean options.
utility::keys::Key forward declarations
Automatic hidden index key for string options.
Program real vector option class.
utility::options::RealOptionKey forward declarations
Option lookup functions emulating Rosetta++ equivalents for transitional use.
utility::Bound forward declarations
utility::options::IntegerVectorOption forward declarations
Program any scalar-valued option abstract base class.
utility::options::BooleanOptionKey forward declarations
Program integer option class.
utility::options::IntegerVectorOptionKey forward declarations
utility::options::FileOption forward declarations
utility::options::StringOptionKey forward declarations
Path name class supporting Windows and UN*X/Linux format names.
utility::options::PathVectorOptionKey forward declarations
vector1: std::vector with 1-based indexing
Program integer vector option class.
utility::options::ScalarOption_T_ forward declarations
utility::options::RealVectorOption forward declarations
Hidden index key interface class.
utility::options::AnyVectorOptionKey forward declarations
utility::options::VariantOption forward declarations
utility::options::VectorOption_T_ forward declarations
Default key policy class when no client is needed to distinguish key type.
Program options global and initialization function.
Program vector-valued option interface class.
Automatic hidden index key abstract base class.
utility::vector1 forward declarations
Automatic hidden index key for real options.
Automatic hidden index key for path options.
utility::options package keys declarations
utility::options::OptionCollection forward declarations
utility::keys::AutoKey forward declarations
Automatic hidden index key for any scalar-valued options.
Automatic hidden index key for path options.