Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 26, 2010, 6:41:19 PM (14 years ago)
Author:
scheusso
Message:

cleaning up function calls a bit in order to buffer calls for not (yet) existing objects

File:
1 copied

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/network/FunctionCall.h

    r7489 r7490  
    2727 */
    2828
    29 #ifndef _FunctionCalls_H__
    30 #define _FunctionCalls_H__
     29#ifndef _FunctionCall_H__
     30#define _FunctionCall_H__
    3131
    3232#include "network/NetworkPrereqs.h"
     33#include "util/UtilPrereqs.h"
    3334
    3435#include <cassert>
    35 #include "util/UtilPrereqs.h"
    36 #include "Packet.h"
     36#include <vector>
    3737
    3838namespace orxonox {
    39 
    40 namespace packet {
    4139/**
    4240    @author
     
    4442
    4543
    46 class _NetworkExport FunctionCalls : public Packet
     44class _NetworkExport FunctionCall
    4745{
    4846public:
    49   FunctionCalls();
    50   FunctionCalls( uint8_t* data, unsigned int clientID );
    51   ~FunctionCalls();
     47  FunctionCall();
     48  ~FunctionCall();
    5249
    53   inline unsigned int getSize() const
    54     { assert(!this->isDataENetAllocated()); return currentSize_; }
    55   bool process();
     50  inline unsigned int getSize() const { return this->size_; }
     51  bool execute();
    5652
    57   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);
    58   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);
     53  void setCallStatic( uint32_t networkID, const MultiType* mt1=0, const MultiType* mt2=0, const MultiType* mt3=0, const MultiType* mt4=0, const MultiType* mt5=0);
     54  void setCallMember( 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);
     55 
     56  void saveData( uint8_t*& mem );
     57  void loadData( uint8_t*& mem );
    5958private:
    60   uint32_t nrOfCalls_;
    61   unsigned int clientID_;
    62   uint32_t currentSize_;
    63   uint32_t currentMemBlocks_; // this saves the number of memory blocks (of size FUNCTIONCALLS_MEM_ALLOCATION) allocated
     59  uint32_t                  nrOfArguments_;
     60  bool                      bIsStatic_;
     61  uint32_t                  functionID_;
     62  uint32_t                  objectID_;
     63  uint32_t                  size_;
     64  std::vector<MultiType>    arguments_;
    6465};
    6566
    66 } //namespace packet
    6767} //namespace orxonox
    6868
Note: See TracChangeset for help on using the changeset viewer.