Inheritance in type consistency

2 posts / 0 new
Last post
Offline
Last seen: 2 years 4 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: 3 weeks 11 hours ago
Joined: 06/02/2010
Posts: 601

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