discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] updating abstract classes


From: Ilia Mirkin
Subject: Re: [Discuss-gnuradio] updating abstract classes
Date: Wed, 26 Apr 2006 18:35:27 -0400
User-agent: Internet Messaging Program (IMP) H3 (4.0.3)

Quoting Charles Swiger <address@hidden>:

On Wed, 2006-04-26 at 17:09 -0400, Ilia Mirkin wrote:
Quoting Charles Swiger <address@hidden>:
> ./atsc_equalizer.h:41: error: cannot declare field
> `atsc_equalizer::d_equalizer' to be of type `atsci_equalizer'
> ./atsc_equalizer.h:41: error:   because the following virtual functions
> are abstract:
> ./atsci_equalizer.h:159: error:  virtual void
> atsci_equalizer::filter_field_sync(const float*, float*, int, int, int)
> ./atsci_equalizer.h:140: error:  virtual void
> atsci_equalizer::filter_data_seg_sync(const float*, float*, int, int)

I'm guessing that you don't find these messages particularly informative, so
here's what they mean:

d_equalizer is of type atsci_equalizer; you're trying to instantiate one, but
atsci_equalizer is an abstract class because it doesn't have definitions for
these functions: filter_field_sync, filter_data_seq_sync. You can't
instantiate
abstract classes, so you must either define those functions or you must
specify
a more specific type for d_equalizer that can be instantiated.

The reason you probably see segfaults with the pointer version is because you
never actually create an object that d_equalizer would point to (at least in
the code that you showed).



Thanks, appreciate the explaination.

Another modules, atsc_fs_checker, which also has some abstract
classes DOES compile and run on meaningless streams w/o segfault
so I can go by that (tomorrow!).


Yeah - here's what I left out (arg!)

 d_equalizer = equalizer;


--Chuck

Yeah, so while atsci_equalizer doesn't implement these things,
atsci_equalizer_{lms,lms2,nop} do implement them. So you want something along
the lines of

atsci_equalizer *d_equalizer;

and somewhere in the code, do

d_equalizer = create_atsci_equalizer_nop() or something.

If d_equalizer points to a properly set up object, and ->filter() segfaults,
then there must be a bug in the filter() routine (or the inputs to it are
sufficiently wrong.)

 -Ilia




reply via email to

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