Events Listening, Callback functions

1 view (last 30 days)
Bolivar
Bolivar on 11 Aug 2013
Hi, for my project I've got objects which should have thier listener callback function executed a certain among of times (up to 12 times) befor performing any other computations.
Can someone give me any guidance how to achieve this??
thanks,
Bolivar
  2 Comments
Jan
Jan on 12 Aug 2013
What are "objects" in your case?
Bolivar
Bolivar on 12 Aug 2013
Edited: Bolivar on 12 Aug 2013
Hi simon,
my objects can be defined as following:
classdef object < handle
properties
Link[10] % array obj objects link
end
methods
function obj = objects(objx) %objx is array of objects of type objects1
if nargin ~=0
addlistener(objx,'BS_CH_CONFIRM',@callbackconfirm);
addlistener(objx,'BS_CHANNEL_REQUEST';@callbackrequest);
end
end
........
end
now Assume we have six instance of class objects listening to each other. obj(6) = object; and obj(1) = objects([obj2-6]),obj(2)=objects([obj1,3-6]),obj(3) = objects([obj1,2,4-6]) and so on. When obj(1) echo if noone is been using link(2). all the other should reply depending on thier status, either immediately if themself currently haven't initiate a request or postpone if they do. the Reply appends information about status of their using links properties (link(2) in our case). Just after thier reply can obj(1) check for which property it should ask again. then they should use dictinct link properties' object. Now how do I know if all the other have reply? or set any timeout for reply notification.
thanks

Sign in to comment.

Answers (0)

Categories

Find more on Programming Utilities in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!