Refactor misc. Supervisor code

E.g. mostly to start taking advantage of C++17 things like
std::optional.  Also IntrusivePtr.
This commit is contained in:
Jon Siwek 2019-11-05 19:29:43 -08:00
parent c43ffc14fe
commit 8aa77436f9
5 changed files with 116 additions and 121 deletions

View file

@ -148,7 +148,8 @@ void net_update_time(double new_network_time)
void net_init(const std::vector<std::string>& interfaces,
const std::vector<std::string>& pcap_input_files,
const std::string& pcap_output_file, bool do_watchdog)
const std::optional<std::string>& pcap_output_file,
bool do_watchdog)
{
if ( ! pcap_input_files.empty() )
{
@ -189,9 +190,9 @@ void net_init(const std::vector<std::string>& interfaces,
// a timer.
reading_traces = reading_live = 0;
if ( ! pcap_output_file.empty() )
if ( pcap_output_file )
{
const char* writefile = pcap_output_file.data();
const char* writefile = pcap_output_file->data();
pkt_dumper = iosource_mgr->OpenPktDumper(writefile, false);
assert(pkt_dumper);