Events Listening, Callback functions

1 回表示 (過去 30 日間)
Bolivar
Bolivar 2013 年 8 月 11 日
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 件のコメント
Jan
Jan 2013 年 8 月 12 日
What are "objects" in your case?
Bolivar
Bolivar 2013 年 8 月 12 日
編集済み: Bolivar 2013 年 8 月 12 日
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

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeSoftware Development Tools についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by