[udm-dev] Re: How to get access to GME object IDs using Udm?
Endre Magyari
endre at isis.vanderbilt.edu
Thu Aug 25 11:59:02 CDT 2005
Attila,
udm uniqued IDs in case of GME backend are derived from GME unique IDs
with a mechanism which is invertable:
swscanf(nn, OLESTR("id-%04lx-%08lx"), &c, &p) != 2 || (c-=100) >
OBJTYPE_FOLDER || c < OBJTYPE_MODEL || p > 100000000)
return 100000000 * c + p;
(nn is the GME id - string)
This is needed because GME IDs are strings and UDM ids are unsigned long
ints.
My way of getting back the GME string ID from UDM id - I needed in MILAN
project:
void GetStrObjId(long ObjId, CString & strObjId)
{
div_t res = div( ObjId, 100000000);
long ss = res.rem;
long mm = res.quot + 100;
wchar_t id[100];
swprintf(id, OLESTR("id-%04lx-%08lx"), mm, ss);
strObjId = id;
};
Thanks,
Endre
On Wed, 24 Aug 2005 10:49:31 -0500, Attila Vizhanyo
<viza at isis.vanderbilt.edu> wrote:
> Hi Endre,
>
> Jason needs to extract GME Object IDs (those IDs that uniquely identify
> objects in MGA) using Udm.
> Is there any way to do this? I could be wrong, but I thought that Udm
> unique IDs correspond to Object IDs when using the MGA backend. But
> unique IDs are not guaranteed to be persistent, right?
> I could not decipher this information from the source code or the
> documentation.
>
> Thanks,
> Attila
More information about the udm-dev
mailing list