Ignore:
Timestamp:
Mar 23, 2011, 12:06:05 PM (13 years ago)
Author:
mies
Message:

rolled back

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/communication/BaseCommunication.h

    r9684 r9694  
    131131
    132132        /// Establishes a link to another end-point.
    133         const LinkID establishLink(const EndpointDescriptor& descriptor );
     133        const LinkID establishLink(const EndpointDescriptor& descriptor,
     134                const LinkID& linkid = LinkID::UNSPECIFIED, const QoSParameterSet& qos =
     135                                QoSParameterSet::DEFAULT, const SecurityParameterSet& sec =
     136                                SecurityParameterSet::DEFAULT);
    134137
    135138        /// Drops a link
    136         void dropLink( LinkID link );
     139        void dropLink(const LinkID link);
    137140
    138141        /**
     
    143146         * @return A sequence number for this message
    144147         */
    145         seqnum_t sendMessage( LinkID lid, const Message* message );
     148        seqnum_t sendMessage(const LinkID lid, const Message* message);
    146149
    147150        /**
     
    151154         * @return The end-point descriptor of the link's end-point
    152155         */
    153         const EndpointDescriptor& getEndpointDescriptor(
    154                         LinkID link = LinkID::UNSPECIFIED) const;
     156        const EndpointDescriptor& getEndpointDescriptor(const LinkID link =
     157                        LinkID::UNSPECIFIED) const;
    155158
    156159        /**
     
    209212        class LinkDescriptor {
    210213        public:
     214
    211215                /// default constructor
    212                 LinkDescriptor() : up(false), id(), localLocator(NULL), remoteLocator(NULL) {}
     216                LinkDescriptor() :
     217                        localLink(LinkID::UNSPECIFIED), localLocator(NULL),
     218                        remoteLink(LinkID::UNSPECIFIED), remoteLocator(NULL),
     219                        up(false) {
     220                }
    213221
    214222                ~LinkDescriptor() {
     
    218226
    219227                bool isUnspecified() const {
    220                         return id.isUnspecified();
     228                        return (this == &UNSPECIFIED());
    221229                }
     230
     231                static LinkDescriptor& UNSPECIFIED(){
     232                        static LinkDescriptor* unspec = NULL;
     233                        if(unspec == NULL) unspec = new LinkDescriptor();
     234                        return *unspec;
     235                }
     236
     237                bool unspecified;
     238
     239                /// link identifiers
     240                LinkID localLink;
     241                const address_v* localLocator;
     242
     243                /// used underlay addresses for the link
     244                LinkID remoteLink;
     245                const address_v* remoteLocator;
     246
     247                /// the remote end-point descriptor
     248                EndpointDescriptor remoteEndpoint;
    222249
    223250                /// flag, whether this link is up
    224251                bool up;
    225 
    226                 /// link identifier
    227                 LinkID id;
    228 
    229                 /// locators
    230                 const address_v* localLocator;
    231                 const address_v* remoteLocator;
    232 
    233                 /// the remote end-point descriptor
    234                 EndpointDescriptor remoteEndpoint;
    235252        };
    236253
     
    242259
    243260        /// Link management: add a link
    244         LinkDescriptor& addLink( LinkID link );
     261        void addLink( LinkDescriptor* link );
    245262
    246263        /// Link management: remove a link
    247         void removeLink( LinkID link);
     264        void removeLink(const LinkID& localLink);
    248265
    249266        /// Link management: get link information using the local link
    250         LinkDescriptor& queryLink( LinkID link) const;
     267        LinkDescriptor& queryLocalLink(const LinkID& localLink) const;
     268
     269        /// Link management: get link information using the remote link
     270        LinkDescriptor& queryRemoteLink(const LinkID& remoteLink) const;
    251271
    252272        /// The local end-point descriptor
     
    287307        /// convenience: send message to peer
    288308        void send( Message* message, const EndpointDescriptor& endpoint );
    289 
    290309        void send( Message* message, const LinkDescriptor& descriptor );
    291310
    292311        /// state of the base communication
    293312        bool started;
     313
    294314};
    295315
Note: See TracChangeset for help on using the changeset viewer.