Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 4, 2015, 9:12:21 PM (9 years ago)
Author:
landauf
Message:

merged branch core7 back to trunk

Location:
code/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/network/packet/FunctionCalls.cc

    r8351 r10624  
    8282}
    8383
    84 void FunctionCalls::addCallStatic( uint32_t networkID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5)
     84void FunctionCalls::addCall( uint32_t networkID, uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5)
    8585{
    8686  assert(!isDataENetAllocated());
    8787 
    8888  this->functionCalls_.push(orxonox::FunctionCall());
    89   this->functionCalls_.back().setCallStatic( networkID, mt1, mt2, mt3, mt4, mt5 );
    90   this->currentSize_ += this->functionCalls_.back().getSize();
    91 }
    92 
    93 void FunctionCalls::addCallMember( uint32_t networkID, uint32_t objectID, const MultiType* mt1, const MultiType* mt2, const MultiType* mt3, const MultiType* mt4, const MultiType* mt5)
    94 {
    95   assert(!isDataENetAllocated());
    96  
    97   this->functionCalls_.push(orxonox::FunctionCall());
    98   this->functionCalls_.back().setCallMember( networkID, objectID, mt1, mt2, mt3, mt4, mt5 );
     89  this->functionCalls_.back().setCall( networkID, objectID, mt1, mt2, mt3, mt4, mt5 );
    9990  this->currentSize_ += this->functionCalls_.back().getSize();
    10091}
  • code/trunk/src/libraries/network/packet/FunctionCalls.h

    r7801 r10624  
    5656  virtual bool process(orxonox::Host* host);
    5757
    58   void addCallStatic( uint32_t networkID, const MultiType* mt1=0, const MultiType* mt2=0, const MultiType* mt3=0, const MultiType* mt4=0, const MultiType* mt5=0);
    59   void addCallMember( uint32_t networkID, uint32_t objectID, const MultiType* mt1=0, const MultiType* mt2=0, const MultiType* mt3=0, const MultiType* mt4=0, const MultiType* mt5=0);
     58  void addCall( uint32_t networkID, uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5);
    6059  virtual bool send(orxonox::Host* host);
    6160private:
  • code/trunk/src/libraries/network/packet/FunctionIDs.cc

    r9667 r10624  
    3737#include "core/object/ObjectList.h"
    3838#include "network/NetworkFunction.h"
     39#include "network/NetworkFunctionManager.h"
    3940
    4041namespace orxonox {
     
    5556
    5657  //calculate total needed size (for all strings and integers)
    57   ObjectList<NetworkFunctionBase>::iterator it;
    58   for(it = ObjectList<NetworkFunctionBase>::begin(); it; ++it)
     58  const std::set<NetworkFunctionBase*>& set = NetworkFunctionManager::getInstance().getAllFunctions();
     59  std::set<NetworkFunctionBase*>::const_iterator it;
     60  for (it = set.begin(); it != set.end(); ++it)
    5961  {
    60     const std::string& functionname = it->getName();
    61     networkID = it->getNetworkID();
     62    const std::string& functionname = (*it)->getName();
     63    networkID = (*it)->getNetworkID();
    6264    // now push the network id and the classname to the stack
    6365    tempQueue.push( std::pair<unsigned int, std::string>(networkID, functionname) );
     
    126128  unsigned char *functionname;
    127129
     130  //clear the map of network ids
     131  NetworkFunctionManager::getInstance().clearNetworkIDs();
     132
    128133  orxout(verbose, context::packets) << "=== processing functionids: " << endl;
    129134  std::pair<uint32_t, std::string> tempPair;
     
    138143    functionname = temp+2*sizeof(uint32_t);
    139144    orxout(internal_info, context::packets) << "processing functionid: " << networkID << " name: " << functionname << endl;
    140     NetworkFunctionBase::setNetworkID((const char*)functionname, networkID);
     145    NetworkFunctionManager::getInstance().getFunctionByName((const char*)functionname)->setNetworkID(networkID);
    141146    temp += 2*sizeof(uint32_t) + stringsize;
    142147  }
Note: See TracChangeset for help on using the changeset viewer.