Boost help please

Jim REMOVEjimdon at sympatico.caREMOVE
Thu Mar 20 08:22:02 EST 2003


Hi,

I am switching some C++ code over to use boost ... but i am having some 
problems just getting things to compile ... the compile error is not 
very helpful so i'll leave it out for now ... the problem i think is 
more related to the fact i need return a structure from a boost function 
.... can anyone help ;-)

The original un-boosted function is here:
-----------------------------------------

static PyObject *cosim_get_board(PyObject *self, PyObject *args)
{
   return Py_BuildValue("(ddddddddllll)",
     theboard.x60_clk/1e6,
     theboard.pwm_clk/1e6,
     theboard.utx_clk/1e6,
     theboard.urx_clk/1e6,

     theboard.local_ref_clk/1e6,
     theboard.pcr_ref_clk/1e6,
     theboard.mod_ref_clk/1e6,
     theboard.demod_ref_clk/1e6,

     static_cast<long>(theboard.mod_utopia),
     static_cast<long>(theboard.demod_utopia),

     static_cast<long>(theboard.dac_type),
     static_cast<long>(theboard.adc_type)
     );
}



The my attempt at a boosted function is here:
---------------------------------------------

struct boardInfoStruct {
   double d1;
   double d2;
   double d3;
   double d4;
   double d5;
   double d6;
   double d7;
   double d8;
   long l1;
   long l2;
   long l3;
   long l4;
};

boardInfoStruct BOOSTED_cosim_get_board()
{
   boardInfoStruct * ret = new boardInfoStruct();

   ret.d1 = theboard.x60_clk/1e6;
   ret.d2 = theboard.pwm_clk/1e6;
   ret.d3 = theboard.utx_clk/1e6;
   ret.d4 = theboard.urx_clk/1e6;
   ret.d5 = theboard.local_ref_clk/1e6;
   ret.d6 = theboard.pcr_ref_clk/1e6;
   ret.d7 = theboard.mod_ref_clk/1e6;
   ret.d8 = theboard.demod_ref_clk/1e6;

   ret.l1 = theboard.mod_utopia;
   ret.l2 = theboard.demod_utopia;
   ret.l3 = theboard.dac_type;
   ret.l4 = theboard.adc_type;

   return ret;

}





More information about the Python-list mailing list