MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / Lock

Method Lock

cpp/src/Options.cpp:364–400  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Read all the option XMLs and Command Lines, and lock their values. -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

362// Read all the option XMLs and Command Lines, and lock their values.
363//-----------------------------------------------------------------------------
364bool Options::Lock
365(
366)
367{
368 if( m_locked )
369 {
370 Log::Write( LogLevel_Error, "Options are already final (locked)." );
371 return false;
372 }
373
374 ParseOptionsXML( m_SystemPath + m_xml );
375 ParseOptionsXML( m_LocalPath + m_xml);
376 ParseOptionsString( m_commandLine );
377 m_locked = true;
378
379 /* Log our Configured Options */
380 map<string,Option*>::iterator it;
381 Log::Write( LogLevel_Info, "Options:");
382 for (it = m_options.begin(); it != m_options.end(); it++) {
383 Option *opt = it->second;
384 switch (opt->m_type) {
385 case OptionType_Bool:
386 Log::Write( LogLevel_Info, "\t%s: %s", it->first.c_str(), opt->m_valueBool == true ? "true" : "false");
387 break;
388 case OptionType_Int:
389 Log::Write( LogLevel_Info, "\t%s: %d", it->first.c_str(), opt->m_valueInt);
390 break;
391 case OptionType_String:
392 Log::Write( LogLevel_Info, "\t%s: %s", it->first.c_str(), opt->m_valueString.c_str());
393 break;
394 case OptionType_Invalid:
395 Log::Write( LogLevel_Info, "\t%s: Invalid Type");
396 break;
397 }
398 }
399 return true;
400}
401
402//-----------------------------------------------------------------------------
403// <Options::ParseOptionsString>

Callers 15

AddWatcherMethod · 0.45
RemoveWatcherMethod · 0.45
NotifyWatchersMethod · 0.45
~DriverMethod · 0.45
InitMethod · 0.45
SendMsgMethod · 0.45
WriteNextMsgMethod · 0.45
EnablePollMethod · 0.45
DisablePollMethod · 0.45

Calls 4

WriteFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected