AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface

◆ Bool() [2/3]

drama::gitarg::Bool::Bool ( const sds::Id Id,
const std::string &  Name = "Argument1",
const int  Position = 1,
const bool  Default = false,
const Flags  flags = (Flags::Upper|Flags::Abbrev|Flags::KeepErr) 
)
inline

Constructor which constructs the value from an item in an SDS structure.

The value is fetched from the named item (arg #2) within the SDS structure specified. or the Position (constructor arg #3) item in the
structure if the item named does not exist.

Warning
Does not call a sub-class Lookup() function to get the strings. If the sub-class has a Lookup() function, use a simple constructor followed by an explicit invocation of the Get() method. (This is because C++ constructors will never invoke a sub-class method)
Note
The DRAMA lock must be taken when executing this. If in a thread, the preference is to take it by constructing a drama::AccessDrama object to ensure the action context is correct. An alternative overload of this method will take the lock itself.
Parameters
IdThe SDS structure.
NameThe name of the item within the structure.
PositionIf the item does not exist by the name, then presume this position.
DefaultThe default value.
flagsWhich GIT Flags to apply. If you specify KeepErr, then an exception is throw if the value in the SDS structure is invalid. If you don't specify KeepErr and and the SDS structure does not contain a value item, then the value is set to the supplied default.

References drama::CreateRunDramaTask(), drama::Default, and Get().