dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/engine lib_reflect.c,1.33,1.34


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/engine lib_reflect.c,1.33,1.34
Date: Sun, 04 May 2003 17:34:12 -0400

Update of /cvsroot/dotgnu-pnet/pnet/engine
In directory subversions:/tmp/cvs-serv2362/engine

Modified Files:
        lib_reflect.c 
Log Message:
Reflection on attributes with tagged objects (variant)


Index: lib_reflect.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/engine/lib_reflect.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -r1.33 -r1.34
*** lib_reflect.c       25 Apr 2003 01:22:00 -0000      1.33
--- lib_reflect.c       4 May 2003 21:34:10 -0000       1.34
***************
*** 116,121 ****
--- 116,125 ----
        int strLen;
        int arrayLen;
+       int boxedType;
        System_Array * arrayVal;
        ILObject ** buf;
+       ILType *typeAttr;
+       ILType *systemType=ILExecThreadLookupType(thread,"oSystem.Type");
+       ILClass *classInfo;
        
        if(serialType!=ILSerializeGetType(type))
***************
*** 164,167 ****
--- 168,250 ----
                                        return 
(ILObject*)((System_String*)ILStringCreateLen(thread,
                                                                        
strValue,strLen));      
+                       case IL_META_SERIALTYPE_TYPE:
+                                       strLen = 
ILSerializeReaderGetString(reader,&strValue);
+                                       if(strLen == -1) 
+                                       {
+                                               return NULL;
+                                       }
+                                       classInfo = 
ILExecThreadLookupClass(thread,strValue);
+                                       if(!classInfo)
+                                       {
+                                               return NULL;
+                                       }
+                                       classInfo = ILClassResolve(classInfo);
+                                       if(ILClass_IsValueType(classInfo))
+                                       {
+                                               typeAttr = 
ILType_FromValueType(classInfo);
+                                       }
+                                       else
+                                       {
+                                               typeAttr = 
ILType_FromClass(classInfo);
+                                       }
+                                       return 
_ILGetClrTypeForILType(thread,typeAttr);
+                                       
+                       case IL_META_SERIALTYPE_VARIANT:
+                                       
boxedType=ILSerializeReaderGetBoxedPrefix(reader);
+                                       if(boxedType==-1)
+                                       {
+                                               return NULL;
+                                       }
+                                       switch(boxedType)
+                                       {
+                                               case IL_META_SERIALTYPE_BOOLEAN 
:
+                                               case IL_META_SERIALTYPE_CHAR :
+                                               case IL_META_SERIALTYPE_I1 :
+                                               case IL_META_SERIALTYPE_U1 :
+                                               case IL_META_SERIALTYPE_I2 :
+                                               case IL_META_SERIALTYPE_U2 :
+                                               case IL_META_SERIALTYPE_I4 :
+                                               case IL_META_SERIALTYPE_U4 :
+                                               case IL_META_SERIALTYPE_I8 :
+                                               case IL_META_SERIALTYPE_U8 :
+                                               case IL_META_SERIALTYPE_R4 :
+                                               case IL_META_SERIALTYPE_R8 :
+                                               case IL_META_SERIALTYPE_STRING :
+                                               {
+                                                       /* NOTE: Right now all 
the serialtypes and
+                                                        * Elemtypes are the 
same for primitives */
+                                                       return 
DeserializeObject(thread,reader,
+                                                                       
ILType_FromElement(boxedType),boxedType);
+                                               }
+                                               /* not reached */
+                                               case IL_META_SERIALTYPE_TYPE:
+                                               {
+                                                       return 
DeserializeObject(thread,reader,
+                                                                       
systemType, IL_META_SERIALTYPE_TYPE);
+                                               }
+                                               case IL_META_SERIALTYPE_ENUM:
+                                               {
+                                                       int i;
+                                                       strLen = 
ILSerializeReaderGetString(reader,
+                                                                               
                                        &strValue);
+                                                       if(strLen == -1) 
+                                                       {
+                                                               return NULL;
+                                                       }
+                                                       
classInfo=ILExecThreadLookupClass(thread,strValue);
+                                                       if(!classInfo)
+                                                       {
+                                                               return NULL;
+                                                       }       
+                                                       
classInfo=ILClassResolve(classInfo);
+                                                       
+                                                       typeAttr = 
ILType_FromValueType(classInfo);
+                                                       
+                                                       return 
DeserializeObject(thread, reader,
+                                                                               
        typeAttr, 
+                                                                               
        ILSerializeGetType(typeAttr));
+                                               }
+                                       }
+                                       
                        default:
                                        if((serialType & 
IL_META_SERIALTYPE_ARRAYOF)!=0)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]