Cannot override non-virtual method 'sys::Component.setToDefault'

89 views
Skip to first unread message

eric_...@yahoo.com

unread,
Aug 29, 2017, 2:58:25 PM8/29/17
to Sedona Framework
Hello,

To further my understanding of the Sedona framework, I decided to play around with the pricomp kit. I started out with the "Prioritized" class and threw it in my editor. After messing around with it a good bit and working through tons of compile errors, I got it back to its original state and found another compile error that I just cannot figure out.

It is my understanding based on the documentation I've read, that Prioritized is an extension of sys::Component and "setToDefault" is a virtual method of Component, that can be overridden by a subclass. When I try to invoke setToDefault, I get a "Cannot override non-virtual method 'sys::Component.setToDefault'" compile error.

Can anyone explain what I'm missing here?

Andrey Skvortsov

unread,
Aug 29, 2017, 3:18:01 PM8/29/17
to eric_massie via Sedona Framework
Have you declared setToDefault method in subclass with override keyword?

override virtual void setToDefault(Slot slot)
{
...
}


--
Best regards,
Andrey Skvortsov


signature.asc

eric_...@yahoo.com

unread,
Aug 29, 2017, 3:23:54 PM8/29/17
to Sedona Framework
I sure have. This is basically the original source code of the Prioritized class, minus the notes, which I've just simply copy/pasted and cannot get to compile. 

abstract class Prioritized
  extends Component
{

  define int FB_LEVEL  =  17

 @readonly 
  @range=srcLevelStr
  @summary=false property int sourceLevel = FB_LEVEL

  @readonly 
  @unit = Units.nanosecond
  @summary=false property long overrideExpTime = 0L


  define Str srcLevelStr= "in0, emergency, in2, in3, in4, in5, in6, in7, override, in9, in10, in11, in12, in13, in14, in15, in16, fallback"
  
override virtual void setToDefault(Slot slot)
  {
    switch (slot.type.id)
    {
      case Type.boolId:   setBool(slot, null); break
      case Type.byteId:
      case Type.shortId:
      case Type.intId:    setInt(slot, Sys.minInt); break
      case Type.longId:   setLong(slot, Sys.minLong); break
      case Type.floatId:  setFloat(slot, null); break
      case Type.doubleId: setDouble(slot, null); break
      case Type.bufId:    getBuf(slot).clear(); break

Andrey Skvortsov

unread,
Aug 29, 2017, 4:19:52 PM8/29/17
to eric_massie via Sedona Framework
Hi Eric,
OK. This code compiles without a problem.
Could you describe in details, what doesn't compile?
Complete source code or minimal example of your problem would be perfect.

By the way Prioritized class is abstract and therefore can not be
instantiated. Maybe this is your problem?


> On Tuesday, August 29, 2017 at 2:58:25 PM UTC-4, eric_...@yahoo.com wrote:
> >
> > Hello,
> >
> > To further my understanding of the Sedona framework, I decided to play
> > around with the pricomp kit. I started out with the "Prioritized" class and
> > threw it in my editor. After messing around with it a good bit and working
> > through tons of compile errors, I got it back to its original state and
> > found another compile error that I just cannot figure out.
> >
> > It is my understanding based on the documentation I've read, that
> > Prioritized is an extension of sys::Component and "setToDefault" is a
> > virtual method of Component, that can be overridden by a subclass. When I
> > try to invoke setToDefault, I get a "Cannot override non-virtual method
> > 'sys::Component.setToDefault'" compile error.
> >
> > Can anyone explain what I'm missing here?
> >
>
> --
> You received this message because you are subscribed to the Google Groups "Sedona Framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sedonadev+...@googlegroups.com.
> To post to this group, send email to sedo...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sedonadev.
> For more options, visit https://groups.google.com/d/optout.
signature.asc

eric_...@yahoo.com

unread,
Aug 31, 2017, 9:16:43 AM8/31/17
to Sedona Framework
Thank you for you're response!

Maybe it's my compiler? (EasyIO CPT)

I was taking the source code for the "pricomp" kit and was going to play around and add a few simple things to the sub classes (Prioritized Bool, Numeric, etc.), then compile it. Prioritize is the base class for everything in the kit, so I started with that, but that's the class I can't get to compile. It's the exact same code I posted previously, which you said compiled for you.

I understand that it can't be instantiated, since it's abstract, but I don't believe it has anything to do with that.
Message has been deleted

eric_...@yahoo.com

unread,
Aug 31, 2017, 11:42:38 AM8/31/17
to Sedona Framework
Ok, so I just tried to load the "pricomp" kit directly into a controller and it failed to load the kit and gave a similar error as to when I try to compile it, so it's something with the source.

The error is " unknown override 'pricomp::Prioritized.setToDefault' "

I pulled the kit directly from 1.2.28 build from the website.


On Tuesday, August 29, 2017 at 2:58:25 PM UTC-4, eric_...@yahoo.com wrote:

Murat Egrikavuk

unread,
Aug 31, 2017, 12:22:09 PM8/31/17
to sedo...@googlegroups.com

Pricomp has dependency to sys  1.2.2+.  Are you sure you are compiling against that?
--

Ron Bennett

unread,
Aug 31, 2017, 12:34:32 PM8/31/17
to Sedona Framework
easyIO uses sedona 1.0 and not 1.2, this is your problem.

On Tuesday, August 29, 2017 at 2:58:25 PM UTC-4, eric_...@yahoo.com wrote:
Message has been deleted

eric_...@yahoo.com

unread,
Aug 31, 2017, 12:49:00 PM8/31/17
to Sedona Framework
That was it.

Thanks guys!


On Tuesday, August 29, 2017 at 2:58:25 PM UTC-4, eric_...@yahoo.com wrote:
Reply all
Reply to author
Forward
0 new messages