@@ -57,10 +57,19 @@ WrapperDevice::WrapperDevice(int verbosity)
5757WrapperDevice::~WrapperDevice ()
5858= default ;
5959
60+ constexpr const char * WrapperDevice::OptionKeys[];
61+
6062bpo::options_description WrapperDevice::GetOptionsDescription ()
6163{
6264 // assemble the options for the device class and component
6365 bpo::options_description od (" WrapperDevice options" );
66+ od.add_options ()
67+ (OptionKeys[OptionKeyPollPeriod],
68+ bpo::value<int >()->default_value (10 ),
69+ " polling period" )
70+ ((std::string (OptionKeys[OptionKeyDryRun]) + " ,n" ).c_str (),
71+ bpo::value<bool >()->zero_tokens ()->default_value (false ),
72+ " skip component processing" );
6473 od.add (Component::GetOptionsDescription ());
6574 return od;
6675}
@@ -84,13 +93,13 @@ void WrapperDevice::InitTask()
8493 // option_description entires, but options_description does not
8594 // provide such a functionality
8695 vector<std::string> argstrings;
87- bpo::options_description descriptions = GetOptionsDescription ();
96+ bpo::options_description componentOptionDescriptions = Component:: GetOptionsDescription ();
8897 const auto * config = GetConfig ();
8998 if (config) {
9099 const auto varmap = config->GetVarMap ();
91100 for (const auto varit : varmap) {
92101 // check if this key belongs to the options of the device
93- const auto * description = descriptions .find_nothrow (varit.first , false );
102+ const auto * description = componentOptionDescriptions .find_nothrow (varit.first , false );
94103 if (description && varmap.count (varit.first ) && !varit.second .defaulted ()) {
95104 argstrings.push_back (" --" );
96105 argstrings.back () += varit.first ;
@@ -109,6 +118,8 @@ void WrapperDevice::InitTask()
109118 }
110119 }
111120 }
121+ mPollingPeriod = config->GetValue <int >(OptionKeys[OptionKeyPollPeriod]);
122+ mSkipProcessing = config->GetValue <bool >(OptionKeys[OptionKeyDryRun]);
112123 }
113124
114125 // TODO: probably one can get rid of this option, the instance/device
0 commit comments