SDK Resources > C++ CIM Framework API > Strongly Typed and Untyped

Strongly Typed and Untyped

The C++ CimFramework enables development of two kinds of applications: those that depend on strong typing and those that expect an interface where details of the CIM class specifications are not built in.

Strong Typing

The C++ CimFramework implements strong typing with automatically generated C++ classes tied to the definitions in the MOFs. Applications that use the generated classes bind to the CIM class structure at compile time. The compiler can validate the correctness of the code based on the structures defined in the MOFs. The C++ CimFramework includes a C++ interface for each class supported by Intel AMT, derived from the MOF and the CimBase class in the framework. As shown below, these classes give the implementer access to all methods associated with the CIM class. Invoking a method in one of these classes accesses the internal XML document associated with the class. For example, a Create method builds the serialized XML for the object that the application creates. The C++ CimFramework then invokes the selected WS-Management client to send the Create request.

The advantage of strong typing is that the program’s correctness is checked at compile time. The disadvantage is that the generated C++ class is based on a specific version of the MOF, which can be a limitation when MOFs vary between releases of the DMTF standard or of Intel AMT.

Generated C++ Classes

The Intel AMT SDK provides a C++ class that implements each CIM class supported by Intel AMT. Each class is generated based on the corresponding MOF plus other implementation dependent information.

The generated classes implement all of the valid methods in the class. The generated classes inherit from the CimBase class.

Functions Supporting Method Parameters

When a class has a method that requires parameters, the generated class will contain functions for defining and retrieving field values.

   Each IN parameter has function for setting the parameter’s value.

   Each OUT parameter has a function for extracting the parameter’s value.

Also, each method will have a structure that is used to define the input parameters and/or output parameters, if any, associated with the method. The functions set the values in the input structure or retrieve the values from the output structure. This scheme enables working with optional fields.

Functions Supporting Optional Fields

Each generated class has a pair of functions for each field defined as optional in the MOF:

   <fieldname>Exists returns true if the optional field is present in the current instance of this object type that was retrieved from Intel AMT (for example, with a Get operation).

   Remove<fieldname> removes the optional field from the current object before sending it to Intel AMT (for example, with a Put operation). This method will succeed only if this field is optional in the concrete object.

Copyright © 2006-2022, Intel Corporation. All rights reserved.