Ignore:
Timestamp:
Apr 23, 2009, 5:55:59 PM (15 years ago)
Author:
Christoph Mayer
Message:

-temporärer commit, sorry kompiliert nicht :( muss aber die änderungen auf die andere maschine kriegen, ist in ca1h gefixt.

File:
1 edited

Legend:

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

    r3041 r3055  
    5959#include "ariba/communication/CommunicationEvents.h"
    6060
    61 #include "ariba/interface/ServiceInterface.h"
    62 
    6361#include "ariba/overlay/modules/OverlayInterface.h"
    6462#include "ariba/overlay/modules/OverlayFactory.h"
     
    6765#include "ariba/overlay/messages/JoinRequest.h"
    6866#include "ariba/overlay/messages/JoinReply.h"
     67
     68// forward declerations
     69namespace ariba {
     70        class NodeListener;
     71        class CommunicationListener;
     72
     73        namespace utility {
     74                class OvlVis;
     75        }
     76}
    6977
    7078using std::vector;
     
    7684using std::find;
    7785
     86using ariba::NodeListener;
     87using ariba::CommunicationListener;
     88
    7889using ariba::communication::EndpointDescriptor;
    7990using ariba::communication::BaseCommunication;
    8091using ariba::communication::CommunicationEvents;
    81 
    82 using ariba::interface::ServiceInterface;
    8392
    8493using ariba::overlay::OverlayMsg;
     
    101110using ariba::utility::seqnum_t;
    102111using ariba::utility::Timer;
     112using ariba::utility::OvlVis;
    103113
    104114#define ovl OvlVis::instance()
    105115#define ovlId OvlVis::NETWORK_ID_BASE_OVERLAY
    106 
    107 // needed for friend decleration
    108 // in different namespace
    109 namespace ariba {
    110         class Node;
    111 }
    112116
    113117namespace ariba {
     
    121125
    122126        use_logging_h( BaseOverlay );
    123         friend class ariba::Node;
    124 
    125127public:
    126 
    127128        /**
    128129         * Constructs an empty non-functional base overlay instance
     
    147148        /**
    148149         * Starts a link establishment procedure to the specfied node
     150         * for the service with id service
    149151         *
    150          * @param node The node id
     152         * @param node Destination node id
     153         * @param service Service to connect to
    151154         */
    152155        const LinkID establishLink( const NodeID& node, const ServiceID& service );
    153156
    154157        /**
    155          * TODO
     158         * Starts a link establishment procedure to the specified
     159         * endpoint and to the specified service
    156160         */
    157161        const LinkID establishLink( const EndpointDescriptor& ep, const ServiceID& service );
     
    176180         * Depending on the structure of the overlay, this can be very different.
    177181         */
    178         void broadcastMessage(
    179                 Message* message,
    180                 const ServiceID& service
    181         );
     182        void broadcastMessage( Message* message, const ServiceID& service );
    182183
    183184        /**
     
    200201
    201202        /**
    202          * Registers a receiver.
    203          *
    204          * @param receiver An implementation of the receiver interface
    205          */
    206         bool bind( ServiceInterface* service, const ServiceID& sid );
    207 
    208         /**
    209          * Unregister a receiver.
    210          *
    211          * @param sid The service id to unregister
    212          */
    213         ServiceInterface* unbind( const ServiceID& sid );
     203         * TODO
     204         */
     205        void bind(CommunicationListener* listener, const ServiceID& sid);
     206       
     207        /**
     208         * TODO
     209         */
     210        void unbind(CommunicationListener* listener, const ServiceID& sid);
     211       
     212        /**
     213         * TODO
     214         */
     215        void bind(NodeListener* listener);
     216       
     217        /**
     218         * TODO
     219         */
     220        void unbind(NodeListener* listener);
    214221
    215222        /**
     
    221228        const NodeID& getNodeID( const LinkID& lid = LinkID::UNSPECIFIED ) const ;
    222229
    223 protected:
    224 
    225         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    226         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    227         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    228 
    229         void joinSpoVNet(
    230                 const SpoVNetID& id,
    231                 const EndpointDescriptor& bootstrapEp
    232         );
    233 
     230        /**
     231         * TODO
     232         */
     233        void joinSpoVNet( const SpoVNetID& id, const EndpointDescriptor& bootstrapEp );
     234
     235        /**
     236         * TODO
     237         */
    234238        void createSpoVNet(
    235239                const SpoVNetID& id,
     
    239243        );
    240244
    241         void leaveSpoVNet(
    242         );
    243 
    244         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    245         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    246         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    247 
     245        /**
     246         * TODO
     247         */
     248        void leaveSpoVNet();
     249
     250protected:
     251
     252        /**
     253         * TODO
     254         */
    248255        virtual void onLinkUp( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote );
    249256
     257        /**
     258         * TODO
     259         */
    250260        virtual void onLinkDown( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote );
    251261
    252262        virtual void onLinkChanged( const LinkID& id, const NetworkLocator* oldlocal, const NetworkLocator* newlocal, const NetworkLocator* oldremote, const NetworkLocator* newremote );
    253263
     264        /**
     265         * TODO
     266         */
    254267        virtual void onLinkFail( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote );
    255268
     269        /**
     270         * TODO
     271         */
    256272        virtual void onLinkQoSChanged( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote, const QoSParameterSet& qos );
    257273
     
    260276        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    261277
     278        /**
     279         * TODO
     280         */
    262281        virtual bool receiveMessage( const Message* message, const LinkID& link, const NodeID& ); // nodeid is not valid in this case!
    263282
     
    270289         */
    271290        virtual void incomingRouteMessage( Message* msg );
     291       
     292        /**
     293         * see OverlayStructureEvents.h, called from specific OverlayInterface class
     294         */
    272295        virtual void onNodeJoin( const NodeID& node );
    273296
    274         // for timer events
     297       
     298        /**
     299         * TODO, for timer events
     300         */
    275301        virtual void eventFunction();
    276302
    277303private:
    278 
    279304        /**
    280305         * The BaseCommunication the BaseOverlay
     
    295320
    296321        /**
    297          * A demultiplexer that maps listeners to service ids
    298          * to deliver upcoming messages to the correct service.
    299          */
    300         Demultiplexer<ServiceInterface*, ServiceID> listenerMux;
     322         * TODO
     323         */
     324        Demultiplexer<CommunicationListener*, ServiceID> communicationListeners;
     325
     326        /**
     327         * TODO
     328         */
     329        typedef vector<NodeListener*> NodeListenerVector;
     330
     331        /**
     332         * TODO
     333         */
     334        NodeListenerVector nodeListeners;
    301335
    302336        /**
     
    322356        } BaseOverlayState;
    323357
     358        /**
     359         * TODO
     360         */
    324361        BaseOverlayState state;
    325362
     
    344381
    345382                LinkItem( const LinkID& _link, const NodeID& _node,
    346                                 const ServiceID& _service, ServiceInterface* _interface )
     383                                const ServiceID& _service, CommunicationListener* _interface )
    347384                        : link( _link ), node( _node ), service( _service ), interface( _interface ),
    348385                                autolink( false ), lastuse( time(NULL) ) {
     
    354391                NodeID node;
    355392                ServiceID service;
    356                 ServiceInterface* interface;
     393                CommunicationListener* interface;
    357394
    358395                // information needed for auto links
     
    370407        LinkMapping linkMapping;
    371408
    372         // nodes with pending joines. TODO: should be cleaned every some seconds
    373         // add timestamps to each, and check on occasion
     409       
     410        /**
     411         * nodes with pending joines. TODO: should be cleaned every
     412         * some seconds, add timestamps to each, and check on occasion
     413         */
    374414        typedef vector<NodeID> JoiningNodes;
    375415        JoiningNodes joiningNodes;
Note: See TracChangeset for help on using the changeset viewer.