Previous Table of Contents Next


7.10 The PrimitiveTypes Package

   The MOF defines a package called PrimitiveTypes that contains the MOF’s standard collection of primitive data types. These types are available for use in all MOF meta-models. Some of them (Boolean, Integer, and String) are used in the specification of the MOF Model as an instance of itself.

   The PrimitiveTypes Package is a MOF meta-model whose name is “PrimitiveTypes.? The package contains the PrimitiveType instances defined below, and no other instances. These instances denote the MOF’s standard technology-neutral primitive data types.

   NOTE: Technology mappings shall recognize standard PrimitiveType instances based on their qualified names. Multiple PrimitiveType instances with the required qualified name shall be deemed to mean the same thing.

   The sub clauses below define the 6 standard technology neutral primitive data types and their value domains. They also define the standard syntax used in the “value’ attribute of a Constant instance; see “Constant? on page 82.

7.10.1 Boolean

   This primitive data type is used to represent truth values.


7.10.2 Integer

   This primitive data type is the set of signed (two’s complement) 32 bit integers


7.10.3 Long

   This primitive data type is the set of signed (two’s complement) 64 bit integers


7.10.4 Float

   This primitive data type is the set of IEEE single precision floating point numbers (see ANSI/IEEE Standard 754-1985.

value domain

constant value syntax

The subset of the rational numbers that correspond to the values representable as IEEE single
precision floating point numbers.
CORBA IDL floating point literal syntax with an optional leading ‘-’ character.

7.10.5 Double

   This primitive data type is the set of IEEE double precision floating point numbers; see ANSI/IEEE Standard 754-1985.

value domain

constant value syntax

The subset of the rational numbers that correspond to the values representable as IEEE double
precision floating point numbers.
CORBA IDL floating point literal syntax with an optional leading ‘-’ character.

7.10.6 String

   This primitive data type is the set of all character strings that consist of 16 bit characters (excluding NUL).

   value domain The infinite set of all finite sequences of 16 bit characters (excluding the zero character value).

   constant value syntax A sequence of 16-bit characters. (Note: a Constant’s ‘value’ string for a String has no surrounding quotes and contains no character escape sequences.)

7.10.7 IDL for the PrimitiveTypes Package

   The IDL for the “PrimitiveTypes? package is given below. It is generated by applying the MOF to IDL mapping to the PrimitiveTypes Package. This IDL would typically be “#included? by IDL for meta-models (e.g., the MOF Model IDL).

   NOTE: This is not the IDL for the MOF objects that represent the primitive types.

   #pragma prefix "org.omg.mof"

   module PrimitiveTypes {

   // Collection types for the six standard MOF primitive data types

   typedef sequence < boolean > BooleanBag;

   typedef sequence < boolean > BooleanSet;

   typedef sequence < boolean > BooleanList;

   typedef sequence < boolean > BooleanUList;

   typedef sequence < long > LongBag;

   typedef sequence < long > LongSet;

   typedef sequence < long > LongList;

   typedef sequence < long > LongUList;

   typedef sequence < long long > LongLongBag;

   typedef sequence < long long > LongLongSet;

   typedef sequence < long long > LongLongList;

   typedef sequence < long long > LongLongUList;

   typedef sequence < float > FloatBag;

   typedef sequence < float > FloatSet;

   typedef sequence < float > FloatList;

   typedef sequence < float > FloatUList;

   typedef sequence < double > DoubleBag;

   typedef sequence < double > DoubleSet;

   typedef sequence < double > DoubleList;

   typedef sequence < double > DoubleUList;

   typedef sequence < wstring > WStringBag;

   typedef sequence < wstring > WStringSet;

   typedef sequence < wstring > WStringList;

   typedef sequence < wstring > WStringUList;

   // This interface would be inheritted by IDL for a Package declared as a sub-package of PrimitiveTypesinterface PrimitiveTypesPackage : Reflective::RefPackage { };

   // This interface is present because we can’t declare PrimitiveTypes as an abstract Package.

   // There is no point instantiating it.

   interface PrimitiveTypesPackageFactory {

   PrimitiveTypesPackage create_primitive_types_package() raises (Reflective::MofError); }; };