Skip to main content



      Home
Home » Archived » DSDP - Real-Time Software Components (RTSC) » Inheriting an enum from a RTSC interface
Inheriting an enum from a RTSC interface [message #519483] Mon, 08 March 2010 18:42 Go to next message
Eclipse UserFriend
Is it possible to declare an enumeration in a RTSC interface, then use that enumeration as a data type in modules that inherit it? Here's what I'm trying to do:

metaonly interface IBlock
{
    // data type enum (must match similar enum in header template)
    enum DataType {
        DATA_Float32 = 0,
        DATA_Float64,
        DATA_Int8,
        // snip
    };

    // snip
}


metaonly module MyBlock inherits IBlock
{
    override config IBlock.DataType allowed_input_types[] = [IBlock.DATA_Int8];

    // snip
}


Unfortunately, I get an error message when I try to build the MyBlock module:

Quote:
"MyBlock.xdc", line X: can't resolve name (IBlock.DataType)


I'm not sure what's gone wrong here. This seems like something that should be possible; I hope I'm just making some trivial error. I'd really appreciate it if anyone can help.
Re: Inheriting an enum from a RTSC interface [message #519736 is a reply to message #519483] Tue, 09 March 2010 14:37 Go to previous message
Eclipse UserFriend
Joe,
You can use datatypes defined in other modules/interfaces.
I think you are seeing the error shown below because you are not referring to the scoped name of IBlock. Use the 'import' statement in your module to import the 'IBlock' definitions.

For example if IBlock is defined in a package called 'myPkg'
the module definition will look something like this:

import myPkg.IBlock;

metaonly module MyBlock inherits IBlock
{
config IBlock.DataType allowed_input_types[];


}


Previous Topic:Release notification for XDCtools 3.16.03
Next Topic:changing suffixes for ArchiveGoal and archives
Goto Forum:
  


Current Time: Mon Jul 07 20:40:59 EDT 2025

Powered by FUDForum. Page generated in 0.02849 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top