Ignore:
Timestamp:
May 27, 2009, 8:13:08 AM (16 years ago)
Author:
Christoph Mayer
Message:

-dynamische wahl des overlays durch den initiator, nodes kriegen bei join mitgeteilt welche overlay struktur zu verwenden ist

Location:
source/ariba/overlay/modules
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/overlay/modules/OverlayFactory.cpp

    r3690 r3718  
    5353
    5454        switch( param.getOverlayStructure() ){
    55                 case OverlayParameterSet::OverlayStructureOneHop:
    56                         return new OneHop( baseoverlay, nodeid, routeReceiver );
    5755
    5856                case OverlayParameterSet::OverlayStructureChord:
    59                         return new Chord( baseoverlay, nodeid, routeReceiver );
     57                        return new Chord( baseoverlay, nodeid, routeReceiver, param );
    6058
    61                 case OverlayParameterSet::OverlayStructureKademlia:
    62                         return NULL;
     59                case OverlayParameterSet::OverlayStructureOneHop:
     60                        return new OneHop( baseoverlay, nodeid, routeReceiver, param );
    6361
    6462                default:
  • source/ariba/overlay/modules/OverlayInterface.cpp

    r3705 r3718  
    4646ServiceID OverlayInterface::OVERLAY_SERVICE_ID(0);
    4747
    48 OverlayInterface::OverlayInterface(BaseOverlay& _baseoverlay,
    49                 const NodeID& _nodeid, OverlayStructureEvents* _eventsReceiver) :
    50         baseoverlay(_baseoverlay), nodeid(_nodeid), eventsReceiver(_eventsReceiver) {
     48OverlayInterface::OverlayInterface(BaseOverlay& _baseoverlay, const NodeID& _nodeid,
     49                        OverlayStructureEvents* _eventsReceiver, OverlayParameterSet _parameters) :
     50        baseoverlay(_baseoverlay), nodeid(_nodeid),
     51        eventsReceiver(_eventsReceiver), parameters(_parameters) {
    5152
    5253        _baseoverlay.bind(this, OVERLAY_SERVICE_ID);
     
    8283}
    8384
     85const OverlayParameterSet& OverlayInterface::getParameters() const {
     86        return parameters;
     87}
     88
    8489}} // namespace ariba, overlay
  • source/ariba/overlay/modules/OverlayInterface.h

    r3690 r3718  
    4545#include "ariba/utility/types/NodeID.h"
    4646#include "ariba/utility/types/ServiceID.h"
     47#include "ariba/utility/types/OverlayParameterSet.h"
    4748
    4849using ariba::CommunicationListener;
     
    5152using ariba::utility::NodeID;
    5253using ariba::utility::ServiceID;
     54using ariba::utility::OverlayParameterSet;
    5355
    5456namespace ariba {
     
    7577                        BaseOverlay& _baseoverlay,
    7678                        const NodeID& _nodeid,
    77                         OverlayStructureEvents* _eventsReceiver );
     79                        OverlayStructureEvents* _eventsReceiver,
     80                        OverlayParameterSet _parameters
     81                        );
    7882
    7983        /**
     
    154158                        const LinkID& lnk = LinkID::UNSPECIFIED);
    155159
     160
     161        const OverlayParameterSet& getParameters() const;
     162
    156163protected:
    157164
    158165        /// Reference to an active base overlay
    159166        BaseOverlay& baseoverlay;
     167
     168        /// The parameters of the overlay structure
     169        OverlayParameterSet parameters;
    160170
    161171        /// The node identifier to use with this overlay
  • source/ariba/overlay/modules/chord/Chord.cpp

    r3713 r3718  
    5353
    5454Chord::Chord(BaseOverlay& _baseoverlay, const NodeID& _nodeid,
    55                 OverlayStructureEvents* _eventsReceiver) :
    56         OverlayInterface(_baseoverlay, _nodeid, _eventsReceiver) {
     55                OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param) :
     56        OverlayInterface(_baseoverlay, _nodeid, _eventsReceiver, param) {
    5757
    5858        // create routing table
  • source/ariba/overlay/modules/chord/Chord.h

    r3690 r3718  
    8989public:
    9090        Chord(BaseOverlay& _baseoverlay, const NodeID& _nodeid,
    91                         OverlayStructureEvents* _eventsReceiver);
     91                        OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param);
    9292        virtual ~Chord();
    9393
  • source/ariba/overlay/modules/onehop/OneHop.cpp

    r3705 r3718  
    4949use_logging_cpp( OneHop );
    5050
    51 OneHop::OneHop(BaseOverlay& _baseoverlay, const NodeID& _nodeid, OverlayStructureEvents* _eventsReceiver)
    52         :       OverlayInterface( _baseoverlay, _nodeid, _eventsReceiver ),
     51OneHop::OneHop(BaseOverlay& _baseoverlay, const NodeID& _nodeid,
     52                OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param)
     53        :       OverlayInterface( _baseoverlay, _nodeid, _eventsReceiver, param ),
    5354                state           ( OneHopStateInvalid ),
    5455                bootstrapLink   ( LinkID::UNSPECIFIED ),
  • source/ariba/overlay/modules/onehop/OneHop.h

    r3705 r3718  
    5555public:
    5656        OneHop(BaseOverlay& _overlay, const NodeID& _nodeid,
    57                         OverlayStructureEvents* _eventsReceiver);
     57                        OverlayStructureEvents* _eventsReceiver, const OverlayParameterSet& param);
    5858
    5959        virtual ~OneHop();
Note: See TracChangeset for help on using the changeset viewer.