Changeset 353


Ignore:
Timestamp:
Jun 7, 2008, 10:41:05 AM (17 years ago)
Author:
cinc
Message:

Started implementing method query methods. Renamed nomGetClass() to nomQueryClass().

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/nom/Makefile.kmk

    r347 r353  
    3030        idl/nomtestcase.idl \
    3131        idl/nomtestresult.idl \
     32        idl/nommethod.idl \
    3233        \
    3334        src/nomtkinit.c \
     
    4647        class_c/nomarray.c \
    4748        class_c/nomtestcase.c \
    48         class_c/nomtestresult.c
     49        class_c/nomtestresult.c \
     50        class_c/nommethod.c
    4951libnomobjtk_SOURCES.os2 = \
    5052        $(PATH_TARGET)/nobjtk-os2.def
  • trunk/nom/class_c/nomobj.c

    r326 r353  
    5454#include "nomobj.ih"
    5555
     56#include "nomstring.h"
     57#include "nommethod.h"
    5658#include "gc.h"
    5759
     
    124126
    125127/**
    126     \brief This function implements the method nomGetClass() of class NOMObject.
     128    \brief This function implements the method nomQueryClass() of class NOMObject.
    127129    It returns a pointer to the class object of this object.
    128130
     
    131133    \retval PNOMClass A pointer to the class object for this object. This can never be NULL.
    132134 */
    133 NOM_Scope PNOMClass NOMLINK impl_NOMObject_nomGetClass(NOMObject* nomSelf, CORBA_Environment *ev)
     135NOM_Scope PNOMClass NOMLINK impl_NOMObject_nomQueryClass(NOMObject* nomSelf, CORBA_Environment *ev)
    134136{
    135137/* NOMObjectData* nomThis=NOMObjectGetData(nomSelf); */
     
    158160     It is possible that we are called by a subclass. So get the class object and let the
    159161     class object create the correct class. */
    160   nomCls=NOMObject_nomGetClass(nomSelf, NULL);
     162  nomCls=NOMObject_nomQueryClass(nomSelf, NULL);
    161163  return NOMClass_nomNew(nomCls, NULL);
    162164}
     
    206208  }
    207209 
    208   if(nomClass==_nomGetClass(nomSelf, NULL))
     210  if(nomClass==_nomQueryClass(nomSelf, NULL))
    209211    return TRUE;
    210212 
     
    220222  return nomSelf->mtab->nomClassName;
    221223}
     224
     225
     226NOMDLLEXPORT NOM_Scope void NOMLINK impl_NOMObject_nomGetMethodList(NOMObject* nomSelf,
     227                                                                    const CORBA_boolean bIncludingParents,
     228                                                                    CORBA_Environment *ev)
     229{
     230  NOMClassPriv* ncPriv;
     231 
     232  /* NOMObjectData* nomThis = NOMObjectGetData(nomSelf); */
     233
     234  g_message("In %s (%d): %s", __FUNCTION__, __LINE__, _nomGetClassName(_nomQueryClass(nomSelf, NULL), NULL));
     235 
     236  ncPriv=(NOMClassPriv*)_nomGetObjectCreateInfo(_nomQueryClass(nomSelf, NULL), NULL);
     237 
     238  if(ncPriv){
     239    gulong a, ulNumIntroducedMethods;
     240
     241    ulNumIntroducedMethods=ncPriv->sci->ulNumStaticMethods;
     242    for(a=0;a< ulNumIntroducedMethods;a++)
     243    {
     244      NOMMethod* nMethod=NOMMethodNew();
     245      NOMString* ns;
     246     
     247      _initData(nMethod, (gpointer) &ncPriv->sci->nomSMethods[a], NULL);
     248      g_message("In %s (%d): %s %X", __FUNCTION__, __LINE__, *ncPriv->sci->nomSMethods[a].nomMethodId, nMethod /*chrMethodDescriptor*/);
     249
     250      g_message("  In %s (%d): %s\n", __FUNCTION__, __LINE__, _nomGetClassName(_getName(nMethod, NULL), NULL));
     251     
     252     
     253      //g_message("    In %s (%d): %X NOMString: %x", __FUNCTION__, __LINE__, nMethod, _getName(nMethod, NULL));
     254     
     255      g_message("    In %s (%d): NOMMethod: %x %s 3\n", __FUNCTION__, __LINE__, nMethod, _queryString(_getName(nMethod, NULL), NULL));
     256     
     257    }
     258    //nomPrintf("     %s %s \n", nomSelf->mtab->nomClassName, ncPriv->mtab->nomClassName);
     259  }
     260 
     261  //nomPrintf("In %s: metaclass: %s, class: %s\n", __FUNCTION__, _nomGetClassName(_nomQueryClass(nomSelf, NULL), NULL),
     262    //        _nomGetClassName(nomSelf, NULL));
     263
     264}
     265
  • trunk/nom/class_c/nomstring.c

    r346 r353  
    6767{
    6868  NOMStringData* nomThis = NOMStringGetData(nomSelf);
    69  
     69
    7070  g_string_assign(_gString, chrString); /* This copies the input string */
    7171  return nomSelf;
  • trunk/nom/exports.def

    r348 r353  
    5353        _NOMArrayClassData   
    5454        _NOMArrayCClassData 
    55         NOMArray             NewClass
     55        NOMArrayNewClass
    5656
    5757        _NOMStringClassData   
    5858        _NOMStringCClassData 
    59         NOMString            NewClass
     59        NOMStringNewClass
    6060
    6161        _NOMTestCaseClassData     
     
    6666        _NOMTestResultCClassData     
    6767        NOMTestResultNewClass       
     68
     69        _NOMMethodClassData   
     70        _NOMMethodCClassData 
     71        NOMMethodNewClass
    6872
    6973;       _NOMTest2ClassData     
  • trunk/nom/idl/nomobj.idl

    r281 r353  
    125125     \return Pointer to the class object
    126126
    127      \sa impl_NOMObject_nomGetClass()
    128    */
    129   PNOMClass nomGetClass();
     127     \sa impl_NOMObject_nomQueryClass()
     128   */
     129  PNOMClass nomQueryClass();
    130130
    131131  /**
     
    226226  boolean nomIsANoClsCheck(in PNOMClass nomClass);
    227227
     228  void nomGetMethodList(in boolean bIncludingParents);
    228229};
    229230
  • trunk/nom/idl/nomtestresult.idl

    r347 r353  
    3333* ***** END LICENSE BLOCK ***** */
    3434
    35 #ifndef NOMTESTCASE_IDL_INCLUDED
    36 #define NOMTESTCASE_IDL_INCLUDED
     35#ifndef NOMTESTRESULT_IDL_INCLUDED
     36#define NOMTESTRESULT_IDL_INCLUDED
    3737
    3838#include "nomobj.idl"
     
    6565};
    6666
    67 #endif  /* NOMTESTCASE_IDL_INCLUDED */
     67#endif  /* NOMTESTRESULT_IDL_INCLUDED */
    6868
    6969
  • trunk/tests/Makefile.kmk

    r341 r353  
    123123
    124124
     125#
     126# Program for playing around.
     127#
     128PROGRAMS += nom-play
     129nom-play_TEMPLATE = nombin
     130nom-play_SOURCES = \
     131        c/nom-play.c
     132ifeq ($(BUILD_TARGET),win)
     133 nom-play_LIBS = \
     134        $(TARGET_libnomtest:.dll=.lib)
     135else
     136        nom-play_LIBS = \
     137        $(TARGET_libnomtest)
     138endif
     139
    125140endif # NOM_WITH_TESTCASES
    126141
Note: See TracChangeset for help on using the changeset viewer.