|
From: Jose' C. <cru...@ce...> - 2004-06-01 21:54:21
|
On Jun 1, 2004, at 10:36 PM, Dair Grant wrote: > I guess an ideal-looking API for me would be: > > - Version/size-tagged struct to create objects and do batch data > get/set > > - A common Q3Object_GetValue/SetValue API to assign tagged values to an > object > > I'm using this method for almost ten years now, everything has changed overtime ( DB back-end, platform, GUI framework, ecc but this has allowed us to change a bit at a time without breaking much ) we uses something like (C++): myObject->SetData( UInt32 tag, UInt32 type, void* data, UInt32 options, void* param) myObject->GetData( UInt32 tag, UInt32 type, void* data, UInt32 options, void* param) the type tells us what the data is (typeChar, typeFloat and the like) the options are used to qualify the meaning of "param", mainly to hint the conversion of the data (lang used, format string - decimals ecc and the like) we're talking about to change the tag from a 32 bits value to a string ( to avoid the conversion with XML tags, DB columns ecc ) the general storage is by using strings, but most common values are data members of the proper type, we've not feel the real need for VARIANT On Jun 1, 2004, at 11:24 PM, James W. Walker wrote: > The Q3Object_GetValue/SetValue APIs could be implemented using a > single custom element. I think that it would be safer and easier to > implement it that way, though perhaps a little less efficient at run > time. > yes, but really how it is implemented is not an issue, I see better the other way around the custom elements can be implemented in terms of Q3Object_GetValue/SetValue ( I prefer Q3Object_GetProperty/SetProperty too) Pax et Bonum # dott. Jose' Cruanyes Aguilar - C.E. Soft srl # Pzza. Firenze,4 MILANO - XX Settembre 10, CREMONA # 02,33603122 0372,460602 |