mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
Port broker::data variant usages to use CAF API directly
Old code still all worked, but made use of Broker functions which now just redirect to CAF ones.
This commit is contained in:
parent
4c072409f0
commit
9caad8a042
8 changed files with 125 additions and 118 deletions
|
@ -137,15 +137,15 @@ broker::data WriterBackend::WriterInfo::ToBroker() const
|
|||
|
||||
bool WriterBackend::WriterInfo::FromBroker(broker::data d)
|
||||
{
|
||||
if ( ! broker::is<broker::vector>(d) )
|
||||
if ( ! caf::holds_alternative<broker::vector>(d) )
|
||||
return false;
|
||||
|
||||
auto v = broker::get<broker::vector>(d);
|
||||
auto bpath = broker::get_if<std::string>(v[0]);
|
||||
auto brotation_base = broker::get_if<double>(v[1]);
|
||||
auto brotation_interval = broker::get_if<double>(v[2]);
|
||||
auto bnetwork_time = broker::get_if<double>(v[3]);
|
||||
auto bconfig = broker::get_if<broker::table>(v[4]);
|
||||
auto v = caf::get<broker::vector>(d);
|
||||
auto bpath = caf::get_if<std::string>(&v[0]);
|
||||
auto brotation_base = caf::get_if<double>(&v[1]);
|
||||
auto brotation_interval = caf::get_if<double>(&v[2]);
|
||||
auto bnetwork_time = caf::get_if<double>(&v[3]);
|
||||
auto bconfig = caf::get_if<broker::table>(&v[4]);
|
||||
|
||||
if ( ! (bpath && brotation_base && brotation_interval && bnetwork_time && bconfig) )
|
||||
return false;
|
||||
|
@ -157,8 +157,8 @@ bool WriterBackend::WriterInfo::FromBroker(broker::data d)
|
|||
|
||||
for ( auto i : *bconfig )
|
||||
{
|
||||
auto k = broker::get_if<std::string>(i.first);
|
||||
auto v = broker::get_if<std::string>(i.second);
|
||||
auto k = caf::get_if<std::string>(&i.first);
|
||||
auto v = caf::get_if<std::string>(&i.second);
|
||||
|
||||
if ( ! (k && v) )
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue