2.2.82 CimType

CimType is a 32-bit value of which only the lower 16 bits are used. It indicates the type of the value according to the CIM type system.

For any CimType given below, the corresponding values are encoded as specified in EncodedValue (section 2.2.71).

 CimType = CimBaseType / CimArrayType
  
 CimBaseType = CIM-TYPE-SINT8     / CIM-TYPE-UINT8 /
    CIM-TYPE-SINT16    / CIM-TYPE-UINT16 / 
    CIM-TYPE-SINT32    / CIM-TYPE-UINT32 /
    CIM-TYPE-SINT64    / CIM-TYPE-UINT64 / CIM-TYPE-REAL32 / 
    CIM-TYPE-REAL64    / CIM-TYPE-BOOLEAN / 
    CIM-TYPE-STRING    / CIM-TYPE-DATETIME / 
    CIM-TYPE-REFERENCE / CIM-TYPE-CHAR16 / 
    CIM-TYPE-OBJECT
  
 CimArrayType = CIM-ARRAY-SINT8 / CIM-ARRAY-UINT8 /
    CIM-ARRAY-SINT16   / CIM-ARRAY-UINT16 /
    CIM-ARRAY-SINT32   / CIM-ARRAY-UINT32 /
    CIM-ARRAY-SINT64   / CIM-ARRAY-UINT64 /
    CIM-ARRAY-REAL32   / CIM-ARRAY-REAL64 /
    CIM-ARRAY-BOOLEAN  / CIM-ARRAY-STRING /
    CIM-ARRAY-DATETIME / CIM-ARRAY-REFERENCE / 
    CIM-ARRAY-CHAR16   / CIM-ARRAY-OBJECT
  
 CimArrayFlag = %x20 %x00                    ; 0x2000 bit flag
  

The CimType is a 16-bit encoding unit that always contains a CimBaseType and an optional CimArrayFlag. If the type is actually an array type, the CimBaseType MUST be combined by using the bitwise OR operation with the CimArrayFlag value (0x2000) that results in the most significant octet containing 0x20 and the lower octet containing the value of the CimBaseType.

For example, to encode an array of CIM-TYPE-STRING, the CimType binary encoding would be 0x2008, in which the upper octet indicates that an array is being encoded, and the lower octet indicates that the array is of type CIM-TYPE-STRING.

The values for the individual types are constants specified in the following table. These values are mutually exclusive to each other.

  
 CIM-TYPE-SINT8 = %d16
 CIM-TYPE-UINT8 = %d17
 CIM-TYPE-SINT16 =%d2
 CIM-TYPE-UINT16 =%d18
 CIM-TYPE-SINT32 = %d3
 CIM-TYPE-UINT32 = %d19
 CIM-TYPE-SINT64 = %d20
 CIM-TYPE-UINT64 = %d21
 CIM-TYPE-REAL32 = %d4
 CIM-TYPE-REAL64 = %d5
 CIM-TYPE-BOOLEAN = %d11
 CIM-TYPE-STRING = %d8
 CIM-TYPE-DATETIME = %d101
 CIM-TYPE-REFERENCE = %d102
 CIM-TYPE-CHAR16 = %d103
 CIM-TYPE-OBJECT = %d13

Each base type can be combined with the array bit (0x2000), which results in an array of that base type. CimArrayType values are as follows.

  
 CIM-ARRAY-SINT8 = %d8208
 CIM-ARRAY-UINT8 = %d8209
 CIM-ARRAY-SINT16 =%d8194
 CIM-ARRAY-UINT16 =%d8210
 CIM-ARRAY-SINT32 = %d8195
 CIM-ARRAY-UINT32 = %d8201
 CIM-ARRAY-SINT64 = %d8202
 CIM-ARRAY-UINT64 = %d8203
 CIM-ARRAY-REAL32 = %d8196
 CIM-ARRAY-REAL64 = %d8197
 CIM-ARRAY-BOOLEAN = %d8203
 CIM-ARRAY-STRING = %d8200
 CIM-ARRAY-DATETIME = %d8293
 CIM-ARRAY-REFERENCE = %d8294
 CIM-ARRAY-CHAR16 = %d8295
 CIM-ARRAY-OBJECT = %d8205
  

CimArrayType can be defined in yet another way, as the following example shows.

  
 CimArrayType = CimBaseType | CimArrayFlag 
 ; Bitwise OR between a CimBaseType and CimArrayFlag gives 
 corresponding CimArrayType