IDs are numbers that uniquely represent strings. They can be used in SOM to identify method names, class names, and descriptors. Typically, they are used to provide a fast and efficient means of comparing the strings they represent. SOM provides a set of macros and functions, as shown in the following table, that can be used to manipulate SOM IDs.
┌────────────────────┬────────────────────────────────────────┐ │Type │Interface │ ├────────────────────┼────────────────────────────────────────┤ │Functions │somBeginPersistentIds │ ├────────────────────┼────────────────────────────────────────┤ │ │somEndPersistentIds │ ├────────────────────┼────────────────────────────────────────┤ │ │somRegisterId │ ├────────────────────┼────────────────────────────────────────┤ │ │somSetExpectedIds │ ├────────────────────┼────────────────────────────────────────┤ │ │somTotalRegIds │ ├────────────────────┼────────────────────────────────────────┤ │ │somUniqueKey │ ├────────────────────┼────────────────────────────────────────┤ │Macros │SOM_CheckID │ ├────────────────────┼────────────────────────────────────────┤ │ │SOM_CompareIDs │ ├────────────────────┼────────────────────────────────────────┤ │ │SOM_IDFromString │ ├────────────────────┼────────────────────────────────────────┤ │ │SOM_StringFromID │ └────────────────────┴────────────────────────────────────────┘
Initially an ID is a pointer to a string. A SOM ID automatically is converted to an internal ID representation by the SOM_CheckID macro or by the first invocation of any of the ID manipulation macros. Because the representation of an ID changes, SOM IDs are of a special data type, somId.