How do I get a member function in one class to know about another class

1 view (last 30 days)
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?

Answers (1)

Sean de Wolski
Sean de Wolski on 30 Jul 2012
If you do not want the TelephoneCall object to inherit from PBX why not just give it its own DialCall method?
  1 Comment
Linda
Linda on 30 Jul 2012
Thank you for replying. More detailed explanantion sought concerning how to get one object to know about the other.

Sign in to comment.

Categories

Find more on Construct and Work with Object Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!