C++ code generation for repeted task
- by sateesh
Hi,
I have something like below which will get repeated many times based on the function 
 that get called 
for e.g 
  acceptfunction()
  {
       inserter["quantity"] = sdd.getfloat(quantity);
       inserter["prodtype"]  = sdd.getstring(prodtype);
         :
         :
       so on 
   }
Like accept above there are 20 more functions(reject,cancel etc) which will do the
  similar thing.But the parameteres they insert can differ based on function called.
How can I automate this kind of code.So that I dont need to write new function from
  scratch.Basically what I need is if i provide parametres like ("quantity",prodtype)
  through some text file or xml, it should generate the required function with the 
  input parametres.
Is this task can be handled through C++ tempalte Meta programming or someother code
  generation tool will help me to do this?