Ignore:
Timestamp:
Mar 10, 2008, 5:39:36 PM (17 years ago)
Author:
dai_9181
Message:

・ジェネリックな型をパラメータに持つメソッドのオーバーロード解決に対応した。
・型パラメータの制約クラス指定に対応した。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/src/Enum.cpp

    r407 r424  
    177177        sprintf(buffer+length,"Class Enum %s\n",enumInfo.GetName().c_str());
    178178        length+=lstrlen(buffer+length);
    179         lstrcpy(buffer+length,"\tInherits EnumBase\n");
     179        sprintf(buffer+length,"\tInherits EnumBase<%s>\n",enumInfo.GetName().c_str());
    180180        length+=lstrlen(buffer+length);
    181181        sprintf(buffer+length,"\tSub %s(value As Long,lpszName As LPSTR)\n",enumInfo.GetName().c_str());
     
    211211        }
    212212
    213         sprintf(buffer+length,"\tFunction Operator or (enumBase As %s) As %s\n",enumInfo.GetName().c_str(),enumInfo.GetName().c_str());
    214         length+=lstrlen(buffer+length);
    215         sprintf(buffer+length,"\t\tReturn New %s(This.value or enumBase.value, \"custom\")\n",enumInfo.GetName().c_str());
    216         length+=lstrlen(buffer+length);
    217         lstrcpy(buffer+length,"\tEnd Function\n");
    218         length+=lstrlen(buffer+length);
    219 
    220         sprintf(buffer+length,"\tFunction Operator and (enumBase As %s) As %s\n",enumInfo.GetName().c_str(),enumInfo.GetName().c_str());
    221         length+=lstrlen(buffer+length);
    222         sprintf(buffer+length,"\t\tReturn New %s(This.value and enumBase.value, \"custom\")\n",enumInfo.GetName().c_str());
    223         length+=lstrlen(buffer+length);
    224         lstrcpy(buffer+length,"\tEnd Function\n");
    225         length+=lstrlen(buffer+length);
    226 
    227         /*
    228         sprintf(buffer+length,"\tOverride Function ToString() As String\n",enumInfo.TypeName);
    229         length+=lstrlen(buffer+length);
    230         lstrcpy(buffer+length,"\t\tSelect Case value\n");
    231         length+=lstrlen(buffer+length);
    232         for(i2=0;i2<enumInfo.iEnumMemberNum;i2++){
    233             CEnumMember *member;
    234             member=enumInfo.ppobj_EnumMember[i2];
    235 
    236             sprintf(buffer+length,"\t\t\tCase %d\n",member->m_value);
    237             length+=lstrlen(buffer+length);
    238             sprintf(buffer+length,"\t\t\t\tReturn \"%s\"\n",member->m_name);
    239             length+=lstrlen(buffer+length);
    240         }
    241         lstrcpy(buffer+length,"\t\tEnd Select\n");
    242         length+=lstrlen(buffer+length);
    243         lstrcpy(buffer+length,"\tEnd Function\n");
    244         length+=lstrlen(buffer+length);
    245 
    246        
    247         sprintf(buffer+length,"\tSub Operator= (ByRef value As %s)\n",enumInfo.TypeName);
    248         length+=lstrlen(buffer+length);
    249         lstrcpy(buffer+length,"\t\tThis.Copy(ByVal VarPtr(value))\n");
    250         length+=lstrlen(buffer+length);
    251         lstrcpy(buffer+length,"\tEnd Sub\n");
    252         length+=lstrlen(buffer+length);
    253 
    254         sprintf(buffer+length,"\tSub Operator= (ByRef value As String)\n",enumInfo.TypeName);
    255         length+=lstrlen(buffer+length);
    256         lstrcpy(buffer+length,"\t\tSelect Case value\n");
    257         length+=lstrlen(buffer+length);
    258         for(i2=0;i2<enumInfo.iEnumMemberNum;i2++){
    259             CEnumMember *member;
    260             member=enumInfo.ppobj_EnumMember[i2];
    261 
    262             sprintf(buffer+length,"\t\t\tCase \"%s\"\n",member->m_name);
    263             length+=lstrlen(buffer+length);
    264             sprintf(buffer+length,"\t\t\t\tThis=%s.%s\n",enumInfo.TypeName,member->m_name);
    265             length+=lstrlen(buffer+length);
    266         }
    267         lstrcpy(buffer+length,"\t\tEnd Select\n");
    268         length+=lstrlen(buffer+length);
    269         lstrcpy(buffer+length,"\tEnd Sub\n");
    270         length+=lstrlen(buffer+length);
    271 
    272         sprintf(buffer+length,"\tSub Operator= (value As Long)\n",enumInfo.TypeName);
    273         length+=lstrlen(buffer+length);
    274         lstrcpy(buffer+length,"\t\tm_Value=value\n");
    275         length+=lstrlen(buffer+length);
    276         lstrcpy(buffer+length,"\tEnd Sub\n");
    277         length+=lstrlen(buffer+length);*/
    278 
    279213        lstrcpy(buffer+length,"End Class\n");
    280214        length+=lstrlen(buffer+length);
Note: See TracChangeset for help on using the changeset viewer.