Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 19, 2015, 11:40:28 AM (9 years ago)
Author:
muemart
Message:

Run clang-modernize -add-override
A few notes:

  • There are probably some overrides missing, especially in funky templatey code
  • Virtual methods with wrong signatures were not fixed, needs to be done by hand (only warnings get emitted)
Location:
code/branches/cpp11_v2/src/libraries/network
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/network/Client.h

    r8858 r10817  
    7676    static Client* getInstance(){ return singletonPtr_s; } // tolua_export
    7777
    78     bool establishConnection();
     78    bool establishConnection() override;
    7979    void setDestination( const std::string& serverAddress, unsigned int port ); // tolua_export
    80     bool closeConnection();
    81     void queuePacket(ENetPacket* packet, int clientID, uint8_t channelID);
    82     virtual bool sendPacket( packet::Packet* packet ){ return packet->send( static_cast<Host*>(this) ); }
    83     virtual void doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
    84     virtual void doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
    85     virtual void printRTT();
     80    bool closeConnection() override;
     81    void queuePacket(ENetPacket* packet, int clientID, uint8_t channelID) override;
     82    virtual bool sendPacket( packet::Packet* packet ) override{ return packet->send( static_cast<Host*>(this) ); }
     83    virtual void doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID) override;
     84    virtual void doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID) override;
     85    virtual void printRTT() override;
    8686
    8787    void update(const Clock& time);
    8888  protected:
    89     virtual void connectionClosed();
     89    virtual void connectionClosed() override;
    9090  private:
    9191    Client(const Client& copy); // not used
    92     virtual bool isServer_(){return false;}
    93     void processPacket(packet::Packet* packet);
     92    virtual bool isServer_() override{return false;}
     93    void processPacket(packet::Packet* packet) override;
    9494
    9595    static Client* singletonPtr_s;
  • code/branches/cpp11_v2/src/libraries/network/ClientConnection.h

    r8327 r10817  
    5757    uint32_t getRTT();
    5858  private:
    59     virtual void addPeer(uint32_t peerID);
    60     virtual void removePeer(uint32_t peerID);
     59    virtual void addPeer(uint32_t peerID) override;
     60    virtual void removePeer(uint32_t peerID) override;
    6161
    6262    bool disconnectConnection();
  • code/branches/cpp11_v2/src/libraries/network/GamestateManager.h

    r10774 r10817  
    8383    ~GamestateManager();
    8484
    85     virtual bool      addGamestate(packet::Gamestate *gs, unsigned int peerID);
    86     virtual bool      ackGamestate(unsigned int gamestateID, unsigned int peerID);
    87     virtual uint32_t  getLastReceivedGamestateID( unsigned int peerID );
    88     virtual uint32_t  getCurrentGamestateID(){ if( currentGamestate_) return currentGamestate_->getID(); else return GAMESTATEID_INITIAL; }
     85    virtual bool      addGamestate(packet::Gamestate *gs, unsigned int peerID) override;
     86    virtual bool      ackGamestate(unsigned int gamestateID, unsigned int peerID) override;
     87    virtual uint32_t  getLastReceivedGamestateID( unsigned int peerID ) override;
     88    virtual uint32_t  getCurrentGamestateID() override{ if( currentGamestate_) return currentGamestate_->getID(); else return GAMESTATEID_INITIAL; }
    8989
    9090    bool processGamestates();
  • code/branches/cpp11_v2/src/libraries/network/LANDiscoverable.cc

    r10768 r10817  
    109109      {
    110110        case ENET_EVENT_TYPE_CONNECT:
    111             orxout(verbose, context::network) << "Received LAN discovery connect from client " << event.peer->host->receivedAddress << endl;
     111            //orxout(verbose, context::network) << "Received LAN discovery connect from client " << event.peer->host->receivedAddress << endl;
    112112            break;
    113113        case ENET_EVENT_TYPE_DISCONNECT:
     
    117117          if( strcmp( LAN_DISCOVERY_MESSAGE, (char*)event.packet->data ) == 0 )      // check for a suitable orxonox client
    118118          {
    119             orxout(internal_info, context::network) << "Received LAN discovery message from client " << event.peer->host->receivedAddress << endl;
     119            //orxout(internal_info, context::network) << "Received LAN discovery message from client " << event.peer->host->receivedAddress << endl;
    120120            packet::ServerInformation info;
    121121            info.setServerName(this->ownName);
  • code/branches/cpp11_v2/src/libraries/network/NetworkFunction.h

    r10768 r10817  
    114114
    115115    // ignore the objectID because its a static function
    116     virtual bool call(uint32_t objectID){ (*this->functor_)(); return true; }
    117     virtual bool call(uint32_t objectID, const MultiType& mt1){ (*this->functor_)(mt1); return true; }
    118     virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2){ (*this->functor_)(mt1, mt2); return true; }
    119     virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3){ (*this->functor_)(mt1, mt2, mt3); return true; }
    120     virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4){ (*this->functor_)(mt1, mt2, mt3, mt4); return true; }
    121     virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5){ (*this->functor_)(mt1, mt2, mt3, mt4, mt5); return true; }
     116    virtual bool call(uint32_t objectID) override{ (*this->functor_)(); return true; }
     117    virtual bool call(uint32_t objectID, const MultiType& mt1) override{ (*this->functor_)(mt1); return true; }
     118    virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2) override{ (*this->functor_)(mt1, mt2); return true; }
     119    virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3) override{ (*this->functor_)(mt1, mt2, mt3); return true; }
     120    virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4) override{ (*this->functor_)(mt1, mt2, mt3, mt4); return true; }
     121    virtual bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5) override{ (*this->functor_)(mt1, mt2, mt3, mt4, mt5); return true; }
    122122
    123123  private:
     
    142142    { }
    143143
    144     inline bool call(uint32_t objectID)
     144    inline bool call(uint32_t objectID) override
    145145    {
    146146      if ( Synchronisable::getSynchronisable(objectID)!=nullptr )
     
    152152        return false;
    153153    }
    154     inline bool call(uint32_t objectID, const MultiType& mt1)
     154    inline bool call(uint32_t objectID, const MultiType& mt1) override
    155155    {
    156156      if ( Synchronisable::getSynchronisable(objectID)!=nullptr )
     
    162162        return false;
    163163    }
    164     inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2)
     164    inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2) override
    165165    {
    166166      if ( Synchronisable::getSynchronisable(objectID)!=nullptr )
     
    172172        return false;
    173173    }
    174     inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3)
     174    inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3) override
    175175    {
    176176      if ( Synchronisable::getSynchronisable(objectID)!=nullptr )
     
    182182        return false;
    183183    }
    184     inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4)
     184    inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4) override
    185185    {
    186186      if ( Synchronisable::getSynchronisable(objectID)!=nullptr )
     
    192192        return false;
    193193    }
    194     inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5)
     194    inline bool call(uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5) override
    195195    {
    196196      if ( Synchronisable::getSynchronisable(objectID)!=nullptr )
  • code/branches/cpp11_v2/src/libraries/network/NetworkFunctionIncludes.h

    r10774 r10817  
    5656            ~StaticallyInitializedNetworkFunction() { delete function_; }
    5757
    58             virtual void load();
    59             virtual void unload();
     58            virtual void load() override;
     59            virtual void unload() override;
    6060
    6161            inline NetworkFunctionBase& getFunction()
  • code/branches/cpp11_v2/src/libraries/network/NetworkStaticInitializationHandler.h

    r10624 r10817  
    3939    {
    4040        public:
    41             virtual void setupHandler();
    42             virtual void shutdownHandler();
     41            virtual void setupHandler() override;
     42            virtual void shutdownHandler() override;
    4343
    44             virtual void loadModule(ModuleInstance* module);
    45             virtual void unloadModule(ModuleInstance* module);
     44            virtual void loadModule(ModuleInstance* module) override;
     45            virtual void unloadModule(ModuleInstance* module) override;
    4646    };
    4747}
  • code/branches/cpp11_v2/src/libraries/network/Server.h

    r10622 r10817  
    6161    void open();
    6262    void close();
    63     void queuePacket(ENetPacket *packet, int clientID, uint8_t channelID);
    64     virtual bool sendPacket( packet::Packet* packet ){ return packet->send( static_cast<Host*>(this) ); }
     63    void queuePacket(ENetPacket *packet, int clientID, uint8_t channelID) override;
     64    virtual bool sendPacket( packet::Packet* packet ) override{ return packet->send( static_cast<Host*>(this) ); }
    6565    void update(const Clock& time);
    6666    unsigned int getRTT(unsigned int clientID);
    67     virtual void printRTT();
     67    virtual void printRTT() override;
    6868    float getPacketLoss(unsigned int clientID);
    6969    int getClientCount() { return this->clientIDs_.size();}
     
    7373    void updateGamestate();
    7474  private:
    75     virtual bool isServer_(){return true;}
     75    virtual bool isServer_() override{return true;}
    7676    unsigned int playerID(){return 0;}
    7777
    78     void addPeer(uint32_t peerID);
    79     void removePeer(uint32_t peerID);
    80     void processPacket(packet::Packet* packet);
     78    void addPeer(uint32_t peerID) override;
     79    void removePeer(uint32_t peerID) override;
     80    void processPacket(packet::Packet* packet) override;
    8181
    8282    bool createClient(int clientID);
     
    8585    bool sendObjectDeletes();
    8686    bool isValidTarget(unsigned int targetID);
    87     virtual void doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
    88     virtual void doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID);
     87    virtual void doSendChat(const std::string& message, unsigned int sourceID, unsigned int targetID) override;
     88    virtual void doReceiveChat(const std::string& message, unsigned int sourceID, unsigned int targetID) override;
    8989    void syncClassid(unsigned int clientID);
    9090
  • code/branches/cpp11_v2/src/libraries/network/TrafficControl.h

    r10769 r10817  
    109109
    110110    //ClientConnectionListener functions
    111     virtual void clientConnected(unsigned int clientID){};
    112     virtual void clientDisconnected(unsigned int clientID);
     111    virtual void clientConnected(unsigned int clientID) override{};
     112    virtual void clientDisconnected(unsigned int clientID) override;
    113113
    114114
  • code/branches/cpp11_v2/src/libraries/network/packet/Acknowledgement.h

    r7801 r10817  
    4646  ~Acknowledgement();
    4747
    48   inline unsigned int getSize() const;
    49   virtual bool process(orxonox::Host* host);
     48  inline unsigned int getSize() const override;
     49  virtual bool process(orxonox::Host* host) override;
    5050
    5151  unsigned int getAckID();
  • code/branches/cpp11_v2/src/libraries/network/packet/Chat.h

    r8858 r10817  
    4949
    5050  /* get size of packet */
    51   inline unsigned int getSize() const;
     51  inline unsigned int getSize() const override;
    5252
    5353  /* process chat message packet and remove it afterwards */
    54   virtual bool process(orxonox::Host* host);
     54  virtual bool process(orxonox::Host* host) override;
    5555
    5656  /* Get the length of the message (not the full size of the packet) */
  • code/branches/cpp11_v2/src/libraries/network/packet/ClassID.h

    r7801 r10817  
    4747  ~ClassID();
    4848
    49   uint32_t getSize() const;
    50   virtual bool process(orxonox::Host* host);
     49  uint32_t getSize() const override;
     50  virtual bool process(orxonox::Host* host) override;
    5151
    5252private:
  • code/branches/cpp11_v2/src/libraries/network/packet/DeleteObjects.h

    r7801 r10817  
    4848  bool fetchIDs();
    4949
    50   inline unsigned int getSize() const;
    51   virtual bool process(orxonox::Host* host);
     50  inline unsigned int getSize() const override;
     51  virtual bool process(orxonox::Host* host) override;
    5252
    5353private:
  • code/branches/cpp11_v2/src/libraries/network/packet/FunctionCalls.h

    r10624 r10817  
    5252  ~FunctionCalls();
    5353
    54   inline unsigned int getSize() const
     54  inline unsigned int getSize() const override
    5555    { assert(!this->isDataENetAllocated()); return currentSize_; }
    56   virtual bool process(orxonox::Host* host);
     56  virtual bool process(orxonox::Host* host) override;
    5757
    5858  void addCall( uint32_t networkID, uint32_t objectID, const MultiType& mt1, const MultiType& mt2, const MultiType& mt3, const MultiType& mt4, const MultiType& mt5);
    59   virtual bool send(orxonox::Host* host);
     59  virtual bool send(orxonox::Host* host) override;
    6060private:
    6161  std::queue<orxonox::FunctionCall> functionCalls_;
  • code/branches/cpp11_v2/src/libraries/network/packet/FunctionIDs.h

    r7801 r10817  
    4747  ~FunctionIDs();
    4848
    49   virtual uint32_t getSize() const;
    50   virtual bool process(orxonox::Host* host);
     49  virtual uint32_t getSize() const override;
     50  virtual bool process(orxonox::Host* host) override;
    5151
    5252private:
  • code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.h

    r10768 r10817  
    138138//     void rawDiff( uint8_t* newdata, uint8_t* data, uint8_t* basedata, uint32_t datalength, uint32_t baselength);
    139139//     inline uint32_t findObject( const SynchronisableHeader& header, uint8_t* mem, uint32_t dataLength, uint32_t startPosition = 0 );
    140     virtual uint32_t getSize() const;
    141     virtual bool process(orxonox::Host* host);
     140    virtual uint32_t getSize() const override;
     141    virtual bool process(orxonox::Host* host) override;
    142142    uint32_t calcGamestateSize(uint32_t id, uint8_t mode=0x0);
    143143//     inline void diffObject( uint8_t*& newData, uint8_t*& origData, uint8_t*& baseData, SynchronisableHeader& objectHeader, std::vector<uint32_t>::iterator& sizes );
  • code/branches/cpp11_v2/src/libraries/network/packet/Welcome.h

    r8706 r10817  
    4545  virtual ~Welcome();
    4646
    47   uint8_t *getData();
    48   inline unsigned int getSize() const;
    49   virtual bool process(orxonox::Host* host);
     47  uint8_t *getData() override;
     48  inline unsigned int getSize() const override;
     49  virtual bool process(orxonox::Host* host) override;
    5050
    5151private:
  • code/branches/cpp11_v2/src/libraries/network/synchronisable/NetworkCallback.h

    r6417 r10817  
    5353      NetworkCallback(T* object, void (T::*function) (void)) : object_(object), function_(function) {}
    5454      virtual ~NetworkCallback() {}
    55       virtual void call()
     55      virtual void call() override
    5656        { (this->object_->*function_)(); }
    5757
     
    6868      NetworkCallbackNotify() {}
    6969      virtual ~NetworkCallbackNotify() {}
    70       virtual void call()
     70      virtual void call() override
    7171        { (this->object_->*function_)( this->oldValue_ ); }
    7272      void setOldValue(const U& value){ this->oldValue_ = value; }
  • code/branches/cpp11_v2/src/libraries/network/synchronisable/SynchronisableVariable.h

    r10768 r10817  
    7474      virtual ~SynchronisableVariable();
    7575
    76       virtual inline uint8_t getMode(){ return mode_; }
    77       virtual inline uint32_t getData(uint8_t*& mem, uint8_t mode);
    78       virtual inline void putData(uint8_t*& mem, uint8_t mode, bool forceCallback = false);
    79       virtual inline uint32_t getSize(uint8_t mode);
    80       virtual inline void* getReference(){ return static_cast<void*>(const_cast<typename Loki::TypeTraits<T>::UnqualifiedType*>(&this->variable_)); }
     76      virtual inline uint8_t getMode() override{ return mode_; }
     77      virtual inline uint32_t getData(uint8_t*& mem, uint8_t mode) override;
     78      virtual inline void putData(uint8_t*& mem, uint8_t mode, bool forceCallback = false) override;
     79      virtual inline uint32_t getSize(uint8_t mode) override;
     80      virtual inline void* getReference() override{ return static_cast<void*>(const_cast<typename Loki::TypeTraits<T>::UnqualifiedType*>(&this->variable_)); }
    8181    protected:
    8282      T&                       variable_;
Note: See TracChangeset for help on using the changeset viewer.