3D PLM Enterprise Architecture |
Middleware Abstraction - Object Modeler |
About Globally Unique IDentifiersNaming your interface with a label unique the world over for some centuries |
Quick Reference |
AbstractThis article explains the Globally Unique IDentifier (GUID) and shows how to create one from your favorite workstation. It includes the following sections: |
A Globally Unique IDentifier (GUID) is intended to uniquely identify the interface wherever and whenever this interface is used. It is encoded on 128 bits and is made to be unique over both space and time:
GUIDs where first created as UUIDs, for Universally Unique IDentifiers, by the Open Software Foundation (OSF) for the Remote Procedure Calls (RPC) of the Distributed Computing Environment (DCE). This is the reason why you can find sometimes UUID used instead of GUID, such as in the commands or utilities to generate them.
[Top]
You can get a GUID for your interface as follows:
uuid_gen -C
command returns a GUID like the
following:
= { 0x7c7b3737, 0x5358, 0x0000, 0x02, {0x80, 0x02, 0x0b, 0x3e, 0x00, 0x00, 0x00} };
To run this command, enter:
/etc/ncs/uuid_gen -C
with AIX/usr/sbin/ncs/uuid_gen -C
with HP-UXYou need then to do a bit editing to transform it as follows when
including it into the interface IDL file: 7c7b3737-5358-0000-0280020b3e000000
To include it into a C++ file, transform it as follows:
= { 0x7c7b3737, 0x5358, 0x0000, {0x02, 0x80, 0x02, 0x0b, 0x3e, 0x00, 0x00, 0x00} };
uuidgen -s
returns a Global Unique
IDentifier as follows:
INTERFACENAME = { /* 7c7b3737-5358-0000-0280-020b3e000000 */ 0x7c7b3737, 0x5358, 0x0000, {0x02, 0x80, 0x02, 0x0b, 0x3e, 0x00, 0x00, 0x00} };
For an IDL interface, copy the commented value on the first line, paste
it, and remove the last hyphen to get 7c7b3737-5358-0000-0280020b3e000000
.
You can also run the UUIDGEN.EXE
which returns only 7c7b3737-5358-0000-0280-020b3e000000
.
Don't forget to remove the last hyphen.
To include it into a C++ header file, you can take the hexadecimal values as is.
= { 0x7c7b3737, 0x5358, 0x0000, {0x02, 0x80, 0x02, 0x0b, 0x3e, 0x00, 0x00, 0x00} };
Note: uuidgen
is usually located in C:\Program
Files\Microsoft Visual Studio\Common\Tools
[Top]
Version: 1 [Jan 2000] | Document created |
[Top] |
Copyright © 2000, Dassault Systèmes. All rights reserved.