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

◆ Enum() [5/6]

drama::gitarg::Enum< LookupClass, EnumType >::Enum ( drama::thread::TAction taction,
const sds::Id Id,
const std::string &  Name,
const int  Position,
const std::string &  Default,
const Flags  flags = Flags::Upper|Flags::Abbrev|Flags::KeepErr 
)
inline

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

This overload of the constructor should be used from threaded actions, it will lock access to DRAMA while it is fetching the value to ensure ERS messages from the lower level code are recorded against the action correctly.

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.

@depreciated A string as the default is no longer supported, You need to use an enum value as the default. The constructor will throw if you use default value which is not an empty string as behavior in that case is not defined. Status DRAMA2__GITARG_ENUM_INVDEF.

Parameters
tactionThreaded action pointer
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. If specified as an empty string, then the first enum value will be used, otherwise will throw (as it is not implemented correctly and you should use the alternative method with an enum based default.)
flagsWhich GIT Flags to apply. If you specify KeepErr, then an exception is thrown if the value in the SDS structure is invalid. If you don't specify KeepErr and and the SDS structure is invalid, then the enum value is set to the Invalid value.

References drama::CreateRunDramaTask(), drama::Default, and drama::gitarg::Enum< LookupClass, EnumType >::Get().