Changeset 5485


Ignore:
Timestamp:
Jul 30, 2009, 3:07:54 PM (15 years ago)
Author:
Christoph Mayer
Message:

static initialization workaround

Location:
source/ariba/communication
Files:
2 edited

Legend:

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

    r5406 r5485  
    5555
    5656use_logging_cpp(BaseCommunication);
    57 const BaseCommunication::LinkDescriptor
    58         BaseCommunication::LinkDescriptor::UNSPECIFIED;
    5957
    6058BaseCommunication::BaseCommunication() {
     
    501499        for (int i=0; i<linkSet.size();i++)
    502500                if (linkSet[i]->localLink == link) return (LinkDescriptor&)*linkSet[i];
    503         return (LinkDescriptor&)LinkDescriptor::UNSPECIFIED;
     501
     502        LinkDescriptor ret;
     503        ret.unspecified = true;
     504        return ret;
    504505}
    505506
     
    508509        for (int i=0; i<linkSet.size();i++)
    509510                if (linkSet[i]->remoteLink == link) return (LinkDescriptor&)*linkSet[i];
    510         return (LinkDescriptor&)LinkDescriptor::UNSPECIFIED;
     511
     512        LinkDescriptor ret;
     513        ret.unspecified = true;
     514        return ret;
    511515}
    512516
  • source/ariba/communication/BaseCommunication.h

    r5358 r5485  
    229229        class LinkDescriptor {
    230230        public:
    231                 static const LinkDescriptor UNSPECIFIED;
    232231
    233232                /// default constructor
     
    235234                        localLink(LinkID::UNSPECIFIED), localLocator(NULL),
    236235                        remoteLink(LinkID::UNSPECIFIED), remoteLocator(NULL),
    237                         remoteEndpoint(EndpointDescriptor::UNSPECIFIED), up(false) {
     236                        remoteEndpoint(EndpointDescriptor::UNSPECIFIED), up(false), unspecified(false) {
    238237                }
    239238
     
    243242                }
    244243
    245                 /// returns true if this is the UNSPECIFIED object
    246244                bool isUnspecified() const {
    247                         return this == &UNSPECIFIED;
     245                        return unspecified;
    248246                }
     247
     248                bool unspecified;
    249249
    250250                /// link identifiers
     
    288288        NetworkChangeDetection networkMonitor;
    289289#endif
     290
    290291        /// event listener
    291292        typedef set<CommunicationEvents*> EventListenerSet;
Note: See TracChangeset for help on using the changeset viewer.