Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 23:42 Go to next message
Joe Coombs is currently offline Joe CoombsFriend
Messages: 1
Registered: March 2010
Junior Member
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 19:37 Go to previous message
Amit Mookerjee is currently offline Amit MookerjeeFriend
Messages: 47
Registered: July 2009
Member
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: Tue Apr 16 19:44:08 GMT 2024

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

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

Back to the top