Inheritance in type consistency

2 posts / 0 new
Last post
Offline
Last seen: 2 years 10 months ago
Joined: 06/27/2020
Posts: 12
Inheritance in type consistency

Hello,

Assuming I have these two IDL strcuture:

strcuture1.IDL

struct IdentifiedObject {

    @key string mRID;

    string name;

};

 

struct logicalDevice : IdentifiedObject {

    string abc;

};

 

strcuture2.IDL

struct logicalDevice {

    @key string mRID;

    string name;

    string abc;

};

 

is these logicalDevices possible make type assignable?

 

Thank you!

Jason

 

Gerardo Pardo's picture
Offline
Last seen: 1 week 1 day ago
Joined: 06/02/2010
Posts: 602

Hi,

Yes, these two definitions of logicalDevice are assignable.  With regards to assignability inheritance is treated the same way as having the members of the derived structure appended after those of the base structure.

Gerardo