Info
この質問は閉じられています。 編集または回答するには再度開いてください。
How can I make inheritance selectable?
1 回表示 (過去 30 日間)
古いコメントを表示
I am doing some work in wireless. I wanted to select between Mac layer classes as such:
classdef myRadio < chosenMacLayer
where chosenMacLayer is a "variable" in that other code will swap it to the desired MAC layer. Can this be done?
Thanks! Tom
0 件のコメント
回答 (1 件)
Walter Roberson
2016 年 6 月 20 日
I don't think so. I gather that the approach to use in a situation like this would be to declare a class with virtual methods, and then the various Mac Layer classes would inherit from it and be responsible for instantiating the methods that differ between the sorts of layers.
0 件のコメント
この質問は閉じられています。
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!