Question: I have a struct definition with about 25 elements 

```
struct X { field 1; field 2; .. };    

```

and I'm trying to fill it with some map values 

```
Map<String,String> A    

```

and it appears to be very annoying to do such thing n times

```
X->xx = A["aaa"]    

```

every time that I want to fill my message struct.

Is it possible to access the members by name, e.g.

```
X->get_instance_of("xx").set(A["aaa"]);    

```

and put it into a loop?

Answer: 
Short answer: no. This is C++, a statically compiled language, where the structure member names are converted by the compiler into memory offsets. It is not dynamic like PHP or Python where the runtime is involved with all variable references.
It's not really possible to do that; the information you need is no longer present at runtime. You might be able to do something with a `map` and some pointers, but to be honest you would probably be better off just wrapping it up in a function that takes a `map` and puts the values into the appropriate fields.