Changeset 5624 for source/ariba/communication
- Timestamp:
- Aug 3, 2009, 2:29:12 PM (15 years ago)
- Location:
- source/ariba/communication
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/communication/BaseCommunication.cpp
r5618 r5624 244 244 } else { 245 245 LinkDescriptor& linkDesc = queryLocalLink(link); 246 if (linkDesc.isUnspecified()) return EndpointDescriptor::UNSPECIFIED ;246 if (linkDesc.isUnspecified()) return EndpointDescriptor::UNSPECIFIED(); 247 247 return linkDesc.remoteEndpoint; 248 248 } … … 534 534 if (linkSet[i]->localLink == link) return (LinkDescriptor&)*linkSet[i]; 535 535 536 LinkDescriptor ret; 537 ret.unspecified = true; 538 return ret; 536 return LinkDescriptor::UNSPECIFIED(); 539 537 } 540 538 … … 544 542 if (linkSet[i]->remoteLink == link) return (LinkDescriptor&)*linkSet[i]; 545 543 546 LinkDescriptor ret; 547 ret.unspecified = true; 548 return ret; 544 return LinkDescriptor::UNSPECIFIED(); 549 545 } 550 546 -
source/ariba/communication/BaseCommunication.h
r5614 r5624 234 234 localLink(LinkID::UNSPECIFIED), localLocator(NULL), 235 235 remoteLink(LinkID::UNSPECIFIED), remoteLocator(NULL), 236 remoteEndpoint(EndpointDescriptor::UNSPECIFIED), up(false), unspecified(false) {236 up(false) { 237 237 } 238 238 … … 243 243 244 244 bool isUnspecified() const { 245 return unspecified; 245 return (this == &UNSPECIFIED()); 246 } 247 248 static LinkDescriptor& UNSPECIFIED(){ 249 static LinkDescriptor* unspec = NULL; 250 if(unspec == NULL) unspec = new LinkDescriptor(); 251 return *unspec; 246 252 } 247 253 -
source/ariba/communication/EndpointDescriptor.cpp
r5508 r5624 42 42 namespace communication { 43 43 44 const EndpointDescriptor EndpointDescriptor::UNSPECIFIED;45 44 vsznDefault(EndpointDescriptor); 46 45 47 EndpointDescriptor::EndpointDescriptor() 46 EndpointDescriptor::EndpointDescriptor(){ 48 47 } 49 48 50 EndpointDescriptor::~EndpointDescriptor() 49 EndpointDescriptor::~EndpointDescriptor(){ 51 50 52 51 } 53 52 54 53 EndpointDescriptor::EndpointDescriptor(const EndpointDescriptor& rh) : 55 endpoints(rh.endpoints) 54 endpoints(rh.endpoints){ 56 55 } 57 56 58 57 EndpointDescriptor::EndpointDescriptor(const endpoint_set& endpoints ) : 59 endpoints(endpoints) 58 endpoints(endpoints){ 60 59 } 61 60 62 EndpointDescriptor::EndpointDescriptor(const string& str) : endpoints(str) 61 EndpointDescriptor::EndpointDescriptor(const string& str) : endpoints(str){ 63 62 } 64 63 -
source/ariba/communication/EndpointDescriptor.h
r5502 r5624 56 56 57 57 public: 58 /// the unspecified endpoint descriptor59 static const EndpointDescriptor UNSPECIFIED;60 61 58 /// creates an empty endpoint descriptor with zero endpoints 62 59 EndpointDescriptor(); … … 79 76 } 80 77 78 static EndpointDescriptor& UNSPECIFIED() { 79 static EndpointDescriptor* unspec = NULL; 80 if(unspec == NULL) unspec = new EndpointDescriptor(); 81 82 return *unspec; 83 } 84 81 85 /// returns true, if this object is the unspecified object 82 86 bool isUnspecified() const { 83 return this == &UNSPECIFIED;87 return (this == &UNSPECIFIED()); 84 88 } 85 89
Note:
See TracChangeset
for help on using the changeset viewer.