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

OSGFieldType.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 #include "OSGFieldType.h"
00044 #include "OSGBaseFunctions.h"
00045 #include "OSGFieldFactory.h"
00046 #include "OSGThreadManager.h"
00047 #include "OSGLog.h"
00048 
00049 OSG_USING_NAMESPACE
00050 
00055 /*-------------------------------------------------------------------------*/
00056 /*                            Constructors                                 */
00057 
00058 FieldType::FieldType(const Char8             *szName,
00059                      const Char8             *szParentName,
00060                      const DataType          &contentType,
00061                            CreateFieldMethod  createMethod,
00062                            Cardinality        cardinality) :
00063      Inherited   (szName, szParentName),
00064     _cardinality (cardinality         ),
00065     _contentType (contentType         ),
00066     _pScanAsType (NULL                ),
00067     _createMethod(createMethod        )
00068 {
00069     FieldFactory::addType(this);
00070     FDEBUG (("Initialized FieldType : %s %p\n", getCName(), this));
00071 }
00072 
00073 FieldType::FieldType(const Char8              *szName,
00074                      const Char8              *szParentName,
00075                      const DataType           &contentType,
00076                            CreateFieldMethod   createMethod,
00077                            Cardinality         cardinality,
00078                      const FieldType          &pScanAsType ) :
00079      Inherited   ( szName, szParentName),
00080     _cardinality ( cardinality         ),
00081     _contentType ( contentType         ),
00082     _pScanAsType (&pScanAsType         ),
00083     _createMethod( createMethod        )
00084 {
00085     FieldFactory::addType(this);
00086     FDEBUG (("Initialized FieldType : %s %p\n", getCName(), this));
00087 }
00088 
00089 
00090 /*-------------------------------------------------------------------------*/
00091 /*                             Destructor                                  */
00092 
00093 FieldType::~FieldType(void)
00094 {
00095 }
00096 
00097 /*-------------------------------------------------------------------------*/
00098 /*                                Get                                      */
00099 
00100 const DataType &FieldType::getContentType(void) const
00101 {
00102     return _contentType;
00103 }
00104 
00105 FieldType::Cardinality FieldType::getCardinality(void) const
00106 {
00107     return _cardinality;
00108 }
00109 
00110 UInt32 FieldType::getScanTypeId(void) const
00111 {
00112     if(_pScanAsType == NULL)
00113     {
00114         return getId();
00115     }
00116     else
00117     {
00118         return _pScanAsType->getId();
00119     }
00120 }
00121 
00122 /*-------------------------------------------------------------------------*/
00123 /*                              cvs id's                                   */
00124 
00125 #ifdef __sgi
00126 #pragma set woff 1174
00127 #endif
00128 
00129 #ifdef OSG_LINUX_ICC
00130 #pragma warning( disable : 177 )
00131 #endif
00132 
00133 
00134 namespace 
00135 {
00136     static Char8 cvsid_cpp[] = "@(#)$Id: $";
00137     static Char8 cvsid_hpp[] = OSGFIELDTYPE_HEADER_CVSID;
00138 }

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