Changeset 5624 for source


Ignore:
Timestamp:
Aug 3, 2009, 2:29:12 PM (15 years ago)
Author:
Christoph Mayer
Message:

maemo segfault wegen static object ctors workaround

Location:
source/ariba
Files:
16 edited

Legend:

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

    r5618 r5624  
    244244        } else {
    245245                LinkDescriptor& linkDesc = queryLocalLink(link);
    246                 if (linkDesc.isUnspecified()) return EndpointDescriptor::UNSPECIFIED;
     246                if (linkDesc.isUnspecified()) return EndpointDescriptor::UNSPECIFIED();
    247247                return linkDesc.remoteEndpoint;
    248248        }
     
    534534                if (linkSet[i]->localLink == link) return (LinkDescriptor&)*linkSet[i];
    535535
    536         LinkDescriptor ret;
    537         ret.unspecified = true;
    538         return ret;
     536        return LinkDescriptor::UNSPECIFIED();
    539537}
    540538
     
    544542                if (linkSet[i]->remoteLink == link) return (LinkDescriptor&)*linkSet[i];
    545543
    546         LinkDescriptor ret;
    547         ret.unspecified = true;
    548         return ret;
     544        return LinkDescriptor::UNSPECIFIED();
    549545}
    550546
  • source/ariba/communication/BaseCommunication.h

    r5614 r5624  
    234234                        localLink(LinkID::UNSPECIFIED), localLocator(NULL),
    235235                        remoteLink(LinkID::UNSPECIFIED), remoteLocator(NULL),
    236                         remoteEndpoint(EndpointDescriptor::UNSPECIFIED), up(false), unspecified(false) {
     236                        up(false) {
    237237                }
    238238
     
    243243
    244244                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;
    246252                }
    247253
  • source/ariba/communication/EndpointDescriptor.cpp

    r5508 r5624  
    4242namespace communication {
    4343
    44 const EndpointDescriptor EndpointDescriptor::UNSPECIFIED;
    4544vsznDefault(EndpointDescriptor);
    4645
    47 EndpointDescriptor::EndpointDescriptor() {
     46EndpointDescriptor::EndpointDescriptor(){
    4847}
    4948
    50 EndpointDescriptor::~EndpointDescriptor() {
     49EndpointDescriptor::~EndpointDescriptor(){
    5150
    5251}
    5352
    5453EndpointDescriptor::EndpointDescriptor(const EndpointDescriptor& rh) :
    55         endpoints(rh.endpoints) {
     54        endpoints(rh.endpoints){
    5655}
    5756
    5857EndpointDescriptor::EndpointDescriptor(const endpoint_set& endpoints ) :
    59         endpoints(endpoints) {
     58        endpoints(endpoints){
    6059}
    6160
    62 EndpointDescriptor::EndpointDescriptor(const string& str) : endpoints(str) {
     61EndpointDescriptor::EndpointDescriptor(const string& str) : endpoints(str){
    6362}
    6463
  • source/ariba/communication/EndpointDescriptor.h

    r5502 r5624  
    5656
    5757public:
    58         /// the unspecified endpoint descriptor
    59         static const EndpointDescriptor UNSPECIFIED;
    60 
    6158        /// creates an empty endpoint descriptor with zero endpoints
    6259        EndpointDescriptor();
     
    7976        }
    8077
     78        static EndpointDescriptor& UNSPECIFIED() {
     79                static EndpointDescriptor* unspec = NULL;
     80                if(unspec == NULL) unspec = new EndpointDescriptor();
     81
     82                return *unspec;
     83        }
     84
    8185        /// returns true, if this object is the unspecified object
    8286        bool isUnspecified() const {
    83                 return this == &UNSPECIFIED;
     87                return (this == &UNSPECIFIED());
    8488        }
    8589
  • source/ariba/overlay/BaseOverlay.cpp

    r5554 r5624  
    654654        // find link descriptor. not found -> return unspecified
    655655        const LinkDescriptor* ld = getDescriptor(link);
    656         if (ld==NULL) return EndpointDescriptor::UNSPECIFIED;
     656        if (ld==NULL) return EndpointDescriptor::UNSPECIFIED();
    657657
    658658        // return endpoint-descriptor from base communication
     
    670670        if( overlayInterface == NULL ) {
    671671                logging_error( "overlay interface not set, cannot resolve endpoint" );
    672                 return EndpointDescriptor::UNSPECIFIED;
     672                return EndpointDescriptor::UNSPECIFIED();
    673673        }
    674674
  • source/ariba/overlay/BaseOverlay.h

    r5556 r5624  
    269269         * @param boot A bootstrap node
    270270         */
    271         void joinSpoVNet(const SpoVNetID& id, const EndpointDescriptor& boot = EndpointDescriptor::UNSPECIFIED);
     271        void joinSpoVNet(const SpoVNetID& id, const EndpointDescriptor& boot = EndpointDescriptor::UNSPECIFIED());
    272272
    273273        /**
  • source/ariba/overlay/messages/JoinReply.h

    r5151 r5624  
    7171                const OverlayParameterSet _param = OverlayParameterSet::DEFAULT,
    7272                bool _joinAllowed = false,
    73                 const EndpointDescriptor _bootstrapEp = EndpointDescriptor::UNSPECIFIED
     73                const EndpointDescriptor _bootstrapEp = EndpointDescriptor::UNSPECIFIED()
    7474        );
    7575
  • source/ariba/overlay/modules/OverlayInterface.h

    r5316 r5624  
    103103         *    end-point, if this node is the initiator
    104104         */
    105         virtual void joinOverlay(const EndpointDescriptor& bootstrap =
    106                 EndpointDescriptor::UNSPECIFIED ) = 0;
     105        virtual void joinOverlay(const EndpointDescriptor& bootstrap = EndpointDescriptor::UNSPECIFIED()) = 0;
    107106
    108107        /**
  • source/ariba/overlay/modules/chord/Chord.cpp

    r5555 r5624  
    133133const EndpointDescriptor& Chord::resolveNode(const NodeID& node) {
    134134        const route_item* item = table->get(node);
    135         if (item == NULL || item->info.isUnspecified()) return EndpointDescriptor::UNSPECIFIED;
     135        if (item == NULL || item->info.isUnspecified()) return EndpointDescriptor::UNSPECIFIED();
    136136        return baseoverlay.getEndpointDescriptor(item->info);
    137137}
  • source/ariba/overlay/modules/chord/Chord.h

    r5316 r5624  
    104104        /// @see OverlayInterface.h
    105105        virtual void joinOverlay(
    106                 const EndpointDescriptor& boot = EndpointDescriptor::UNSPECIFIED
     106                const EndpointDescriptor& boot = EndpointDescriptor::UNSPECIFIED()
    107107        );
    108108
  • source/ariba/overlay/modules/onehop/OneHop.cpp

    r5316 r5624  
    7171
    7272        OverlayNodeMapping::const_iterator i = overlayNodes.find( node );
    73         if (i == overlayNodes.end()) return EndpointDescriptor::UNSPECIFIED;
     73        if (i == overlayNodes.end()) return EndpointDescriptor::UNSPECIFIED();
    7474
    7575        const EndpointDescriptor& ep = baseoverlay.getEndpointDescriptor( i->second );
  • source/ariba/overlay/modules/onehop/OneHop.h

    r5316 r5624  
    7272        /// @see OverlayInterface.h
    7373        virtual void joinOverlay(const EndpointDescriptor& boot =
    74                         EndpointDescriptor::UNSPECIFIED);
     74                        EndpointDescriptor::UNSPECIFIED());
    7575
    7676        /// @see OverlayInterface.h
  • source/ariba/utility/addressing

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • source/ariba/utility/bootstrap/modules/bluetoothsdp

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • source/ariba/utility/bootstrap/modules/periodicbroadcast

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • source/ariba/utility/transport

    • Property svn:mergeinfo changed (with no actual effect on merging)
Note: See TracChangeset for help on using the changeset viewer.