Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
How can I make inheritance selectable?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Walter Roberson
le 20 Juin 2016
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 commentaires
Cette question est clôturée.
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!