osg::TypeTraits< UInt8 > Struct Template Reference

#include <OSGBaseTypeTraits.h>

Inheritance diagram for osg::TypeTraits< UInt8 >:

osg::TypeTraitsTemplateBase< 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 getFromCString (const Char8 *pData, Char8 *&pDataEnd)
static UInt8 getFromCString (const Char8 *pData)
static void putToString (const UInt8 val, std::string &out)
static void putToStream (const UInt8 &val, OutStream &str)

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 227 of file OSGBaseTypeTraits.h.


Member Typedef Documentation

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

Definition at line 229 of file OSGBaseTypeTraits.h.


Member Function Documentation

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

Definition at line 260 of file OSGBaseTypeTraits.h.

00261     {
00262         return (Real32(val) / Real32(getMax()));
00263     };

static UInt8 osg::TypeTraits< UInt8 >::getFromCString const Char8 *  pData  )  [inline, static]
 

Definition at line 290 of file OSGBaseTypeTraits.h.

00291     {
00292         Char8 *pDataEnd;
00293 
00294         return getFromCString(pData, pDataEnd);
00295     }

static UInt8 osg::TypeTraits< UInt8 >::getFromCString const Char8 *  pData,
Char8 *&  pDataEnd
[inline, static]
 

Definition at line 277 of file OSGBaseTypeTraits.h.

00279     {
00280         if(pData != NULL)
00281         {
00282             return UInt8(strtoul(pData, &pDataEnd, 0));
00283         }
00284         else
00285         {
00286             return getZeroElement();
00287         }
00288     }

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

Definition at line 249 of file OSGBaseTypeTraits.h.

00250     {
00251         return std::numeric_limits<UInt8>::max();
00252     }

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

Definition at line 254 of file OSGBaseTypeTraits.h.

00255     {
00256         return std::numeric_limits<UInt8>::min();
00257     }

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

Definition at line 244 of file OSGBaseTypeTraits.h.

00245     {
00246         return 1;
00247     }

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

Definition at line 265 of file OSGBaseTypeTraits.h.

00266     {
00267 #ifdef OSG_WIN32_ICL
00268 #pragma warning (disable : 810)
00269 #endif
00270         return UInt8((val * Real32(getMax())));
00271 #ifdef OSG_WIN32_ICL
00272 #pragma warning (default : 810)
00273 #endif
00274     };

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

Definition at line 239 of file OSGBaseTypeTraits.h.

00240     {
00241         return 0;
00242     }

static void osg::TypeTraits< UInt8 >::putToStream const UInt8 &  val,
OutStream str
[inline, static]
 

Reimplemented from osg::TypeTraitsTemplateBase< UInt8 >.

Definition at line 307 of file OSGBaseTypeTraits.h.

00309     {
00310         str << UInt32(val);
00311     }

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

Definition at line 297 of file OSGBaseTypeTraits.h.

00299     {
00300         Char8 buffer[10];
00301 
00302         sprintf(buffer, "%u", val);
00303 
00304         out.append(buffer);
00305     }


Member Data Documentation

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

Definition at line 236 of file OSGBaseTypeTraits.h.

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

Definition at line 235 of file OSGBaseTypeTraits.h.

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

Definition at line 232 of file OSGBaseTypeTraits.h.

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

Definition at line 233 of file OSGBaseTypeTraits.h.


The documentation for this struct was generated from the following file: