Ignore:
Timestamp:
Jan 7, 2007, 5:25:48 PM (19 years ago)
Author:
cinc
Message:

Added nomGetClass()/new() methods to NOMObject. Header file fixes to resolve build issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/nom/class_c/nomobj.c

    r177 r179  
    3838#include <gtk/gtk.h>
    3939
    40 
    4140#include "nom.h"
    4241#include "nomtk.h"
    4342
    4443#include "nomobj.ih"
    45 
    4644
    4745
     
    8785}
    8886
     87NOM_Scope PNOMClass NOMLINK impl_NOMObject_nomGetClass(NOMObject* nomSelf, CORBA_Environment *ev)
     88{
     89/* NOMObjectData* nomThis=NOMObjectGetData(nomSelf); */
    8990
     91  return nomSelf->mtab->nomClassObject;
     92}
     93
     94/*
     95  Create a new class of the kind the caller is. This method ensures that subclasses
     96  are properly handled without the need to override this class in every subclass.
     97 */
     98NOM_Scope PNOMObject NOMLINK impl_NOMObject_new(NOMObject* nomSelf, CORBA_Environment *ev)
     99{
     100/* NOMObjectData* nomThis=NOMObjectGetData(nomSelf); */
     101  PNOMObject nomRetval;
     102  NOMClass* nomCls;
     103
     104  /* We don't know which class we're actually. So we can't just create a new object using
     105     <CkassName>New() here.
     106     It is possible that we are called by a subclass. So get the class object and let the
     107     class object create the correct class. */
     108  nomCls=NOMObject_nomGetClass(nomSelf, NULLHANDLE);
     109  return NOMClass_nomNew(nomCls, NULLHANDLE);
     110}
     111
     112
     113
Note: See TracChangeset for help on using the changeset viewer.