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

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

#include <OSGBaseTypeTraits.h>

Inheritance diagram for osg::TypeTraits< UInt16 >:

osg::TypeTraitsBase List of all members.

Public Types

typedef Real32 RealReturnType

Static Public Member Functions

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

Static Public Attributes

static const bool IsPOD = true
static const MathTypeProperties MathProp = IntValue
static const UInt16 BitsSet = 0xFFFF
static const UInt16 BitsClear = 0x0000

Detailed Description

template<>
struct osg::TypeTraits< UInt16 >

Definition at line 304 of file OSGBaseTypeTraits.h.


Member Typedef Documentation

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

Definition at line 306 of file OSGBaseTypeTraits.h.


Member Function Documentation

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

Definition at line 316 of file OSGBaseTypeTraits.h.

00317     {
00318         return 0;
00319     }

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

Definition at line 321 of file OSGBaseTypeTraits.h.

00322     {
00323         return 1;
00324     }

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

Definition at line 326 of file OSGBaseTypeTraits.h.

00327     {
00328         return std::numeric_limits<UInt16>::max();
00329     }

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

Definition at line 331 of file OSGBaseTypeTraits.h.

00332     {
00333         return std::numeric_limits<UInt16>::min();
00334     }

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

Definition at line 337 of file OSGBaseTypeTraits.h.

00338     {
00339         return (Real32(val) / Real32(getMax()));
00340     };

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

Definition at line 342 of file OSGBaseTypeTraits.h.

00343     {
00344         return (UInt16) (val * Real32(getMax()));
00345     };

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

Definition at line 348 of file OSGBaseTypeTraits.h.

00349     {
00350         if(szString != NULL)
00351         {
00352             return UInt16(strtoul(szString, NULL, 0));
00353         }
00354         else
00355         {
00356             return getZeroElement();
00357         }
00358     }

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

Definition at line 360 of file OSGBaseTypeTraits.h.

00361     {
00362         Char8 buffer[10];
00363 
00364 //      Check WIN32 Version
00365 #ifdef WIN32
00366         sprintf(buffer, "%u", UInt32(val));
00367 #else
00368         sprintf(buffer, "%u", val);
00369 #endif
00370 
00371         return std::string(buffer);
00372     }


Member Data Documentation

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

Definition at line 309 of file OSGBaseTypeTraits.h.

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

Definition at line 310 of file OSGBaseTypeTraits.h.

const UInt16 osg::TypeTraits< UInt16 >::BitsSet = 0xFFFF [static]
 

Definition at line 312 of file OSGBaseTypeTraits.h.

const UInt16 osg::TypeTraits< UInt16 >::BitsClear = 0x0000 [static]
 

Definition at line 313 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