Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGTypeBase.cpp

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *             Copyright (C) 2000-2002 by the OpenSG Forum                   *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #include <stdlib.h>
00040 #include <stdio.h>
00041 
00042 #include "OSGConfig.h"
00043 
00044 #include <iostream>
00045 
00046 #include "OSGTypeBase.h"
00047 #include <OSGTypeFactory.h>
00048 
00049 OSG_USING_NAMESPACE
00050 
00054 /*-------------------------------------------------------------------------*/
00055 /*                            Constructors                                 */
00056 
00057 TypeBase::TypeBase(const Char8 *szName,
00058                    const Char8 *szParentName,
00059                    const UInt32             ) :
00060 
00061     _uiTypeId    (0           ),
00062     _uiTypeRootId(0           ),
00063     _pParent     (NULL        ),
00064     _szName      (szName      ),
00065     _szParentName(szParentName)
00066 {
00067     _uiTypeId = TypeFactory::the()->registerType(this);
00068 }
00069 
00070 /*-------------------------------------------------------------------------*/
00071 /*                             Destructor                                  */
00072 
00073 TypeBase::~TypeBase(void)
00074 {
00075 }
00076 
00077 /*-------------------------------------------------------------------------*/
00078 /*                                Get                                      */
00079 
00080 UInt32 TypeBase::getId(void) const 
00081 {
00082     return _uiTypeId; 
00083 }
00084 
00085 
00086 const IDString &TypeBase::getName(void) const
00087 {
00088     return _szName;
00089 }
00090 
00091 
00092 const Char8 *TypeBase::getCName(void) const 
00093 {
00094     return _szName.str(); 
00095 }
00096 
00097 
00098 const IDString &TypeBase::getParentName(void) const
00099 {
00100     return _szParentName;
00101 }
00102 
00103 
00104 const Char8  *TypeBase::getCParentName(void) const
00105 {
00106     return _szParentName.str();
00107 }
00108 
00109 
00110 UInt32 TypeBase::getNameSpace(void) const
00111 {
00112     return 0;
00113 }
00114 
00115 
00116 /*-------------------------------------------------------------------------*/
00117 /*                                Is                                       */
00118 
00119 bool TypeBase::isDerivedFrom(const TypeBase &OSG_CHECK_ARG(other)) const
00120 {
00121     return false;
00122 }
00123 
00124 /*-------------------------------------------------------------------------*/
00125 /*                             Comparison                                  */
00126 
00127 bool TypeBase::operator ==(const TypeBase &other) const
00128 {
00129     return _uiTypeId == other._uiTypeId;
00130 }
00131 
00132 
00133 bool TypeBase::operator !=(const TypeBase &other) const
00134 {
00135     return ! (*this == other);
00136 }
00137 
00138 
00139 /*-------------------------------------------------------------------------*/
00140 /*                            Constructors                                 */
00141 
00142 TypeBase::TypeBase(const TypeBase &source) :
00143     _uiTypeId    (source._uiTypeId),
00144     _uiTypeRootId(source._uiTypeRootId),
00145     _pParent     (source._pParent),
00146     _szName      (source._szName),
00147     _szParentName(source._szParentName)
00148 {
00149 }
00150 
00151 
00152 /*-------------------------------------------------------------------------*/
00153 /*                              cvs id's                                   */
00154 
00155 #ifdef __sgi
00156 #pragma set woff 1174
00157 #endif
00158 
00159 #ifdef OSG_LINUX_ICC
00160 #pragma warning( disable : 177 )
00161 #endif
00162 
00163 namespace 
00164 {
00165     static Char8 cvsid_cpp[] = "@(#)$Id: $";
00166     static Char8 cvsid_hpp[] = OSGTYPEBASE_HEADER_CVSID;
00167 }

Generated on Thu Aug 25 04:11:55 2005 for OpenSG by  doxygen 1.4.3