osg::TypeTraits< Int8 > Struct Template Reference

#include <OSGBaseTypeTraits.h>

Inheritance diagram for osg::TypeTraits< Int8 >:

osg::TypeTraitsTemplateBase< Int8 > osg::TypeTraitsBase List of all members.

Public Types

typedef Real32 RealReturnType

Static Public Member Functions

static Int8 getZeroElement (void)
static Int8 getOneElement (void)
static Int8 getMin (void)
static Int8 getMax (void)
static Real32 getFraction (Int8 val)
static Int8 getPortion (Real32 val)
static Int8 getFromCString (const Char8 *pData, Char8 *&pDataEnd)
static Int8 getFromCString (const Char8 *pData)
static void putToString (const Int8 val, std::string &out)
static void putToStream (const Int8 &val, OutStream &str)

Static Public Attributes

static const bool IsPOD = true
static const MathTypeProperties MathProp = IntValue
static const Int8 BitsSet = -1
static const Int8 BitsClear = 0x00

Detailed Description

template<>
struct osg::TypeTraits< Int8 >

Definition at line 319 of file OSGBaseTypeTraits.h.


Member Typedef Documentation

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

Definition at line 321 of file OSGBaseTypeTraits.h.


Member Function Documentation

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

Definition at line 352 of file OSGBaseTypeTraits.h.

00353     {
00354         return (Real32(val) / Real32(getMax()));
00355     };

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

Definition at line 376 of file OSGBaseTypeTraits.h.

00377     {
00378         Char8 *pDataEnd;
00379         
00380         return getFromCString(pData, pDataEnd);
00381     }

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

Definition at line 363 of file OSGBaseTypeTraits.h.

00365     {
00366         if(pData != NULL)
00367         {
00368             return Int8(strtol(pData, &pDataEnd, 0));
00369         }
00370         else
00371         {
00372             return getZeroElement();
00373         }
00374     }

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

Definition at line 346 of file OSGBaseTypeTraits.h.

00347     {
00348         return std::numeric_limits<Int8>::max();
00349     }

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

Definition at line 341 of file OSGBaseTypeTraits.h.

00342     {
00343         return std::numeric_limits<Int8>::min();
00344     }

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

Definition at line 336 of file OSGBaseTypeTraits.h.

00337     {
00338         return 1;
00339     }

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

Definition at line 357 of file OSGBaseTypeTraits.h.

00358     {
00359         return (Int8) (val * Real32(getMax()));
00360     };

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

Definition at line 331 of file OSGBaseTypeTraits.h.

00332     {
00333         return 0;
00334     }

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

Reimplemented from osg::TypeTraitsTemplateBase< Int8 >.

Definition at line 393 of file OSGBaseTypeTraits.h.

00395     {
00396         str << Int32(val);
00397     }

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

Definition at line 383 of file OSGBaseTypeTraits.h.

00385     {
00386         Char8 buffer[10];
00387 
00388         sprintf(buffer, "%i", val);
00389 
00390         out.append(buffer);
00391     }


Member Data Documentation

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

Definition at line 328 of file OSGBaseTypeTraits.h.

const Int8 osg::TypeTraits< Int8 >::BitsSet = -1 [static]
 

Definition at line 327 of file OSGBaseTypeTraits.h.

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

Definition at line 324 of file OSGBaseTypeTraits.h.

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

Definition at line 325 of file OSGBaseTypeTraits.h.


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