SbDataType Class Reference
[Basics]

Class encoding a data type. More...

#include <Inventor/SbDataType.h>

List of all members.

Classes

union  DataValue
 union used to cast the generic value into specific type

Public Types

enum  DataType {
  UNSIGNED_BYTE = 0,
  UNSIGNED_SHORT = 1,
  UNSIGNED_INT32 = 2,
  SIGNED_BYTE = 4,
  SIGNED_SHORT = 5,
  SIGNED_INT32 = 6,
  FLOAT = 10,
  DOUBLE = 11,
  UNKNOWN = 0xFFFF
}

Public Member Functions

 SbDataType (DataType type)
 SbDataType (const SbString &type)
 SbDataType ()
 operator unsigned int () const
DataType getType () const
unsigned int getSize () const
SbBool isSigned () const
SbBool isInteger () const
unsigned int getNumBits () const
SbString getString () const
double getMin () const
double getMax () const
template<>
SbDataType getTemplateType (const unsigned char &)
template<>
SbDataType getTemplateType (const unsigned short &)
template<>
SbDataType getTemplateType (const uint32_t &)
template<>
SbDataType getTemplateType (const signed char &)
template<>
SbDataType getTemplateType (const signed short &)
template<>
SbDataType getTemplateType (const int &)
template<>
SbDataType getTemplateType (const float &)
template<>
SbDataType getTemplateType (const double &)

Friends

std::ostream & operator<< (std::ostream &os, const SbDataType type)

Detailed Description

Class encoding a data type.

This is a basic Open Inventor type that is used for representing a data type, for example unsigned int32, and some information about that type, for example is it signed or not. It is used by classes handling user buffers such as SoMemoryObject, SoSFArray2D, SoSFArray3D, SoSFImage and also SoDataSet.

SEE ALSO

SoMemoryObject, SoSFArray2D, SoSFArray3D


Member Enumeration Documentation

Supported Data type.

Enumerator:
UNSIGNED_BYTE 

unsigned byte

UNSIGNED_SHORT 

unsigned short

UNSIGNED_INT32 

unsigned int (32bits)

SIGNED_BYTE 

signed byte

SIGNED_SHORT 

signed short

SIGNED_INT32 

signed int (32bits)

FLOAT 

float

DOUBLE 

Double.

UNKNOWN 

unknown data type


Constructor & Destructor Documentation

SbDataType::SbDataType ( DataType  type  )  [inline, explicit]

Copy constructor.

SbDataType::SbDataType ( const SbString type  ) 

Constructor from a string.

Valid strings are the enum names.

SbDataType::SbDataType (  )  [inline]

Default constructor.

The initial value is UNSIGNED_BYTE.


Member Function Documentation

double SbDataType::getMax (  )  const

Returns the maximum value of the type.

double SbDataType::getMin (  )  const

Returns the minimum value of the type.


For floating point type, returns the minimum positive normalized value.

unsigned int SbDataType::getNumBits (  )  const [inline]

Returns the numer of bits in the type.

unsigned int SbDataType::getSize (  )  const [inline]

Returns size in bytes of the type.

SbString SbDataType::getString (  )  const

Returns the type as a string, e.g.

"FLOAT". See also getType().

template<>
SbDataType SbDataType::getTemplateType ( const double &   )  [inline]
template<>
SbDataType SbDataType::getTemplateType ( const float &   )  [inline]
template<>
SbDataType SbDataType::getTemplateType ( const int &   )  [inline]
template<>
SbDataType SbDataType::getTemplateType ( const signed short &   )  [inline]
template<>
SbDataType SbDataType::getTemplateType ( const signed char &   )  [inline]
template<>
SbDataType SbDataType::getTemplateType ( const uint32_t &   )  [inline]
template<>
SbDataType SbDataType::getTemplateType ( const unsigned short &   )  [inline]
template<>
SbDataType SbDataType::getTemplateType ( const unsigned char &   )  [inline]
SbDataType::DataType SbDataType::getType (  )  const [inline]

Returns the type as an enum.

See also getString().

SbBool SbDataType::isInteger (  )  const [inline]

Returns true if the type is an integer type.

SbBool SbDataType::isSigned (  )  const [inline]

Returns true if the type is signed.

SbDataType::operator unsigned int (  )  const [inline]

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const SbDataType  type 
) [friend]

ostream operator for SbDataType


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

Open Inventor Toolkit reference manual, generated on 25 Feb 2021
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/