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

osg::TypeTraits< UInt8 > Struct Template Reference
[BaseTypesTraits]

#include <OSGBaseTypeTraits.h>

Inheritance diagram for osg::TypeTraits< UInt8 >:

osg::TypeTraitsBase List of all members.

Public Types

typedef Real32 RealReturnType

Static Public Member Functions

static UInt8 getZeroElement (void)
static UInt8 getOneElement (void)
static UInt8 getMax (void)
static UInt8 getMin (void)
static Real32 getFraction (UInt8 val)
static UInt8 getPortion (Real32 val)
static UInt8 getFromString (const Char8 *szString)
static std::string putToString (const UInt8 val)

Static Public Attributes

static const bool IsPOD = true
static const MathTypeProperties MathProp = IntValue
static const UInt8 BitsSet = 0xFF
static const UInt8 BitsClear = 0x00

Detailed Description

template<>
struct osg::TypeTraits< UInt8 >

Definition at line 156 of file OSGBaseTypeTraits.h.


Member Typedef Documentation

typedef Real32 osg::TypeTraits< UInt8 >::RealReturnType
 

Definition at line 158 of file OSGBaseTypeTraits.h.


Member Function Documentation

static UInt8 osg::TypeTraits< UInt8 >::getZeroElement void   )  [inline, static]
 

Definition at line 168 of file OSGBaseTypeTraits.h.

00169     {
00170         return 0;
00171     }

static UInt8 osg::TypeTraits< UInt8 >::getOneElement void   )  [inline, static]
 

Definition at line 173 of file OSGBaseTypeTraits.h.

00174     {
00175         return 1;
00176     }

static UInt8 osg::TypeTraits< UInt8 >::getMax void   )  [inline, static]
 

Definition at line 178 of file OSGBaseTypeTraits.h.

00179     {
00180         return std::numeric_limits<UInt8>::max();
00181     }

static UInt8 osg::TypeTraits< UInt8 >::getMin void   )  [inline, static]
 

Definition at line 183 of file OSGBaseTypeTraits.h.

00184     {
00185         return std::numeric_limits<UInt8>::min();
00186     }

static Real32 osg::TypeTraits< UInt8 >::getFraction UInt8  val  )  [inline, static]
 

Definition at line 189 of file OSGBaseTypeTraits.h.

00190     {
00191         return (Real32(val) / Real32(getMax()));
00192     };

static UInt8 osg::TypeTraits< UInt8 >::getPortion Real32  val  )  [inline, static]
 

Definition at line 194 of file OSGBaseTypeTraits.h.

00195     {
00196 #ifdef OSG_WIN32_ICL
00197 #pragma warning (disable : 810)
00198 #endif
00199         return UInt8((val * Real32(getMax())));
00200 #ifdef OSG_WIN32_ICL
00201 #pragma warning (default : 810)
00202 #endif
00203     };

static UInt8 osg::TypeTraits< UInt8 >::getFromString const Char8 szString  )  [inline, static]
 

Definition at line 206 of file OSGBaseTypeTraits.h.

00207     {
00208         if(szString != NULL)
00209         {
00210             return UInt8(strtoul(szString, NULL, 0));
00211         }
00212         else
00213         {
00214             return getZeroElement();
00215         }
00216     }

static std::string osg::TypeTraits< UInt8 >::putToString const UInt8  val  )  [inline, static]
 

Definition at line 218 of file OSGBaseTypeTraits.h.

00219     {
00220         Char8 buffer[10];
00221 
00222         sprintf(buffer, "%u", val);
00223 
00224         return std::string(buffer);
00225     }


Member Data Documentation

const bool osg::TypeTraits< UInt8 >::IsPOD = true [static]
 

Definition at line 161 of file OSGBaseTypeTraits.h.

const MathTypeProperties osg::TypeTraits< UInt8 >::MathProp = IntValue [static]
 

Definition at line 162 of file OSGBaseTypeTraits.h.

const UInt8 osg::TypeTraits< UInt8 >::BitsSet = 0xFF [static]
 

Definition at line 164 of file OSGBaseTypeTraits.h.

const UInt8 osg::TypeTraits< UInt8 >::BitsClear = 0x00 [static]
 

Definition at line 165 of file OSGBaseTypeTraits.h.


The documentation for this struct was generated from the following file:
Generated on Thu Aug 25 04:12:32 2005 for OpenSG by  doxygen 1.4.3