00001 /*---------------------------------------------------------------------------*\ 00002 * OpenSG * 00003 * * 00004 * * 00005 * Copyright (C) 2000-2002 by the OpenSG Forum * 00006 * * 00007 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * 00008 * * 00009 \*---------------------------------------------------------------------------*/ 00010 /*---------------------------------------------------------------------------*\ 00011 * License * 00012 * * 00013 * This library is free software; you can redistribute it and/or modify it * 00014 * under the terms of the GNU Library General Public License as published * 00015 * by the Free Software Foundation, version 2. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, but * 00018 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00020 * Library General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Library General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00025 * * 00026 \*---------------------------------------------------------------------------*/ 00027 /*---------------------------------------------------------------------------*\ 00028 * Changes * 00029 * * 00030 * * 00031 * * 00032 * * 00033 * * 00034 * * 00035 \*---------------------------------------------------------------------------*/ 00036 00037 //--------------------------------------------------------------------------- 00038 // Includes 00039 //--------------------------------------------------------------------------- 00040 00041 #include <OSGConfig.h> 00042 00043 OSG_BEGIN_NAMESPACE 00044 00050 inline const MFString& FCPtrAttributeMap::getKeys() const 00051 { 00052 return FCPtrAttributeMapBase::getKeys(); 00053 } 00054 00060 inline bool FCPtrAttributeMap::hasAttribute(const std::string& key) const 00061 { 00062 return getKeys().find(key) != getKeys().end(); 00063 } 00064 00071 inline FieldContainerPtr FCPtrAttributeMap::getAttribute(const std::string& key) 00072 const 00073 { 00074 FieldContainerPtr value; 00075 getAttribute(key, value); 00076 return value; 00077 } 00078 00100 inline FieldContainerPtr& FCPtrAttributeMap::operator[](const std::string& key) 00101 { 00102 MFString& keys = this->FCPtrAttributeMapBase::getKeys(); 00103 MFFieldContainerPtr& values = this->FCPtrAttributeMapBase::getValues(); 00104 00105 unsigned int index(0); 00106 MFString::iterator i; 00107 for ( i = keys.begin(); i != keys.end(); ++i, ++index ) 00108 { 00109 if ( *i == key ) 00110 { 00111 return values[index]; 00112 } 00113 } 00114 00115 keys.push_back(key); 00116 values.push_back(NullFC); 00117 00118 // The value we want to return is at the end of _mfValues. 00119 return values[values.size() - 1]; 00120 } 00121 00122 OSG_END_NAMESPACE 00123 00124 #define OSGFCPTRATTRIBUTEMAP_INLINE_CVSID "@(#)$Id: OSGFCPtrAttributeMap.inl,v 1.2 2005/09/28 03:01:44 vossg Exp $" 00125
1.5.5