I know this is safer, but what's the reason why not to add also UBusServer::UnregisterInterest(std::string const& name) as it used to be?
[NVM, I've noticed that now there's only just one static UBusServer: +1].
1034 + for (unsigned i = 0; i < dispatched_msgs.size(); i++)
Use ++i or just a foreach loop.
1221 + // we don't want to modify a container while iterating it
1222 + std::set<unsigned> ids_copy(connection_ids_);
1223 + for (auto it = ids_copy.begin(); it != ids_copy.end(); ++it)
1224 + {
1225 + UnregisterInterest(*it);
1226 + }
this is also safe:
for (auto it = ids_copy.begin(); it != ids_copy.end();)
{
UnregisterInterest(*(it++));
}
1317 + static std::unique_ptr<UBusServer> server;
You can just use an stack allocated server here, just remember to add this to the .cpp file:
// initialize the global static server
UBusServer UBusManager::server;
PS: add yourself to to authors, so people will bother you when on troubles ;-D
1006 + msg_queue_ .insert( std::pair< int, std::pair< std::string, glib::Variant> >(prio, std::pair< std::string, glib::Variant> (message_ name, args)));
It can be just std::make_ pair(prio, std::make_ pair(message_ name, args))
1009 + auto src_nick = boost:: lexical_ cast<std: :string> (static_ cast<int> (prio)) ;
No need for it with C++11, just use std::to_ string( prio); also use auto const& when possible.
985 + for (auto it = interests_.begin(); it != interests_.end(); ++it)
Not tried, but I guess that also the multimaps, would handle nicely a for (auto const& : interests_) foreach loop.
983 +void UBusServer: :UnregisterInte rest(unsigned connection_id)
I know this is safer, but what's the reason why not to add also UBusServer: :UnregisterInte rest(std: :string const& name) as it used to be?
[NVM, I've noticed that now there's only just one static UBusServer: +1].
1034 + for (unsigned i = 0; i < dispatched_ msgs.size( ); i++)
Use ++i or just a foreach loop.
1221 + // we don't want to modify a container while iterating it connection_ ids_); est(*it) ;
1222 + std::set<unsigned> ids_copy(
1223 + for (auto it = ids_copy.begin(); it != ids_copy.end(); ++it)
1224 + {
1225 + UnregisterInter
1226 + }
this is also safe: erest(* (it++)) ;
for (auto it = ids_copy.begin(); it != ids_copy.end();)
{
UnregisterInt
}
1317 + static std::unique_ ptr<UBusServer> server;
You can just use an stack allocated server here, just remember to add this to the .cpp file: :server;
// initialize the global static server
UBusServer UBusManager:
PS: add yourself to to authors, so people will bother you when on troubles ;-D