[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Question regarding struct type definition in head

From: Eric Blossom
Subject: Re: [Discuss-gnuradio] Question regarding struct type definition in header files
Date: Mon, 31 Aug 2009 20:52:41 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Aug 31, 2009 at 02:42:31PM -0700, Milo Wong wrote:
> 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.

Hi Milo,

The .h file should contain only what is required to allow the header
to be included, compiled and used by an "outside user" of the class
and nothing more.

This should compile if your header contains the necessary information:

// --- start of foo.cc

#include <lpi_itersum_ff.h>

// --- end of foo.cc


reply via email to

[Prev in Thread] Current Thread [Next in Thread]