Changeset 9684 for source/ariba/communication/BaseCommunication.h
- Timestamp:
- Mar 22, 2011, 4:05:57 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/communication/BaseCommunication.h
r6941 r9684 131 131 132 132 /// Establishes a link to another end-point. 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); 133 const LinkID establishLink(const EndpointDescriptor& descriptor ); 137 134 138 135 /// Drops a link 139 void dropLink( const LinkID link);136 void dropLink( LinkID link ); 140 137 141 138 /** … … 146 143 * @return A sequence number for this message 147 144 */ 148 seqnum_t sendMessage( const LinkID lid, const Message* message);145 seqnum_t sendMessage( LinkID lid, const Message* message ); 149 146 150 147 /** … … 154 151 * @return The end-point descriptor of the link's end-point 155 152 */ 156 const EndpointDescriptor& getEndpointDescriptor( const LinkID link =157 LinkID ::UNSPECIFIED) const;153 const EndpointDescriptor& getEndpointDescriptor( 154 LinkID link = LinkID::UNSPECIFIED) const; 158 155 159 156 /** … … 212 209 class LinkDescriptor { 213 210 public: 214 215 211 /// default constructor 216 LinkDescriptor() : 217 localLink(LinkID::UNSPECIFIED), localLocator(NULL), 218 remoteLink(LinkID::UNSPECIFIED), remoteLocator(NULL), 219 up(false) { 220 } 212 LinkDescriptor() : up(false), id(), localLocator(NULL), remoteLocator(NULL) {} 221 213 222 214 ~LinkDescriptor() { … … 226 218 227 219 bool isUnspecified() const { 228 return (this == &UNSPECIFIED());220 return id.isUnspecified(); 229 221 } 230 222 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; 223 /// flag, whether this link is up 224 bool up; 225 226 /// link identifier 227 LinkID id; 228 229 /// locators 241 230 const address_v* localLocator; 242 243 /// used underlay addresses for the link244 LinkID remoteLink;245 231 const address_v* remoteLocator; 246 232 247 233 /// the remote end-point descriptor 248 234 EndpointDescriptor remoteEndpoint; 249 250 /// flag, whether this link is up251 bool up;252 235 }; 253 236 … … 259 242 260 243 /// Link management: add a link 261 void addLink( LinkDescriptor*link );244 LinkDescriptor& addLink( LinkID link ); 262 245 263 246 /// Link management: remove a link 264 void removeLink( const LinkID& localLink);247 void removeLink( LinkID link); 265 248 266 249 /// Link management: get link information using the local link 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; 250 LinkDescriptor& queryLink( LinkID link) const; 271 251 272 252 /// The local end-point descriptor … … 307 287 /// convenience: send message to peer 308 288 void send( Message* message, const EndpointDescriptor& endpoint ); 289 309 290 void send( Message* message, const LinkDescriptor& descriptor ); 310 291 311 292 /// state of the base communication 312 293 bool started; 313 314 294 }; 315 295
Note:
See TracChangeset
for help on using the changeset viewer.