Example #1
0
  std::vector<fsw_event_flag> monitor::filter_flags(const event& evt) const
  {
    // If there is nothing to filter, just return the original vector.
    if (event_type_filters.empty()) return evt.get_flags();

    std::vector<fsw_event_flag> filtered_flags;

    for (auto const& flag : evt.get_flags())
    {
      if (accept_event_type(flag)) filtered_flags.push_back(flag);
    }

    return filtered_flags;
  }
Example #2
0
static void print_event_flags(const event & evt)
{
  const vector<fsw_event_flag> & flags = evt.get_flags();

  if (nflag)
  {
    int mask = 0;
    for (const fsw_event_flag &flag : flags)
    {
      mask += static_cast<int> (flag);
    }

    cout << mask;
  }
  else
  {
    for (size_t i = 0; i < flags.size(); ++i)
    {
      cout << flags[i];

      // Event flag separator is currently hard-coded.
      if (i != flags.size() - 1) cout << event_flag_separator;
    }
  }
}