Ignore:
Timestamp:
Mar 11, 2007, 2:22:39 PM (18 years ago)
Author:
cinc
Message:

Implemented some methods. Bug fixes and documentation.

File:
1 edited

Legend:

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

    r222 r251  
    1616* The Initial Developer of the Original Code is
    1717* netlabs.org: Chris Wohlgemuth <cinc-ml@netlabs.org>.
    18 * Portions created by the Initial Developer are Copyright (C) 2005-2006
     18* Portions created by the Initial Developer are Copyright (C) 2005-2007
    1919* the Initial Developer. All Rights Reserved.
    2020*
     
    3232*
    3333* ***** END LICENSE BLOCK ***** */
     34/** \file nomobj.idl
     35   
     36    Implementation file for the NOM class NOMObject.
     37*/
     38
    3439#ifndef NOM_NOMObject_IMPLEMENTATION_FILE
    3540#define NOM_NOMObject_IMPLEMENTATION_FILE
     
    4954
    5055/**
    51 
    5256    \brief This function implements the method nomInit() of class NOMObject.
    5357 */
    5458NOM_Scope void  NOMLINK impl_NOMObject_nomInit(NOMObject *nomSelf, CORBA_Environment *ev)
    5559
    56   //nomPrintf("    Entering %s (%x) with nomSelf: 0x%x. nomSelf is: %s.\n",
    57   //        __FUNCTION__, impl_NOMObject_nomInit, nomSelf , nomSelf->mtab->nomClassName);
    58 }
    59 
    60 /**
    61 
     60
     61}
     62
     63/**
    6264    \brief This function implements the method nomUnInit() of class NOMObject.
    6365 */
     
    7173
    7274/**
    73 
    7475    \brief This function implements the method nomGetSize() of class NOMObject.
    7576 */
     
    8788
    8889/**
    89 
    9090    \brief This function implements the method delete() of class NOMObject.
    9191
     
    121121
    122122/**
    123 
    124123    \brief This function implements the method nomGetClass() of class NOMObject.
    125124    It returns a pointer to the class object of this object.
     
    162161
    163162
     163NOM_Scope CORBA_boolean NOMLINK impl_NOMObject_nomIsA(NOMObject* nomSelf, const PNOMClass nomClass, CORBA_Environment *ev)
     164{
     165  /* NOMObjectData* nomThis=NOMObjectGetData(nomSelf); */
     166  NOMClassPriv* ncp;
     167  nomMethodTabs mtabs; /* List of mtabs */
     168
     169  if(!nomIsObj(nomClass)){
     170    g_warning("%s: class object pointer nomClass does not point to an object.", __FUNCTION__);
     171    return FALSE;
     172  }
     173
     174  /* Check if we have the class in our list of classes */
     175  ncp=(NOMClassPriv*)nomSelf->mtab->nomClsInfo;
     176  mtabs=&ncp->mtabList;
     177  while(mtabs)
     178    {
     179      if(nomClass==mtabs->mtab->nomClassObject)
     180          return TRUE;
     181
     182      mtabs=mtabs->next;
     183    }
     184  return FALSE;
     185}
     186
     187
     188NOM_Scope CORBA_boolean NOMLINK impl_NOMObject_nomIsInstanceOf(NOMObject* nomSelf, const PNOMClass nomClass, CORBA_Environment *ev)
     189{
     190  /* NOMObjectData* nomThis=NOMObjectGetData(nomSelf); */
     191 
     192  if(!nomIsObj(nomClass)){
     193    g_warning("%s: class object pointer nomClass does not point to an object.", __FUNCTION__);
     194    return FALSE;
     195  }
     196 
     197  if(nomClass==_nomGetClass(nomSelf, NULLHANDLE))
     198    return TRUE;
     199 
     200  return FALSE;
     201}
     202
     203/**
     204   Function which implements the nomGetClassName() method of NOMObject.
     205*/
     206NOM_Scope CORBA_string NOMLINK impl_NOMObject_nomGetClassName(NOMObject* nomSelf, CORBA_Environment *ev)
     207{
     208  /* NOMObjectData* nomThis=NOMObjectGetData(nomSelf); */
     209  return nomSelf->mtab->nomClassName;
     210}
Note: See TracChangeset for help on using the changeset viewer.