[Discuss-gnuradio] Question regarding struct type definition in header f
From:
Milo Wong
Subject:
[Discuss-gnuradio] Question regarding struct type definition in header files
Date:
Mon, 31 Aug 2009 14:42:31 -0700
Hi all,
I am working on writing a new block(class). This block generates 4 streams of sinusoid at different frequencies and each sinusoid is multiplied with the 4 streams of float input respectively. The sinusoid are generated by defining two struct type variables and do something with these two struct. My question is, should I put the definition of these two struct in the body of class as a private member? or should I define them out side of the class parallel with smart pointer? (i.e. typedef boost::shared_ptr<lpi_itersum_ff> lpi_itersum_ff_sptr;). What's the difference between puting the struct definations inside and outside of the class?
Here's my current brief .h file. I am not sure it's acceptable or not. If you find anything might lead the problem, please let me know. Any suggestions will be very much appreciated.
#define PI (3.141592654)
#define FREQLO 32.0 /* Low frequency (linear) */
#define FREQHI 10000.0 /* High frequency (linear) */
#define DOUTGAIN 10.0 /* Standard output gain */
#include <gr_sync_block.h>
class lpi_itersum_ff; typedef boost::shared_ptr<lpi_itersum_ff> lpi_itersum_ff_sptr;