void NetworkAdapterList::RunSubnetCallbacks(MapNetworkAdapter& aMap, NetworkAdapter& aAdapter)
{
    AutoMutex a(iListenerLock);
    MapNetworkAdapter::iterator it = aMap.begin();
    while (it != aMap.end()) {
        it->second(aAdapter);
        it++;
    }
}
void NetworkAdapterList::RemoveSubnetListener(TUint aId, MapNetworkAdapter& aMap)
{
    iListenerLock.Wait();
    MapNetworkAdapter::iterator it = aMap.find(aId);
    if (it != aMap.end()) {
        aMap.erase(it);
    }
    iListenerLock.Signal();
}
Exemplo n.º 3
0
void NetworkAdapterList::RunSubnetCallbacks(MapNetworkAdapter& aMap, NetworkAdapter& aAdapter)
{
    AutoMutex a(iListenerLock);
    MapNetworkAdapter::iterator it = aMap.begin();
    while (it != aMap.end()) {
        LOG(kAdapterChange, "NetworkAdapterList::RunSubnetCallbacks - client is %s\n", it->second.iId);
        it->second.iFunctor(aAdapter);
        it++;
    }
}
TUint NetworkAdapterList::AddSubnetListener(FunctorNetworkAdapter aFunctor, MapNetworkAdapter& aMap)
{
    iListenerLock.Wait();
    TUint id = iNextListenerId;
    aMap.insert(std::pair<TUint,FunctorNetworkAdapter>(id, aFunctor));
    iNextListenerId++;
    iListenerLock.Signal();
    return id;
}
Exemplo n.º 5
0
TUint NetworkAdapterList::AddSubnetListener(FunctorNetworkAdapter aFunctor, const TChar* aId, MapNetworkAdapter& aMap)
{
    iListenerLock.Wait();
    TUint id = iNextListenerId;
    ListenerNetworkAdapter listener(aFunctor, aId);
    aMap.insert(std::pair<TUint, ListenerNetworkAdapter>(id, listener));
    iNextListenerId++;
    iListenerLock.Signal();
    return id;
}