4. Designing and Writing OpenROAD Server Applications : COM Data Types and Data Mappings : Data Mappings : Pseudo-scalar Type Mappings
 
Share this page                  
Pseudo-scalar Type Mappings
The StringObject, LongByteObject, and BitmapObject instances are treated as scalar values (and not entirely as objects) for the purposes of mapping to and from COM VARIANTs. The VARIANT representation of these OpenROAD objects contains only the raw text or binary data associated with that object. It is not a full encoding of the attributes of the object.
When a VT_BSTR value is mapped to an attribute of type StringObject in the OpenROAD Server, a default instance of a StringObject is created and its text value is set to match the VT_BSTR string that was sent in. When a StringObject attribute is sent back with ByRef, the text value is extracted and converted back to a VT_BSTR string. All other attributes of the StringObject (such as FileHandle or DBHandle) are ignored on both input and output. This allows non-OpenROAD clients to easily map long character strings to OpenROAD StringObjects without having to construct a complex encoding.
When a “one-dimensional array of VT_UI1” value is mapped to an attribute of type LongByteObject in the OpenROAD Server, a default instance of a LongByteObject is created and the data value is set to the byte stream that was sent in. When a LongByteObject attribute is sent back with ByRef, the data value is extracted and converted back to a one-dimensional array of VT_UI1. All other attributes of the LongByteObject (such as FileHandle or DBHandle) are ignored on both input and output.
The mapping to and from BitmapObject is indirect, using LongByteObject as an intermediate step. The one-dimensional array of VT_UI1 VARIANT type is only mapped directly to and from LongByteObject. If the target attribute is of type BitmapObject, the input is first mapped to a LongByteObject (described previously), and then a default instance of a BitmapObject is created and its LoadLong method is used to transfer the LongByteObject data into the BitmapObject. On output, a default instance of a LongByteObject is created, and its LoadValue method is used to transfer the data from the BitmapObject into the temporary LongByteObject from which it is converted to a one-dimensional array of VT_UI1 (described previously). The OpenROAD Server only accepts (or returns) the bitmap byte stream. None of the other attributes of the BitmapObject is involved.