Main Page | Modules | Alphabetical List | Class List | Directories | Class Members

Type codes


Functions

size_t cpl_type_get_sizeof (cpl_type type)
 Compute the size of a type.

Detailed Description

This module provides codes for the basic types (char, int, float, etc.). These type codes may be used to indicate the type of a value stored in another object, the value of a property or the pixel of an image for instance. In addition, a utility function is provided to compute the size, which is required to store a value of the type indicated by a given type code.

The module

Synopsis
   #include <cpl_type.h>

Function Documentation

size_t cpl_type_get_sizeof cpl_type  type  ) 
 

Compute the size of a type.

Parameters:
type Type code to be evaluated.
Returns:
The size of the fundamental type, or 0 in case an invalid type code was given.
The function computes the atomic size of the type type. The result for fundamental types like CPL_TYPE_FLOAT is what you would expect from the C sizeof() operator. For arrays, i.e. types having the CPL_TYPE_FLAG_ARRAY set the returned size is not the size of a pointer to CPL_TYPE_FLOAT for instance, but the size of its fundamental type, i.e. the returned size is same as for the type CPL_TYPE_FLOAT.

Especially for the type CPL_TYPE_STRING, which is explicitly defined for convenience reasons, the size returned by this function is the size of CPL_TYPE_CHAR!


Generated on Mon Sep 26 14:38:18 2005 for Common Pipeline Library Reference Manual by  doxygen 1.4.1