|
EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
A class to represent an egsinp single line input. More...
#include <egs_input_struct.h>
Public Member Functions | |
| EGS_SingleInput (string inputTag, bool isReq, const string desc, const vector< string > vals) | |
| Construct a single input inputTag. More... | |
| string | getTag () |
| Get the name of the input. | |
| bool | getRequired () |
| Get whether or not this input is required. | |
| void | addDependency (shared_ptr< EGS_SingleInput > inp, string val="", bool isAntiDependency=false) |
| Add a dependency for this input, by the name of inp. More... | |
| void | addDependency (shared_ptr< EGS_BlockInput > block, bool isAntiDependency=false) |
| Add a dependency on an input block (there can only be one). | |
| vector< shared_ptr< EGS_SingleInput > > | getDependencyInp () |
| Get a list of all the dependencies for this input. | |
| vector< string > | getDependencyVal () |
| Get a list of the required dependency values. | |
| vector< bool > | getDependencyAnti () |
| Get a list of whether or not these are anti-dependencies. | |
| shared_ptr< EGS_BlockInput > | getDependencyBlock () |
| Get the dependency block (can be only one). | |
| bool | getDependencyBlockAnti () |
| Get whether or not the block dependency is an anti-dependency. | |
| const vector< string > | getValues () |
| Get the list of possible values for this input. | |
| void | setValues (const vector< string > vals) |
| Set the list of possible values for this input. | |
| string | getDescription () |
| Get the description for this input. | |
A class to represent an egsinp single line input.
The EGS_SingleInput class is used to represent an egsinp input parameter. The class contains the ability to link whether or not this input is required, depending on a different single input parameter or input block. If there are only a few possible options, they can be set so that input values can be validated. A description of the input can also be provided.
Definition at line 60 of file egs_input_struct.h.
| EGS_SingleInput::EGS_SingleInput | ( | string | inputTag, |
| bool | isReq, | ||
| const string | desc, | ||
| const vector< string > | vals | ||
| ) |
Construct a single input inputTag.
The input by the name inputTag is optional when isReq is false. For cases where the input is only required depending on a different input, leave isReq false and then use addDependency(). A description can be provided in desc. A list of valid values for the input can be provided in vals.
Definition at line 434 of file egs_input_struct.cpp.
| void EGS_SingleInput::addDependency | ( | shared_ptr< EGS_SingleInput > | inp, |
| string | val = "", |
||
| bool | isAntiDependency = false |
||
| ) |
Add a dependency for this input, by the name of inp.
Optionally, the current input is only required if the dependency input has a value of val. If isAntiDependency is true, then the current input is required only if inp is not set.
Definition at line 443 of file egs_input_struct.cpp.
1.9.1