Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2015, 1:37:50 PM (9 years ago)
Author:
landauf
Message:

moved static maps from NetworkFunctionStatic and NetworkMemberFunctionBase to NetworkFunctionManager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/network/NetworkFunctionManager.cc

    r10469 r10471  
    3232namespace orxonox
    3333{
     34    std::map<NetworkFunctionPointer, NetworkFunctionBase*> NetworkFunctionManager::functorMap_;
     35    std::map<uint32_t, NetworkFunctionBase*> NetworkFunctionManager::idMap_;
     36
    3437    /* static */NetworkFunctionManager& NetworkFunctionManager::getInstance()
    3538    {
     
    5861        return nameMap_;
    5962    }
     63
     64    /*static*/NetworkFunctionBase* NetworkFunctionManager::getFunction(const NetworkFunctionPointer& p)
     65    {
     66        std::map<NetworkFunctionPointer, NetworkFunctionBase*>::iterator it = functorMap_.find(p);
     67        assert(it != functorMap_.end());
     68        return it->second;
     69    }
     70
     71    /*static*/NetworkFunctionBase* NetworkFunctionManager::getFunction(uint32_t id)
     72    {
     73        std::map<uint32_t, NetworkFunctionBase*>::iterator it = idMap_.find(id);
     74        assert(it != idMap_.end());
     75        return it->second;
     76    }
    6077}
Note: See TracChangeset for help on using the changeset viewer.