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