00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
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
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
00144
00145 protected:
00146
00147
00151 Field(void);
00152 Field(const Field &source);
00153
00155
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
00168
00169