Changeset 294


Ignore:
Timestamp:
Apr 7, 2007, 4:29:56 PM (18 years ago)
Author:
cinc
Message:

Added ID to object mtab.

Location:
trunk/nom
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/nom/Makefile

    r284 r294  
    9393#BASE_NOMCOMPILEH       =       $(IDLCOMP) --showcpperrors --header --output-dir=$(CLASSINC) $<
    9494#BASE_NOMCOMPILEIH      =       $(IDLCOMP) --showcpperrors --ihfile --output-dir=$(CLASSINC) $<
    95 BASE_NOMCOMPILEC        =       $(IDLCOMP) --showcpperrors --c-template --output-dir=$(CLASSTEMPLATEDIR) $<
     95#BASE_NOMCOMPILEC       =       $(IDLCOMP) --showcpperrors --c-template --output-dir=$(CLASSTEMPLATEDIR) $<
    9696 
    9797BASE_NOMCOMPILEH        =       gcc -E -x c -D__NOM_IDL_COMPILER__ $(NOMIDLINC) $< | $(NOMIDLCOMPILER) --emit-h -d $(CLASSINC) -
    9898BASE_NOMCOMPILEIH       =       gcc -E -x c -D__NOM_IDL_COMPILER__ $(NOMIDLINC) $< | $(NOMIDLCOMPILER) --emit-ih -d $(CLASSINC) -
     99BASE_NOMCOMPILEC        =       gcc -E -x c -D__NOM_IDL_COMPILER__ $(NOMIDLINC) $< | $(NOMIDLCOMPILER) --emit-c -d $(CLASSTEMPLATEDIR) -
    99100
    100101
  • trunk/nom/class_c/nomclassmanager.c

    r255 r294  
    6262   \remark This method isn't implemented yet.
    6363 */
    64 NOM_Scope PNOMObject NOMLINK impl_NOMClassMgr_nomFindClassFromId(NOMClassMgr* nomSelf,
    65                                                                  const CORBA_long classId,
    66                                                                  const CORBA_long ulMajorVersion,
    67                                                                  const CORBA_long ulMinorVersion,
    68                                                                  CORBA_Environment *ev)
     64NOM_Scope NOMClass* NOMLINK impl_NOMClassMgr_nomFindClassFromId(NOMClassMgr* nomSelf,
     65                                                                const CORBA_long classId,
     66                                                                const CORBA_long ulMajorVersion,
     67                                                                const CORBA_long ulMinorVersion,
     68                                                                CORBA_Environment *ev)
    6969{
    7070  /*  NOMClassMgrData *nomThis = NOMClassMgrGetData(nomSelf); */
     
    7979   \brief Function which implements the nomFindClassFromName() method of NOMClassMgr.
    8080 */
    81 NOM_Scope PNOMObject NOMLINK impl_NOMClassMgr_nomFindClassFromName(NOMClassMgr* nomSelf,
    82                                                                    const CORBA_char * className,
    83                                                                    const CORBA_long ulMajorVersion,
    84                                                                    const CORBA_long ulMinorVersion,
    85                                                                    CORBA_Environment *ev)
     81NOM_Scope NOMClass* NOMLINK impl_NOMClassMgr_nomFindClassFromName(NOMClassMgr* nomSelf,
     82                                                                  const CORBA_char * className,
     83                                                                  const CORBA_long ulMajorVersion,
     84                                                                  const CORBA_long ulMinorVersion,
     85                                                                  CORBA_Environment *ev)
    8686{
    8787  CORBA_Object nomRetval=NULLHANDLE;
     
    9595  mtab=g_datalist_get_data(&_gdataClassList, className);
    9696
    97   //nomPrintf("-----> %s %s %x\n", __FUNCTION__, className, mtab);
    98 
    9997  if(mtab){
    10098    NOMClassPriv* ncPriv;
    10199    ncPriv=(NOMClassPriv*)mtab->nomClsInfo;
    102     //if(1==ncPriv->ulIsMetaClass){
    103     //    nomPrintf("%s: found %s\n", __FUNCTION__, mtab->nomClassName);
    104100    nomRetval=(CORBA_Object)ncPriv->sci->nomCds->nomClassObject;
    105     //}
    106 
    107101  }
    108102  return nomRetval;
     
    142136  g_tree_insert(_pClassListTree, mtab, mtab->nomClassName); /* key is the mtab because we want to use
    143137                                                               this tree for fast lookup of mtabs to
    144                                                                check for objects. */
    145 
    146   //  g_datalist_set_data_full(&_gdataClassList, mtab->nomClassName, classMtab, priv_handleClassRemove);
    147   //nomPrintf("%s: registering %lx, %s classList: %lx\n", __FUNCTION__,
    148   //classMtab, mtab->nomClassName, _gdataClassList);
     138                                                               check for valid objects. */
     139
     140  //nomPrintf("%s: registering %lx, %s classList: %lx ID: %ld\n", __FUNCTION__,
     141  //        classMtab, mtab->nomClassName, _gdataClassList, g_quark_try_string(mtab->nomClassName));
     142  mtab->classNomId=g_quark_try_string(mtab->nomClassName);
    149143}
    150144
     
    156150{
    157151  NOMClassMgrData *nomThis = NOMClassMgrGetData(nomSelf);
    158   nomPrintf("    Entering %s  with nomSelf: 0x%x. nomSelf is: %s.\n",
    159             __FUNCTION__, nomSelf, nomSelf->mtab->nomClassName);
    160152
    161153  return _gdataClassList;
     
    212204
    213205  g_datalist_set_data_full(&_gdataMethodList, chrMethodName, classMtab, priv_handleMethodRemoveFromList);
    214   //g_datalist_set_data_full(&_gdataClassList, mtab->nomClassName, classMtab, priv_handleClassRemove);
    215   // nomPrintf("%s: registering %lx, %s methodList: %lx\n", __FUNCTION__, classMtab, chrMethodName, _gdataMethodList);
    216 
    217206}
    218207
     
    240229{
    241230/* NOMClassMgrData* nomThis=NOMClassMgrGetData(nomSelf); */
    242   NOMObject* oClass;
    243   NOMObject* rClass;
    244 
     231  NOMClass* oClass;
     232  NOMClass* rClass;
     233  NOMClassPriv* ncp;
     234
     235  /* This returns a meta class */
    245236  if((oClass=_nomFindClassFromName( nomSelf, oldClass, 0, 0, NULLHANDLE))==NULLHANDLE)
    246237    return FALSE;
     
    250241
    251242  /* Check if the class is a direct child */
     243  ncp=(NOMClassPriv*)_nomGetObjectCreateInfo(rClass, NULLHANDLE);
     244 
     245  if(strcmp(ncp->parentMtabStruct.next->mtab->nomClassName, oldClass))
     246    return FALSE;
    252247
    253248  /* Save old class object pointer. Hmm, maybe not it's still in the old parentMtab */
  • trunk/nom/class_c/nomcls.c

    r255 r294  
    191191{
    192192  NOMClassData* nomThis=NOMClassGetData(nomSelf);
    193 
    194   //nomPrintf("    Entering %s  with nomSelf: 0x%x. nomSelf is: %s.\n",
    195   //          __FUNCTION__,  nomSelf, nomSelf->mtab->nomClassName);
    196193
    197194  _ncpObject=ncpObject;
  • trunk/nom/idl/nomclassmanager.idl

    r281 r294  
    4949   
    5050 */
     51
     52interface NOMClass;
     53
    5154interface NOMClassMgr : NOMObject
    5255{
     
    5760
    5861  /**
    59      Find the class with the given nomId in the internal class list managed by the
     62     Find the class object for the class with the given nomId in the internal class list managed by the
    6063     class manager.
    6164
     
    6972     \param ulMinorVersion This parameter is not used at the moment and should be set to 0.
    7073     \return
    71      The class with the given name or NULL if not found.
    72    */
    73   PNOMObject nomFindClassFromId(in long classId,
     74     The class object for the class with the given name or NULL if not found.
     75   */
     76  NOMClass* nomFindClassFromId(in long classId,
    7477                            in long ulMajorVersion,
    7578                            in long ulMinorVersion);
    7679 
    7780  /**
    78      Find the class with the given name in the internal class list managed by the
     81     Find the class object for the class with the given name in the internal class list managed by the
    7982     class manager.
    8083     
    8184     \remark
    82      This method will return classes and metaclasses.
     85     This method will return the metaclasses for the given class name.
    8386
    8487     \par How to override
    8588     This method is usually not overriden.
    8689     
    87      \param className The name of the class to be found as a C string.
     90     \param className The name of the class as a C string.
    8891     \param ulMajorVersion This parameter is not used at the moment and should be set to 0.
    8992     \param ulMinorVersion This parameter is not used at the moment and should be set to 0.
    9093     \return
    91      The class with the given name or NULL if not found.
    92    */
    93   PNOMObject nomFindClassFromName(in string className,
     94     The class object for the class with the given name or NULL if not found.
     95   */
     96  NOMClass* nomFindClassFromName(in string className,
    9497                              in long ulMajorVersion,
    9598                              in long ulNinorVersion);
  • trunk/nom/idl/nomcls.idl

    r281 r294  
    145145
    146146  /**
     147     Query the structure holding all the info needed for creating new objects.
     148
    147149     \remarks
     150     You should know what you're doing if you want to use the structure returned by this  method...
    148151     The return type may change.
    149152   */
     
    169172     The type of this variable will change!
    170173  */
    171   NOMINSTANCEVAR(string ncpObject);     //NOMClassPriv structure holding info about the object this class can create
     174  NOMINSTANCEVAR(gpointer ncpObject);     //NOMClassPriv structure holding info about the object this class can create
    172175  NOMOVERRIDE(nomInit);
    173176
  • trunk/nom/include/nomapi.h

    r255 r294  
    5353  gulong          ulInstanceSize;     /* Size of an instance of this class         */
    5454  gulong          mtabSize;           /* Size of this mtab (includes method ptrs.) */
     55  nomId           classNomId;         /* The unique ID of this class               */
    5556  nomMethodProc*  entries[1];
    5657} nomMethodTab, *nomMethodTabPtr;
Note: See TracChangeset for help on using the changeset viewer.