Get/set value to members of a struct/class on fly
Suppose I have a bunch of similar structs/classes in a format like this:
Then I need a general method(of course, we can do it one by one :) to pull
out/assign values from/to these structs with something like this(we don't
care mem alloc, and we also have a migic buf which can accept/supply
necessary values on demand btw :):
void set_values_for_any_struct (struct *assignto, point *migbuf, int
arrdepth, .., any other stuff)
suppose we know in advance the assignto is sN *
and we even know sN has two members, and what their types are, but since
this method should fit all structs we can't use assignto->flag =
migbuf.value to assign the value, is there a way to do so?
// same thing for get
(I'm doing this for a soap client(not server) app, not sure param's name in
soap1.2 is significant means server decides the name and I may not be able
to change them. but I don't have ideas even I can decide the struct and its
members names for soap1.1)
|All times are GMT. The time now is 03:33 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.