How do I get a member function in one class to know about another class
Mostrar comentarios más antiguos
This is not my application, but it will illustrate my question. Suppose I have one class called TelephoneCall and another class called PBX. Both are defined as handle classes. Suppose I define a method (member function) in class PBX and want to pass an object of type TelephoneCall to it. For example, the method in class PBX could be called DialCall. I would want to pass a TelephoneCall object as an argument to the DialCall method of class PBX.
Is inheritance the only way I can have the PBX utilize data from the TelephoneCall object? Or is there another way by which a method of one object can "know" about another class?
Respuestas (1)
Sean de Wolski
el 30 de Jul. de 2012
0 votos
If you do not want the TelephoneCall object to inherit from PBX why not just give it its own DialCall method?
1 comentario
Linda
el 30 de Jul. de 2012
Categorías
Más información sobre Construct and Work with Object Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!