Utils::now() removal and a bunch of compile fixes.

This commit is contained in:
Adam Ierymenko 2015-04-08 15:26:45 -07:00
parent ee2f51f48e
commit bf2ff964e1
9 changed files with 67 additions and 49 deletions

View file

@ -40,7 +40,6 @@
#include "Constants.hpp"
#include "NonCopyable.hpp"
#include "Utils.hpp"
#include "Address.hpp"
#include "Mutex.hpp"
#include "SharedPtr.hpp"
@ -230,18 +229,7 @@ public:
* @param bytes Size of packet
* @return True if packet is within budget
*/
inline bool updateAndCheckMulticastBalance(const MulticastGroup &mg,unsigned int bytes)
{
Mutex::Lock _l(_lock);
if (!_config)
return false;
std::map< MulticastGroup,BandwidthAccount >::iterator bal(_multicastRateAccounts.find(mg));
if (bal == _multicastRateAccounts.end()) {
NetworkConfig::MulticastRate r(_config->multicastRate(mg));
bal = _multicastRateAccounts.insert(std::pair< MulticastGroup,BandwidthAccount >(mg,BandwidthAccount(r.preload,r.maxBalance,r.accrual))).first;
}
return bal->second.deduct(bytes);
}
bool updateAndCheckMulticastBalance(const MulticastGroup &mg,unsigned int bytes);
/**
* Get current network config or throw exception