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

OSGField.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 _OSGFIELD_H_
00040 #define _OSGFIELD_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #include <OSGBase.h>
00046 #include <OSGBaseTypes.h>
00047 
00048 #include <OSGFieldType.h>
00049 #include <OSGIDString.h>
00050 #include <OSGLog.h>
00051 #include <string>
00052 
00053 OSG_BEGIN_NAMESPACE
00054 
00055 #ifdef OSG_DOC_FILES_IN_MODULE
00056 
00059 #endif
00060 
00061 class StringConversionStateBase;
00062 
00067 template <class T>
00068 struct ErrorFromToString
00069 {
00070     static bool              getFromString(      T      &,
00071                                            const Char8 *&)
00072     {
00073         SLOG << "Error From String Conversion not available for " << std::endl;
00074 
00075         return false;
00076     }
00077 
00078     static void             putToString(const T           &,
00079                                               std::string &)
00080     {
00081         SLOG << "Error To String Conversion not available for " << std::endl;
00082     }
00083 };
00084 
00089 class OSG_BASE_DLLMAPPING Field
00090 {
00091     /*==========================  PUBLIC  =================================*/
00092 
00093   public:
00094 
00095     /*---------------------------------------------------------------------*/
00099     virtual ~Field(void); 
00100 
00102     /*---------------------------------------------------------------------*/
00106     virtual const FieldType              &getType       (void) const = 0;
00107             const DataType               &getContentType(void) const;
00108 
00109                   FieldType::Cardinality  getCardinality(void) const;
00110 
00111     virtual       bool                    isEmpty       (void) const = 0;
00112 
00113     virtual       UInt32                  getSize       (void) const = 0;
00114 
00116     /*---------------------------------------------------------------------*/
00120     virtual void          pushValueByStr(const Char8       *str  )       = 0;
00121     virtual std::string  &getValueByStr (      std::string &str  ) const = 0;
00122     virtual std::string  &getValueByStr (      std::string &str,
00123                                  StringConversionStateBase &state) const = 0;
00124 
00125     virtual std::string  &getValueByStr (      std::string &str,
00126                                                UInt32       index) const = 0;
00127 
00129     /*---------------------------------------------------------------------*/
00133     virtual void setAbstrValue(const Field &obj) = 0;
00134 
00136     /*---------------------------------------------------------------------*/
00140     virtual void dump(void) const = 0;
00141 
00143     /*=========================  PROTECTED  ===============================*/
00144 
00145   protected:
00146 
00147     /*---------------------------------------------------------------------*/
00151     Field(void);
00152     Field(const Field &source);
00153 
00155     /*==========================  PRIVATE  ================================*/
00156 
00157   private:
00158 
00160     void operator =(const Field &source);
00161 };
00162 
00163 OSG_END_NAMESPACE
00164 
00165 #define OSGFIELD_HEADER_CVSID "@(#)$Id: $"
00166 
00167 #endif /* _OSGFIELD_HPP_ */
00168 
00169 

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