Loading [MathJax]/extensions/tex2jax.js
CustomOptionType.hpp
1 #pragma once
2 
3 #include <opals/fwd.hpp>
4 
5 #if 0
6 #define OPALS_C_DOXY_COMMENT(Arg)\
7  /##** Arg *##/
8 #endif
9 
10 namespace opals
11 {
12  /**
13  \class CustomOptionType
14  \tparam Derived the custom parameter type implementation
15 
16  \brief Base class for all custom parameter types.
17 
18  Following the curiously recurring template pattern. Must be derived from.
19 
20  \author wk
21  \date 05.02.2011
22 
23  \internal
24  Derive your custom parameter type from opals::CustomOptionType with the custom parameter type as template argument,
25  if the data type's help shall be appended to a parameter's module-specific long help
26  - on the usage screen (--help optionName)
27  - in the Python doc-string.
28 
29  _syntax() will be appended to _help(), if
30  - it it returns a non-null pointer and
31  + the module binding is not python, or
32  + _exportsPythonType() returns false (see CustomOptionTypeGeneralDescription.hpp).
33 
34  You may also include the general help in your exception messages.
35  Must be derived from (protected destructor).
36  */
37 
38  template<class Derived>
40  {
41  public:
42  /// get general help on this type
43  static const char * _help(bool forDoxygen)
44  {
45  return Derived::help(forDoxygen);
46  }
47  /// get the syntax used for parsing this type
48  static const char * _syntax()
49  {
50  return Derived::syntax();
51  }
52  /// returns true if this type is exposed to Python as a custom type, false otherwise (if it is represented as Python-string)
53  static bool _exportsPythonType()
54  {
55  return Derived::exportsPythonType();
56  }
57  protected:
58  ///protected, must be derived from
60  };
61 }
62 
Base class for all custom parameter types.
Definition: CustomOptionType.hpp:39
static const char * _help(bool forDoxygen)
get general help on this type
Definition: CustomOptionType.hpp:43
Contains the public interface of OPALS.
Definition: AbsValueOrQuantile.hpp:8
static const char * _syntax()
get the syntax used for parsing this type
Definition: CustomOptionType.hpp:48
static bool _exportsPythonType()
returns true if this type is exposed to Python as a custom type, false otherwise (if it is represente...
Definition: CustomOptionType.hpp:53
~CustomOptionType()
protected, must be derived from
Definition: CustomOptionType.hpp:59