Changeset 255 for trunk/nom/src
- Timestamp:
- Mar 15, 2007, 9:42:22 PM (18 years ago)
- Location:
- trunk/nom/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nom/src/nombuildclass.c
r221 r255 16 16 * The Initial Developer of the Original Code is 17 17 * netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>. 18 * Portions created by the Initial Developer are Copyright (C) 2005-200 618 * Portions created by the Initial Developer are Copyright (C) 2005-2007 19 19 * the Initial Developer. All Rights Reserved. 20 20 * … … 969 969 ulMajorVersion, ulMinorVersion); 970 970 if(nomClass){ 971 CORBA_Environment * tempEnv=nomCreateEnvNoObjectCheck(); 972 971 973 DBG_NOMBUILDCLASS(TRUE, "%s: class is 0x%x\n", nomClass->mtab->nomClassName, nomClass); 972 974 #if 0 … … 977 979 priv_checkForNomUnInitOverride( (NOMClassPriv*)nomClass->mtab->nomClsInfo, ncpParent); 978 980 #endif 979 _nomInit((NOMObject*)nomClass, NULLHANDLE); 980 _nomClassReady(nomClass, NULLHANDLE); 981 /* Make sure the env is marked that we don't chek the object pointer. This would fail 982 because the class isn't registered yet. */ 983 _nomInit((NOMObject*)nomClass, tempEnv); 984 _nomClassReady(nomClass, tempEnv); 981 985 } 982 986 … … 993 997 994 998 if(nomClass){ 995 _nomInit((NOMObject*)nomClass, NULLHANDLE); 996 _nomClassReady(nomClass, NULLHANDLE); 999 CORBA_Environment * tempEnv=nomCreateEnvNoObjectCheck(); 1000 /* Make sure the env is marked that we don't chek the object pointer. This would fail 1001 because the class isn't registered yet. */ 1002 _nomInit((NOMObject*)nomClass, tempEnv); 1003 _nomClassReady(nomClass, tempEnv); 997 1004 } 998 1005 return nomClass; … … 1088 1095 1089 1096 if(nomClass){ 1097 CORBA_Environment * tempEnv=nomCreateEnvNoObjectCheck(); 1098 1090 1099 /* Mark the class as using nomUnInit() if any parent did that. We just have to 1091 1100 check the flag and the flag of the parent class. This information is important … … 1094 1103 priv_checkForNomUnInitOverride( (NOMClassPriv*)nomClass->mtab->nomClsInfo, ncpParent); 1095 1104 1096 _nomInit(nomClass, NULLHANDLE); 1097 _nomClassReady(nomClass, NULLHANDLE); 1105 /* Make sure the env is marked that we don't chek the object pointer. This would fail 1106 because the class isn't registered yet. */ 1107 _nomInit(nomClass, tempEnv); 1108 _nomClassReady(nomClass, tempEnv); 1098 1109 } 1099 1110 return nomClass; -
trunk/nom/src/nombuildnomcls.c
r221 r255 16 16 * The Initial Developer of the Original Code is 17 17 * netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>. 18 * Portions created by the Initial Developer are Copyright (C) 2005-200 618 * Portions created by the Initial Developer are Copyright (C) 2005-2007 19 19 * the Initial Developer. All Rights Reserved. 20 20 * -
trunk/nom/src/nombuildnomobj.c
r221 r255 16 16 * The Initial Developer of the Original Code is 17 17 * netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>. 18 * Portions created by the Initial Developer are Copyright (C) 2005-200 618 * Portions created by the Initial Developer are Copyright (C) 2005-2007 19 19 * the Initial Developer. All Rights Reserved. 20 20 * -
trunk/nom/src/nomdebug.c
r94 r255 16 16 * The Initial Developer of the Original Code is 17 17 * netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>. 18 * Portions created by the Initial Developer are Copyright (C) 2005-200 618 * Portions created by the Initial Developer are Copyright (C) 2005-2007 19 19 * the Initial Developer. All Rights Reserved. 20 20 * … … 55 55 //#include "cwsomcls.h" 56 56 extern NOMClassMgr* NOMClassMgrObject; 57 57 extern gboolean fInitialized; 58 59 NOMEXTERN void NOMLINK nomPrintObjectPointerErrorMsg(NOMObject* nomObject, gchar *chrClsName, gchar* chrMethodName) 60 { 61 if(!nomObject) 62 g_warning("The object used to call the method %s is not valid. A NULL pointer was given.", chrMethodName); 63 else{ 64 if(!nomIsObj(nomObject)) 65 g_warning("The object used to call the method %s is not a valid NOM object. ", chrMethodName); 66 else 67 g_warning("The object used to call the method %s is not valid for this method. The object must be some instance of class %s (or of a subclass) but is a %s.", chrMethodName, chrClsName, NOMObject_nomGetClassName(nomObject, NULLHANDLE)); 68 } 69 } 70 71 /* 72 This function prints some more info about the object error. It's used for generic checks which 73 always return NULL which isn't always correct. 74 */ 75 static void nomPrintAdditionalErrorMsg(void) 76 { 77 g_message("Note that NULL is returned for the call (if the method returns a value). This may not be correct. Use the NOMPARMCHECK() macro to specify default return values for methods."); 78 } 79 80 /* Function to check if NOMObject is valid before calling a method on it. Note that we don't have to check 81 the instance class here using nomIsA*(). */ 82 NOMEXTERN gboolean NOMLINK nomCheckNOMObjectPtr(NOMObject *nomSelf, NOMClass* nomClass, gchar* chrMethodName, CORBA_Environment *ev) 83 { 84 /* Not initialized yet, so object check won't work. This means the three core NOM classes are not 85 yet created.*/ 86 if(!fInitialized) 87 return TRUE; 88 89 if(ev && (ev->fFlags & NOMENV_FLG_DONT_CHECK_OBJECT)) 90 return TRUE; 91 92 // g_message("In %s with %s %px nomClass: %px (%s)", __FUNCTION__, chrMethodName, nomSelf, nomClass, nomClass->mtab->nomClassName); 93 if(!nomIsObj(nomSelf)) 94 { 95 nomPrintObjectPointerErrorMsg(nomSelf, nomClass->mtab->nomClassName, chrMethodName); 96 nomPrintAdditionalErrorMsg(); 97 return FALSE; 98 } 99 return TRUE; 100 } 101 102 #include <string.h> 103 /* Function to check if an object is valid before calling a method on it */ 104 NOMEXTERN gboolean NOMLINK nomCheckObjectPtr(NOMObject *nomSelf, NOMClass* nomClass, gchar* chrMethodName, CORBA_Environment *ev) 105 { 106 /* Not initialized yet, so object check won't work. This means the three core NOM classes are not 107 yet created.*/ 108 if(!fInitialized) 109 return TRUE; 110 111 //if(strstr( chrMethodName, "nomIsObj")) 112 //return TRUE; 113 114 if(ev && (ev->fFlags & NOMENV_FLG_DONT_CHECK_OBJECT)) 115 return TRUE; 116 117 // g_message("In %s with %s %px nomClass: %px (%s)", __FUNCTION__, chrMethodName, nomSelf, nomClass, nomClass->mtab->nomClassName); 118 if(!nomIsObj(nomSelf) || !_nomIsANoClsCheck(nomSelf, nomClass, NULLHANDLE)) 119 { 120 nomPrintObjectPointerErrorMsg(nomSelf, nomClass->mtab->nomClassName, chrMethodName); 121 nomPrintAdditionalErrorMsg(); 122 return FALSE; 123 } 124 return TRUE; 125 } 126 127 NOMEXTERN CORBA_Environment* NOMLINK nomCreateEnvNoObjectCheck(void) 128 { 129 CORBA_Environment * tempEnv=(CORBA_Environment*)NOMMalloc(sizeof(CORBA_Environment)); 130 if(tempEnv) 131 tempEnv->fFlags|=NOMENV_FLG_DONT_CHECK_OBJECT; 132 return tempEnv; 133 } 134 58 135 static void dumpClassFunc(GQuark gquark, gpointer data, gpointer user_data) 59 136 { -
trunk/nom/src/nomtkinit.c
r219 r255 61 61 NOMClassMgr* NOMClassMgrObject=NULLHANDLE; /* Referenced from different files */ 62 62 63 gboolean fInitialized=FALSE; 64 63 65 /********************************************************/ 64 66 /* Toolkit functions, exported */ … … 131 133 NOMClassPriv* ncPriv; 132 134 NOMClass* nomCls; 135 // NOMClassMgr *NOMClassMgrObject_priv; 133 136 #if 0 134 137 NOMObject *nomObj; … … 162 165 163 166 #ifdef DEBUG_NOMENVNEW 164 nomPrintf("%s: NOMClassMgrObject: %x \n", __FUNCTION__, NOMClassMgrObject);167 nomPrintf("%s: NOMClassMgrObject: %x (%x)\n", __FUNCTION__, NOMClassMgrObject, pGlobalNomEnv->defaultMetaClass); 165 168 #endif 166 169 … … 196 199 _nomTestFunc_NOMTest2(nomTst2Obj, NULLHANDLE); 197 200 #endif 201 /* This must be done last! */ 202 // NOMClassMgrObject=NOMClassMgrObject_priv; 203 204 fInitialized=TRUE; 198 205 199 206 return NOMClassMgrObject;
Note:
See TracChangeset
for help on using the changeset viewer.