How do I get a member function in one class to know about another class
이전 댓글 표시
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?
답변 (1개)
Sean de Wolski
2012년 7월 30일
0 개 추천
If you do not want the TelephoneCall object to inherit from PBX why not just give it its own DialCall method?
카테고리
도움말 센터 및 File Exchange에서 Construct and Work with Object Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!