00001 /*---------------------------------------------------------------------------*\ 00002 * OpenSG * 00003 * * 00004 * * 00005 * Copyright (C) 2000-2002,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_INL_ 00040 #define _OSGFIELDDESCRIPTIONIMPL_INL_ 00041 00042 #ifdef OSG_DOC_FILES_IN_MODULE 00043 00046 #endif 00047 00048 OSG_BEGIN_NAMESPACE 00049 00050 /*-------------------------------------------------------------------------*/ 00051 /* Get */ 00052 00053 inline 00054 const Char8 *FieldDescription::getCName(void) const 00055 { 00056 return _szName.str(); 00057 } 00058 00059 inline 00060 const IDString &FieldDescription::getName(void) const 00061 { 00062 return _szName; 00063 } 00064 00065 inline 00066 UInt32 FieldDescription::getTypeId(void) const 00067 { 00068 return _fieldType.getId(); 00069 } 00070 00071 inline 00072 BitVector FieldDescription::getFieldMask(void) const 00073 { 00074 return _vFieldMask; 00075 } 00076 00077 inline 00078 void FieldDescription::setFieldMask(BitVector vFieldMask) 00079 { 00080 _vFieldMask = vFieldMask; 00081 } 00082 00083 inline 00084 UInt32 FieldDescription::getFieldId(void) const 00085 { 00086 return _uiFieldId; 00087 } 00088 00089 inline 00090 void FieldDescription::setFieldId(UInt32 uiFieldId) 00091 { 00092 _uiFieldId = uiFieldId; 00093 } 00094 00095 inline 00096 const Char8 *FieldDescription::getDefaultValue(void) const 00097 { 00098 return _defaultValue.str(); 00099 } 00100 00101 inline 00102 const TypeBase &FieldDescription::getFieldType(void) const 00103 { 00104 return _fieldType; 00105 } 00106 00107 /*-------------------------------------------------------------------------*/ 00108 /* Is */ 00109 00110 inline 00111 bool FieldDescription::isInternal(void) const 00112 { 00113 return _bInternal; 00114 } 00115 00116 inline 00117 bool FieldDescription::isValid(void) const 00118 { 00119 return (this != NULL && _szName.getLength()) ? true : false; 00120 } 00121 00122 /*-------------------------------------------------------------------------*/ 00123 /* Set */ 00124 00125 inline 00126 void FieldDescription::setAccessMethod(FieldAccessMethod fAccessMethod) 00127 { 00128 _fAccessMethod = fAccessMethod; 00129 } 00130 00131 inline 00132 void FieldDescription::setIndexAccessMethod( 00133 FieldIndexAccessMethod fIndexedAccessMethod) 00134 { 00135 _fIndexedAccessMethod = fIndexedAccessMethod; 00136 } 00137 00138 /*-------------------------------------------------------------------------*/ 00139 /* Generic Field Access */ 00140 00141 inline 00142 Field * FieldDescription::getField(FieldContainer &dataStore) const 00143 { 00144 Field *pField = NULL; 00145 00146 if(_fAccessMethod != 0) 00147 { 00148 pField = ( (&dataStore)->*_fAccessMethod) (); 00149 } 00150 else if(_fIndexedAccessMethod != 0) 00151 { 00152 pField = ( (&dataStore)->*_fIndexedAccessMethod)(_uiFieldId); 00153 } 00154 else 00155 { 00156 SWARNING << "No accessMethod for " << _szName.str() << std::endl; 00157 } 00158 00159 return pField; 00160 } 00161 00162 00163 inline 00164 bool FieldDescriptionPLT::operator()(const FieldDescription *pElemDesc1, 00165 const FieldDescription *pElemDesc2) const 00166 { 00167 return (pElemDesc1->getFieldId() < pElemDesc2->getFieldId()); 00168 } 00169 00170 00171 OSG_END_NAMESPACE 00172 00173 #define OSGFIELDDESCRIPTION_INLINE_CVSID "@(#)$Id: $" 00174 00175 #endif /* _OSGFIELDDESCRIPTIONIMPL_INL_ */
1.4.3