Ignore:
Timestamp:
Feb 24, 2009, 10:06:43 PM (15 years ago)
Author:
Christoph Mayer
Message:

-autolinks impl. (funktioniert noch nicht komplett, macht aber im moment nichts schlechter)
-einige fixes im ablauf etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/BaseOverlay.h

    r2473 r2483  
    4343#include <iostream>
    4444#include <algorithm>
     45#include <ctime>
    4546#include <boost/foreach.hpp>
    4647
     
    5051#include "ariba/utility/misc/Demultiplexer.hpp"
    5152#include "ariba/utility/logging/Logging.h"
     53#include "ariba/utility/system/Timer.h"
    5254
    5355#include "ariba/communication/EndpointDescriptor.h"
     
    6769using std::map;
    6870using std::make_pair;
     71using std::pair;
    6972
    7073using ariba::communication::EndpointDescriptor;
     
    9295using ariba::utility::MessageSender;
    9396using ariba::utility::seqnum_t;
     97using ariba::utility::Timer;
    9498
    9599#define ovl OvlVis::instance()
     
    109113        public MessageReceiver,
    110114        public CommunicationEvents,
    111         public OverlayStructureEvents {
     115        public OverlayStructureEvents,
     116        protected Timer {
    112117
    113118        use_logging_h( BaseOverlay );
     
    248253        virtual void onNodeJoin( const NodeID& node );
    249254
     255        // for timer events
     256        virtual void eventFunction();
     257
    250258private:
    251259
     
    316324                static const LinkItem UNSPECIFIED;
    317325
    318                 LinkItem( const LinkID& _link, const NodeID& _node,
     326                LinkItem( const LinkID& _link, const NodeID& _node, 
    319327                                const ServiceID& _service, ServiceInterface* _interface )
    320                         : link( _link ), node( _node ), service( _service ), interface( _interface ){
     328                        : link( _link ), node( _node ), service( _service ), interface( _interface ),
     329                                autolink( false ), lastuse( time(NULL) ) {
    321330                }
     331
     332                // general information about the link
    322333
    323334                const LinkID link;
     
    325336                ServiceID service;
    326337                ServiceInterface* interface;
     338
     339                // information needed for auto links
     340
     341                void markused(){
     342                        lastuse = time(NULL);
     343                }
     344
     345                bool autolink;
     346                time_t lastuse;
    327347        };
    328348
Note: See TracChangeset for help on using the changeset viewer.