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

OSGFieldDescriptionImpl.h

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 #ifndef _OSGFIELDDESCRIPTIONIMPL_H_
00040 #define _OSGFIELDDESCRIPTIONIMPL_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #ifdef OSG_DOC_FILES_IN_MODULE
00046 
00049 #endif
00050 
00051 #include <OSGSystemDef.h>
00052 #include <OSGBaseTypes.h>
00053 #include <OSGIDString.h>
00054 #include <OSGTypeBase.h>
00055 #include <OSGLog.h>
00056 
00057 OSG_BEGIN_NAMESPACE
00058 
00059 class Field;
00060 
00064 typedef Field * (FieldContainer::*FieldAccessMethod     )(void  ); 
00065 
00069 typedef Field * (FieldContainer::*FieldIndexAccessMethod)(UInt32);
00070 
00071 //---------------------------------------------------------------------------
00072 //   Class         
00073 //---------------------------------------------------------------------------
00074 
00078 class OSG_SYSTEMLIB_DLLMAPPING FieldDescription
00079 {
00080     /*==========================  PUBLIC  =================================*/
00081 
00082   public :
00083 
00084     /*---------------------------------------------------------------------*/
00088      FieldDescription(const TypeBase               &elementType,
00089                       const Char8                  *szName,
00090                       const UInt32                  uiFieldId,
00091                       const BitVector               vFieldMask,
00092                       const bool                    bInternal,
00093                             FieldAccessMethod       fAccessMethod,
00094                       const Char8                  *defaultValue = NULL );
00095 
00096      FieldDescription(const TypeBase               &elementType,
00097                       const Char8                  *szName,
00098                       const UInt32                  uiFieldId,
00099                       const BitVector               vFieldMask,
00100                       const bool                    bInternal,
00101                             FieldIndexAccessMethod  fIndexedAccessMethod,
00102                       const Char8                  *defaultValue = NULL );
00103 
00104     FieldDescription(const FieldDescription &source                     );
00105 
00107     /*---------------------------------------------------------------------*/
00111     virtual ~FieldDescription(void); 
00112 
00114     /*---------------------------------------------------------------------*/
00118     const Char8     *getCName       (void                ) const;
00119     const IDString  &getName        (void                ) const;
00120 
00121           UInt32     getTypeId      (void                ) const;  
00122 
00123           BitVector  getFieldMask   (void                ) const;
00124           void       setFieldMask   (BitVector vFieldMask);
00125 
00126           UInt32     getFieldId     (void                ) const;
00127           void       setFieldId     (UInt32 uiFieldId    );
00128 
00129     const Char8     *getDefaultValue(void                ) const;
00130 
00131     const TypeBase  &getFieldType   (void                ) const;
00132 
00133           bool       isInternal     (void                ) const;
00134 
00135           bool       isValid        (void                ) const;
00136 
00138     /*---------------------------------------------------------------------*/
00142     void setAccessMethod     (FieldAccessMethod       fAccessMethod       );
00143     void setIndexAccessMethod(FieldIndexAccessMethod  fIndexedAccessMethod);
00144 
00146     /*=========================  PROTECTED  ===============================*/
00147   protected:
00148 
00149     /*---------------------------------------------------------------------*/
00153     IDString                 _szName;
00154 
00155     const TypeBase          &_fieldType;
00156 
00157     UInt32                   _uiFieldId;
00158     BitVector                _vFieldMask;
00159 
00160     bool                     _bInternal;
00161 
00162     FieldAccessMethod        _fAccessMethod;
00163     FieldIndexAccessMethod   _fIndexedAccessMethod;
00164 
00165     IDString                 _defaultValue;
00166 
00168     /*---------------------------------------------------------------------*/
00172     Field *getField(FieldContainer &dataStore) const;
00173 
00175     /*==========================  PRIVATE  ================================*/
00176   private:
00177 
00178     friend class FieldContainer;
00179     friend class FieldContainerPtr;
00180 
00182     void operator =(const FieldDescription &source);
00183 };
00184 
00185 //---------------------------------------------------------------------------
00186 //   Class         
00187 //---------------------------------------------------------------------------
00188 
00194 struct FieldDescriptionPLT
00195 {
00196     bool operator()(const FieldDescription *pElemDesc1, 
00197                     const FieldDescription *pElemDesc2) const;
00198 };
00199 
00200 OSG_END_NAMESPACE
00201 
00202 #define OSGFIELDDESCRIPTION_HEADER_CVSID "@(#)$Id: $"
00203 
00204 #endif /* _OSGFIELDDESCRIPTIONIMPL_H_ */

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