|
Open Model Railroad Network (OpenMRN)
|
Go to the source code of this file.
Classes | |
| class | Fetcher< DATA_TYPE, N > |
| Used as an argument to the get(Fetcher) function in the OptionalArg implementation to select which entry to retrieve. More... | |
| class | Specifier< DATA_TYPE, N, defval > |
| Used as an argument to the constructor of the OptionalArg implementation to represent that a specific argument has to be overridden with a given value. More... | |
| class | OptionalArg< Decl > |
| Terminates the class recursion template. More... | |
| class | OptionalArg< Decl, Specifier, TArgs... > |
| Template recursion entry. More... | |
Macros | |
| #define | DECLARE_OPTIONALARG(SpecName, function_name, DataType, N, DEF) |
| Use this macro in the Defs structure of an optional args instance to add an optional argument. | |
| #define | DEFINE_OPTIONALARG(SpecName, function_name, DataType) |
| Use this macro in the final optionalargs structure. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Constexpr structure for storing a list of optional arguments to a function that needs to be optimized at compile time.
Definition in file OptionalArgs.hxx.
| #define DECLARE_OPTIONALARG | ( | SpecName, | |
| function_name, | |||
| DataType, | |||
| N, | |||
| DEF | |||
| ) |
Use this macro in the Defs structure of an optional args instance to add an optional argument.
| SpecName | Name by which the user will specify the given argument. Usually capitalized like a class. |
| function_name | function name by which to access the argument in the final structure. Usually lower_case like a function name. |
| DataType | C++ data type of the argument |
| N | A unique integer assigned to this argument in the current optionalargs instance (and its base classes). |
| DEF | Default value that should be returned from the structure if the user does not specify it. |
Definition at line 86 of file OptionalArgs.hxx.
| #define DEFINE_OPTIONALARG | ( | SpecName, | |
| function_name, | |||
| DataType | |||
| ) |
Use this macro in the final optionalargs structure.
Each entry in the Defs structure should have a definition with matching options.
| SpecName | same as in DECLARE_OPTIONALARG |
| function_name | same as in DECLARE_OPTIONALARG |
| DataType | same as in DECLARE_OPTIONALARG |
Definition at line 100 of file OptionalArgs.hxx.