Changeset 3055 for source/ariba


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.

Location:
source/ariba
Files:
3 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/AribaModule.h

    r3041 r3055  
    8484 *
    8585 * @author Sebastian Mies <mies@tm.uka.de>
     86 * @author Christoph Mayer <mayer@tm.uka.de>
    8687 */
    8788class AribaModule: public Module {
     
    129130         * bootstrap.file  = used file for bootstrap information
    130131         */
    131         void initialize(); ///< @see Module.h
    132         void start(); ///< @see Module.h
    133         void stop(); ///< @see Module.h
    134         string getName() const; ///< @see Module.h
     132        void initialize();                          ///< @see Module.h
     133        void start();                               ///< @see Module.h
     134        void stop();                                ///< @see Module.h
     135        string getName() const;                     ///< @see Module.h
    135136        void setProperty(string key, string value); ///< @see Module.h
    136137        const string getProperty(string key) const; ///< @see Module.h
  • source/ariba/CommunicationListener.cpp

    r2460 r3055  
    4141namespace ariba {
    4242
    43 // dummy
    4443CommunicationListener::CommunicationListener() {
    4544}
    4645
    47 // dummy
    4846CommunicationListener::~CommunicationListener() {
    4947}
    5048
    51 // dummy
    5249void CommunicationListener::onLinkUp(const LinkID& l, const NodeID& r) {
    5350}
    5451
    55 // dummy
    5652void CommunicationListener::onLinkDown(const LinkID& l, const NodeID& r) {
    5753}
    5854
    59 // dummy
    6055void CommunicationListener::onLinkChanged(const LinkID& l, const NodeID& r) {
    6156}
    6257
    63 // dummy
    6458void CommunicationListener::onLinkFail(const LinkID& l, const NodeID& r) {
    6559}
    6660
    67 // dummy
    6861void CommunicationListener::onLinkQoSChanged(const LinkID& l, const NodeID& r,
    6962                const LinkProperties& p) {
    7063}
    7164
    72 // dummy
    7365bool CommunicationListener::onLinkRequest(const NodeID& remote,
    7466                const DataMessage& msg) {
     
    7668}
    7769
    78 // dummy
    7970void CommunicationListener::onMessage(const DataMessage& msg,
    8071                const NodeID& remote, const LinkID& lnk) {
    8172}
    8273
    83 // dummy
    84 void CommunicationListener::onMessageSent(seqnum_t seq_num, bool failed,
    85                 const DataMessage& msg) {
    86 }
     74// void CommunicationListener::onMessageSent(seqnum_t seq_num, bool failed,
     75//              const DataMessage& msg) {
     76// }
    8777
    8878} // namespace ariba
  • source/ariba/CommunicationListener.h

    r2460 r3055  
    4343// forward declaration
    4444class CommunicationListener;
    45 class ServiceInterfaceWrapper;
    4645}
    4746
     
    5453
    5554/**
    56  *
     55 * Listener for communication events on links.
    5756 */
    5857class CommunicationListener {
    5958        friend class Node;
    60         friend class ServiceInterfaceWrapper;
    6159protected:
    6260        CommunicationListener();
     
    7674                        const LinkProperties& prop);
    7775
    78         // --- service specific events ---
    79 
    8076        virtual bool onLinkRequest(const NodeID& remote, const DataMessage& msg);
    8177
     
    8581                        const LinkID& lnk = LinkID::UNSPECIFIED);
    8682
    87         virtual void onMessageSent(seqnum_t seq_num, bool failed,
    88                         const DataMessage& msg = DataMessage::UNSPECIFIED);
     83        // --- extended message functionality ---
     84        //      virtual void onMessageSent(seqnum_t seq_num, bool failed,
     85        //              const DataMessage& msg = DataMessage::UNSPECIFIED);
    8986
    9087        // --- dht functionality ---
  • source/ariba/Identifiers.h

    r2409 r3055  
    4040#define IDENTIFIERS_H_
    4141
    42 //#include "ariba.h"
    43 
    44 // TODO: implement via variable integers to support different node id sizes!!
    45 //#include "ariba/utility/vtypes/vint.hpp"
    46 
    47 // hack
    4842#include "ariba/utility/types/NodeID.h"
    4943#include "ariba/utility/types/ServiceID.h"
     
    5347namespace ariba {
    5448
    55 // TODO: implement via variable integers to support different node id sizes!!
    56 //typedef vint<32> LinkID;
    57 //typedef vint<32> ServiceID;
    58 //typedef vint<> NodeID;
    59 //typedef vint<> SpoVNetID;
    60 
    61 // hack: for now, use old identifiers
    6249typedef utility::NodeID NodeID;
    6350typedef utility::LinkID LinkID;
  • source/ariba/Makefile.am

    r3041 r3055  
    253253  communication/networkinfo/NetworkInformation.h
    254254
    255 #------------> interface
    256 
    257 libariba_la_SOURCES += \
    258   interface/ServiceInterface.cpp
    259 
    260 nobase_libariba_la_HEADERS += \
    261   interface/ServiceInterface.h
    262 
    263255#------------> overlay
    264256
    265257libariba_la_SOURCES += \
    266   overlay/BaseOverlay.cpp \
    267   overlay/OverlayEvents.cpp
    268 
    269 nobase_libariba_la_HEADERS += \
    270   overlay/BaseOverlay.h \
    271   overlay/OverlayEvents.h
     258  overlay/BaseOverlay.cpp
     259
     260nobase_libariba_la_HEADERS += \
     261  overlay/BaseOverlay.h
    272262
    273263#------------> overlay :: messages
  • source/ariba/Node.cpp

    r3041 r3055  
    4141#include "ariba/overlay/BaseOverlay.h"
    4242#include "ariba/utility/types/OverlayParameterSet.h"
    43 #include "ariba/interface/ServiceInterface.h"
    4443#include "ariba/communication/EndpointDescriptor.h"
    4544
     
    4746
    4847namespace ariba {
    49 
    50 class ServiceInterfaceWrapper: public interface::ServiceInterface {
    51 private:
    52         NodeListener* nodeListener;
    53         CommunicationListener* commListener;
    54 public:
    55         ServiceInterfaceWrapper(NodeListener* listener) :
    56                 nodeListener(listener), commListener(NULL) {
    57 
    58         }
    59 
    60         ServiceInterfaceWrapper(CommunicationListener* listener) :
    61                 nodeListener(NULL), commListener(listener) {
    62         }
    63 
    64         ~ServiceInterfaceWrapper() {
    65         }
    66 
    67 protected:
    68 
    69         bool isJoinAllowed(const NodeID& nodeid, const SpoVNetID& spovnetid) {
    70                 return true;
    71         }
    72 
    73         void onNodeJoin(const NodeID& nodeid, const SpoVNetID& spovnetid) {
    74                 // not handled
    75         }
    76 
    77         void onNodeLeave(const NodeID& id, const SpoVNetID& spovnetid) {
    78                 // not handled
    79         }
    80 
    81         void onJoinSuccess(const SpoVNetID& spovnetid) {
    82                 if (nodeListener != NULL) nodeListener->onJoinCompleted(spovnetid);
    83         }
    84 
    85         void onJoinFail(const SpoVNetID& spovnetid) {
    86                 if (nodeListener != NULL) nodeListener->onJoinFailed(spovnetid);
    87         }
    88 
    89         void onLeaveSuccess( const SpoVNetID& spovnetid ){
    90                 if (nodeListener != NULL) nodeListener->onLeaveCompleted(spovnetid);
    91         }
    92 
    93         void onLeaveFail( const SpoVNetID& spovnetid ){
    94                 if (nodeListener != NULL) nodeListener->onLeaveFailed(spovnetid);
    95         }
    96 
    97         void onLinkUp(const LinkID& link, const NodeID& local, const NodeID& remote) {
    98                 if (commListener != NULL) commListener->onLinkUp(link, remote);
    99         }
    100 
    101         void onLinkDown(const LinkID& link, const NodeID& local,
    102                         const NodeID& remote) {
    103                 if (commListener != NULL) commListener->onLinkDown(link, remote);
    104         }
    105 
    106         void onLinkChanged(const LinkID& link, const NodeID& local,
    107                         const NodeID& remote) {
    108                 if (commListener != NULL) commListener->onLinkChanged(link, remote);
    109         }
    110 
    111         void onLinkFail(const LinkID& id, const NodeID& local, const NodeID& remote) {
    112                 if (commListener != NULL) commListener->onLinkFail(id, remote);
    113         }
    114 
    115         void onLinkQoSChanged(const LinkID& id, const NodeID& local,
    116                         const NodeID& remote, const QoSParameterSet& qos) {
    117                 if (commListener != NULL) commListener->onLinkQoSChanged(id, remote,
    118                                 LinkProperties::DEFAULT);
    119         }
    120 
    121         bool receiveMessage(const Message* message, const LinkID& link,
    122                         const NodeID& node) {
    123                 if (commListener != NULL) commListener->onMessage(
    124                                 const_cast<Message*>(message), node, link);
    125         }
    126 };
    127 
    128 ServiceID Node::anonymousService = ServiceID(0xFF00);
    12948
    13049Node::Node(AribaModule& ariba_mod, const Name& node_name) :
     
    14362        nodeId = generateNodeId(name);
    14463
    145         ariba_mod.base_comm->start(ariba_mod.ip_addr, ariba_mod.tcp_port);
    146         base_overlay->start( *ariba_mod.base_comm, nodeId );
    147 
    14864        const communication::EndpointDescriptor* ep =
    14965                        ariba_mod.getBootstrapNode(vnetname);
    15066        if( ep == NULL ) return;
    15167
     68        ariba_mod.base_comm->start(ariba_mod.ip_addr, ariba_mod.tcp_port);
     69        base_overlay->start( *ariba_mod.base_comm, nodeId );
    15270        base_overlay->joinSpoVNet( spovnetId, *ep);
    15371}
     
    17391        base_overlay->leaveSpoVNet();
    17492        ariba_mod.base_comm->stop();
    175 
    17693        base_overlay->stop();
    17794}
     
    222139
    223140void Node::bind(NodeListener* listener) {
    224         base_overlay->bind(new ServiceInterfaceWrapper(listener),
    225                         Node::anonymousService);
     141        base_overlay->bind(listener);
    226142}
    227143
    228144void Node::unbind(NodeListener* listener) {
    229         delete base_overlay->unbind(Node::anonymousService);
     145        base_overlay->unbind(listener);
    230146}
    231147
    232148void Node::bind(CommunicationListener* listener, const ServiceID& sid) {
    233         base_overlay->bind(new ServiceInterfaceWrapper(listener), sid);
     149        base_overlay->bind(listener, sid);
    234150}
    235151
    236152void Node::unbind(CommunicationListener* listener, const ServiceID& sid) {
    237         delete base_overlay->unbind(sid);
     153        base_overlay->unbind(listener, sid);
    238154}
    239155
  • source/ariba/Node.h

    r3037 r3055  
    4242// forward declarations
    4343namespace ariba {
    44 class Node;
     44        class Node;
     45        namespace overlay {
     46                class BaseOverlay;
     47        }
    4548}
    4649
     
    5558#include "DataMessage.h"
    5659
     60using ariba::overlay::BaseOverlay;
    5761using std::vector;
    5862
    5963namespace ariba {
    60 
    61 // forward declaration
    62 namespace interface {
    63 class ServiceInterface;
    64 }
    65 
    66 namespace overlay {
    67 class BaseOverlay;
    68 }
    6964
    7065/**
     
    338333        AribaModule& ariba_mod;                //< ariba module
    339334        SpoVNetID spovnetId;                   //< current spovnet id
    340         NodeID nodeId;                             //< current node id
     335        NodeID nodeId;                         //< current node id
    341336        overlay::BaseOverlay* base_overlay;    //< the base overlay
    342 
    343         // delegates
    344         static ServiceID anonymousService;
    345337};
    346338
  • source/ariba/NodeListener.h

    r2409 r3055  
    4444class NodeListener;
    4545class Node;
    46 class ServiceInterfaceWrapper;
    4746}
    4847
     
    5554 *
    5655 * @author Sebastian Mies <mies@tm.uka.de>
     56 * @author Christoph Mayer <mayer@tm.uka.de>
    5757 */
    5858class NodeListener {
    5959        friend class Node;
    60         friend class ServiceInterfaceWrapper;
    6160public:
    62 
    6361        NodeListener();
    6462        virtual ~NodeListener();
    65 
    6663protected:
    6764        /**
  • source/ariba/SpoVNetProperties.h

    r2440 r3055  
    6262 *
    6363 * @author Sebastian Mies <mies@tm.uka.de>
     64 * @author Christoph Mayer <mayer@tm.uka.de>
    6465 */
    6566class SpoVNetProperties {
  • source/ariba/ariba.h

    r2460 r3055  
    4545
    4646#include "AribaModule.h"
     47#include "CommunicationListener.h"
    4748#include "DataMessage.h"
    4849#include "Identifiers.h"
    4950#include "LinkProperties.h"
     51#include "Message.h"
    5052#include "Module.h"
    5153#include "Name.h"
     
    5355#include "NodeListener.h"
    5456#include "SpoVNetProperties.h"
    55 #include "CommunicationListener.h"
    56 #include "Message.h"
    5757
    5858#endif /* ARIBA_H_ */
  • source/ariba/communication/modules/transport/omnet/AribaOmnetModule.cpp

    r3054 r3055  
    4040
    4141#include "ariba/utility/system/StartupWrapper.h" // circular inclusion
    42 #include "ariba/interface/ServiceInterface.h"
    4342using ariba::utility::StartupWrapper;
    44 using ariba::interface::ServiceInterface;
    4543
    4644namespace ariba {
  • source/ariba/overlay/BaseOverlay.cpp

    r3041 r3055  
    4040
    4141#include "ariba/utility/misc/OvlVis.h"
    42 using ariba::utility::OvlVis;
     42#include "ariba/NodeListener.h"
     43#include "ariba/CommunicationListener.h"
    4344
    4445namespace ariba {
     
    146147
    147148        // inform all registered services of the event
    148         BOOST_FOREACH( ServiceInterface* i, listenerMux.getOneList() ){
     149        BOOST_FOREACH( NodeListener* i, nodeListeners ){
    149150                if( ret ) i->onLeaveSuccess( spovnetId );
    150151                else      i->onLeaveFail( spovnetId );
     
    176177
    177178        overlayInterface->joinOverlay();
    178         BOOST_FOREACH( ServiceInterface* i, listenerMux.getOneList() ){
     179        BOOST_FOREACH( NodeListener* i, nodeListeners ){
    179180                i->onJoinSuccess( spovnetId );
    180181        }
     
    221222const LinkID BaseOverlay::establishLink(const EndpointDescriptor& ep, const ServiceID& service){
    222223
    223         if( !listenerMux.contains( service ) ){
     224        if( !communicationListeners.contains( service ) ){
    224225                logging_error( "no registered listener on serviceid " << service.toString() );
    225226                return LinkID::UNSPECIFIED;
    226227        }
    227228
    228         ServiceInterface* receiver = listenerMux.get( service );
     229        CommunicationListener* receiver = communicationListeners.get( service );
    229230        const LinkID link = bc->establishLink( ep );
    230231
     
    308309}
    309310
    310 bool BaseOverlay::bind(ServiceInterface* service, const ServiceID& sid) {
    311 
    312         logging_debug( "binding service " << service << " on serviceid " << sid.toString() );
    313 
    314         if( listenerMux.contains( sid ) ){
    315                 logging_error( "some service already registered for service id " << sid.toString() );
     311void BaseOverlay::bind(CommunicationListener* listener, const ServiceID& sid){
     312        logging_debug( "binding communication listener " << listener
     313                << " on serviceid " << sid.toString() );
     314
     315        if( communicationListeners.contains( sid ) ){
     316                logging_error( "some listener already registered for service id "
     317                        << sid.toString() );
    316318                return false;
    317319        }
    318320
    319         listenerMux.registerItem( service, sid );
     321        communicationListeners.registerItem( listener, sid );
    320322        return true;
    321323}
    322324
    323 ServiceInterface* BaseOverlay::unbind(const ServiceID& sid){
    324 
    325         logging_debug( "unbinding service from serviceid " << sid.toString() );
    326 
    327         if( !listenerMux.contains( sid ) ){
    328                 logging_warn( "cannot unbind service. no service registered on service id " << sid.toString() );
    329                 return NULL;
    330         }
    331 
    332         ServiceInterface* iface = listenerMux.get( sid );
    333         listenerMux.unregisterItem( sid );
    334 
    335         return NULL; //iface;
     325void BaseOverlay::unbind(CommunicationListener* listener, const ServiceID& sid){
     326        logging_debug( "unbinding listener " << listener
     327                << " from serviceid " << sid.toString() );
     328
     329        if( !communicationListeners.contains( sid ) ){
     330                logging_warn( "cannot unbind listener. no listener registered on service id " << sid.toString() );
     331                return;
     332        }
     333
     334        if( communicationListeners.get(sid) != listener ){
     335                logging_warn( "listener bound to service id " << sid.toString()
     336                        << " is different than listener trying to unbind" );
     337                return;
     338        }
     339
     340        communicationListeners.unregisterItem( sid );
     341}
     342
     343void BaseOverlay::bind(NodeListener* listener){
     344        logging_debug( "binding node listener " << listener );
     345
     346        NodeListenerVector::iterator i = nodeListeners.find( listener );
     347        if( i != nodeListeners.end() ){
     348                logging_warn( "node listener " << listener << " is already bound, cannot bind" );
     349                return;
     350        }
     351       
     352        nodeListeners.push_back( listener );
     353}
     354
     355void BaseOverlay::unbind(NodeListener* listener){
     356        logging_debug( "unbinding node listener " << listener );
     357
     358        NodeListenerVector::iterator i = nodeListeners.find( listener );
     359        if( i == nodeListeners.end() ){
     360                logging_warn( "node listener " << listener << " is not bound, cannot unbind" );
     361                return;
     362        }
     363       
     364        nodeListeners.erase( i );
    336365}
    337366
     
    501530
    502531                const ServiceID& service = overlayMsg->getService();
    503                 ServiceInterface* serviceListener = listenerMux.get( service );
     532                CommunicationListener* serviceListener = communicationListeners.get( service );
    504533
    505534                logging_debug( "received data for service " << service.toString() );
     
    544573                bool allow = true;
    545574
    546                 BOOST_FOREACH( ServiceInterface* i, listenerMux.getOneList() ){
     575                BOOST_FOREACH( NodeListener* i, nodeListeners ){
    547576                        allow &= i->isJoinAllowed( overlayMsg->getSourceNode(), spovnetId );
    548577                }
     
    615644
    616645                        // inform all registered services of the event
    617                         BOOST_FOREACH( ServiceInterface* i, listenerMux.getOneList() ){
     646                        BOOST_FOREACH( NodeListener* i, nodeListeners{
    618647                                i->onJoinFail( spovnetId );
    619648                        }
     
    640669
    641670                        // inform all registered services of the event
    642                         BOOST_FOREACH( ServiceInterface* i, listenerMux.getOneList() ){
     671                        BOOST_FOREACH( NodeListener* i, nodeListeners ){
    643672                                i->onJoinFail( spovnetId );
    644673                        }
     
    662691
    663692                // inform all registered services of the event
    664                 BOOST_FOREACH( ServiceInterface* i, listenerMux.getOneList() ){
     693                BOOST_FOREACH( NodeListener* i, nodeListeners ){
    665694                        i->onJoinSuccess( spovnetId );
    666695                }
     
    717746                //
    718747
    719                 if( !listenerMux.contains( service ) ){
     748                if( !communicationListeners.contains( service ) ){
    720749                        logging_warn( "linkup event for service that has not been registered" );
    721750                        return false;
    722751                }
    723752
    724                 ServiceInterface* iface = listenerMux.get( service );
     753                CommunicationListener* iface = communicationListeners.get( service );
    725754                if( iface == NULL ){
    726755                        logging_warn( "linkup event for service that has been registered with a NULL interface" );
     
    762791
    763792                        // inform all registered services of the event
    764                         BOOST_FOREACH( ServiceInterface* i, listenerMux.getOneList() ){
     793                        BOOST_FOREACH( NodeListener* i, nodeListeners ){
    765794                                i->onLeaveFail( spovnetId );
    766795                        }
     
    774803
    775804                        // inform all registered services of the event
    776                         BOOST_FOREACH( ServiceInterface* i, listenerMux.getOneList() ){
     805                        BOOST_FOREACH( NodeListener* i, nodeListeners ){
    777806                                i->onNodeLeave( overlayMsg->getSourceNode(), spovnetId );
    778807                        }
     
    879908                                << node.toString() );
    880909
    881         BOOST_FOREACH( ServiceInterface* i, listenerMux.getOneList() ){
     910        BOOST_FOREACH( NodeListener* i, nodeListeners ){
    882911                i->onNodeJoin( node, spovnetId );
    883912        }
  • 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;
  • source/ariba/overlay/modules/OverlayInterface.h

    r3054 r3055  
    4040#define __OVERLAY_INTERFACE_H
    4141
     42#include "ariba/CommunicationListener.h"
    4243#include "ariba/communication/EndpointDescriptor.h"
    43 #include "ariba/interface/ServiceInterface.h"
    4444#include "ariba/overlay/modules/OverlayStructureEvents.h"
    4545#include "ariba/utility/types/NodeID.h"
    4646#include "ariba/utility/types/ServiceID.h"
    4747
     48using ariba::CommunicationListener;
    4849using ariba::communication::EndpointDescriptor;
    49 using ariba::interface::ServiceInterface;
    5050using ariba::overlay::OverlayStructureEvents;
    5151using ariba::utility::NodeID;
     
    5757class BaseOverlay;
    5858
    59 class OverlayInterface : public ServiceInterface {
     59class OverlayInterface : public CommunicationListener {
    6060public:
    6161        OverlayInterface(
  • source/ariba/overlay/modules/onehop/OneHop.h

    r3054 r3055  
    8585
    8686        //
    87         // see ServiceInterface.h and OverlayInterface.h
     87        // see CommunicationListener.h and OverlayInterface.h
    8888        //
    8989
Note: See TracChangeset for help on using the changeset viewer.