2 #include "ErrorHandler/MessageAnalyzer/ma_participants.h"
7 using namespace novadaq::errorhandler;
12 void ma_participants::add_group( std::string
const & group )
14 groups_t::const_iterator it = groups.find(group);
16 if( it!=groups.end() )
17 throw std::runtime_error( group +
" already exists while creating new group");
20 groups.insert( std::make_pair(group, apps) );
23 void ma_participants::add_group( std::string
const & group,
size_t size )
25 groups_t::const_iterator it = groups.find(group);
27 if( it!=groups.end() )
28 throw std::runtime_error( group +
" already exists while creating new group");
33 for(
size_t i=0; i<size; ++i )
37 apps.insert( ss.str() );
38 all_apps.insert( ss.str() );
41 groups.insert( std::make_pair(group, apps) );
47 void ma_participants::add_participant( std::string
const & group
48 , std::string
const & app )
50 groups_t::iterator it = groups.find(group);
52 if( it==groups.end() )
53 throw std::runtime_error( group +
" does not exist while inserting participants");
55 it->second.insert(app);
59 void ma_participants::add_participant( std::string
const & app )
61 ungrouped_apps.insert(app);
68 size_t ma_participants::
69 get_group_participant_count( std::string
const & group )
const
71 groups_t::const_iterator it = groups.find(group);
73 if( it==groups.end() )
74 throw std::runtime_error( group +
" does not exist while getting participant count");
76 return it->second.size();
79 size_t ma_participants::
80 get_participant_count( )
const
82 return all_apps.size();
88 void ma_participants::reset( )
90 ungrouped_apps.clear();