Changeset 57

Show
Ignore:
Timestamp:
06/27/08 02:51:40 (4 months ago)
Author:
baxissimo
Message:

Skipping of interafaces should be excluded by "static if" not just "if" to prevent code gen.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/doost/util/serializer/archive/BinaryArchive.d

    r55 r57  
    669669            //BUG: a way to access all fields from class neverthless of protection attributes 
    670670            foreach(i, BASE; BaseTypeTuple!(VALUE)) { 
    671  
    672                 if (is (BASE == interface) || BASE.tupleof.length == 0) continue; 
    673                 if (!skip(Marker.udtInherit)) 
    674                     throw new ParsingException("Missing UDT inheritance indicator."); 
    675  
    676                 BASE res = cast(BASE)value; 
    677                 processMemberStruct(res); 
     671                static if (is (BASE == interface) || BASE.tupleof.length == 0) {} 
     672                else { 
     673                    if (!skip(Marker.udtInherit)) 
     674                        throw new ParsingException("Missing UDT inheritance indicator."); 
     675 
     676                    BASE res = cast(BASE)value; 
     677                    pragma(msg, "loadUdt BASE =='"~BASE.stringof~"'"); 
     678                    processMemberStruct(res); 
     679                } 
    678680            } 
    679681        } 
     
    688690        static if( is( VALUE == class )) { 
    689691            foreach(i, BASE; BaseTypeTuple!(VALUE)) { 
    690                 if (is (BASE == interface) || BASE.tupleof.length == 0) continue; 
    691                 storage.put(Marker.udtInherit); 
    692                 BASE val = cast(BASE)value; 
    693                 processMemberStruct(val); 
     692                static if (is (BASE == interface) || BASE.tupleof.length == 0) {} 
     693                else { 
     694                    storage.put(Marker.udtInherit); 
     695                    BASE val = cast(BASE)value; 
     696                    processMemberStruct(val); 
     697                } 
    694698            } 
    695699        } 
  • trunk/doost/util/serializer/archive/JsonArchive.d

    r52 r57  
    721721 
    722722            foreach(i, BASE; BaseTypeTuple!(VALUE)) { 
    723                 if (is (BASE == interface) || BASE.tupleof.length == 0) continue; 
    724                 BASE res = cast(BASE)value; 
    725                 tokenizeMemberStructFields(BASE.stringof, includedclasses); 
    726                 processMemberStruct(res); 
     723                static if (is (BASE == interface) || BASE.tupleof.length == 0) {} 
     724                else { 
     725                    BASE res = cast(BASE)value; 
     726                    tokenizeMemberStructFields(BASE.stringof, includedclasses); 
     727                    processMemberStruct(res); 
     728                } 
    727729            } 
    728730        } 
     
    743745        static if( is( VALUE == class )) { 
    744746            foreach(i, BASE; BaseTypeTuple!(VALUE)) { 
    745                 if (is (BASE == interface) || BASE.tupleof.length == 0) continue; 
    746                 if (line_begin) dumpIndent(); 
    747                 storage.put(Udt.separator ~ Skip.newline); 
    748                 line_begin = true; 
    749                 BASE val = cast(BASE)value; 
    750                 processMemberStruct(val); 
     747                static if (is (BASE == interface) || BASE.tupleof.length == 0) {} 
     748                else { 
     749                    if (line_begin) dumpIndent(); 
     750                    storage.put(Udt.separator ~ Skip.newline); 
     751                    line_begin = true; 
     752                    BASE val = cast(BASE)value; 
     753                    processMemberStruct(val); 
     754                } 
    751755            } 
    752756        } 
  • trunk/doost/util/serializer/archive/TextArchive.d

    r52 r57  
    603603            //BUG: a way to access all fields from class neverthless of protection attributes 
    604604            foreach(i, BASE; BaseTypeTuple!(VALUE)) { 
    605  
    606                 if (is (BASE == interface) || BASE.tupleof.length == 0) continue; 
    607                 if (!skip(storage, defUdt.inherit)) 
    608                     throw new ParsingException("Missing UDT inheritance indicator."); 
    609  
    610                 BASE res = cast(BASE)value; 
    611                 processMemberStruct(res); 
     605                static if (is (BASE == interface) || BASE.tupleof.length == 0) {} 
     606                else { 
     607                    if (!skip(storage, defUdt.inherit)) 
     608                        throw new ParsingException("Missing UDT inheritance indicator."); 
     609 
     610                    BASE res = cast(BASE)value; 
     611                    processMemberStruct(res); 
     612                } 
    612613            } 
    613614        } 
     
    623624        static if( is( VALUE == class )) { 
    624625            foreach(i, BASE; BaseTypeTuple!(VALUE)) { 
    625                 if (is (BASE == interface) || BASE.tupleof.length == 0) continue; 
    626                 storage.put(defUdt.inherit); 
    627                 BASE val = cast(BASE)value; 
    628                 processMemberStruct(val); 
     626                static if (is (BASE == interface) || BASE.tupleof.length == 0) {} 
     627                else { 
     628                    storage.put(defUdt.inherit); 
     629                    BASE val = cast(BASE)value; 
     630                    processMemberStruct(val); 
     631                } 
    629632            } 
    630633        }