From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,57893ac51069959a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.190.99 with SMTP id gp3mr7061768pbc.1.1327387196808; Mon, 23 Jan 2012 22:39:56 -0800 (PST) Path: lh20ni217681pbb.0!nntp.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!aioe.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: "C - like: THIS" pointer to a task type inside a task function Date: Tue, 24 Jan 2012 07:39:56 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Date: Tue, 24 Jan 2012 06:39:56 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="cJo7kSTQUrCFv2/D8KKtqw"; logging-data="21407"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19XWZuVfv1TqWGk88Yah7oG" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 In-Reply-To: Cancel-Lock: sha1:Q6466fPmtZKIsvnMsU2Nu3W41Eo= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: 2012-01-24T07:39:56+01:00 List-Id: Le 23/01/2012 20:32, Ada BRL a �crit : I too have concerns about your design, but to answer your specific question: > accept Send_Data(Data, Ti) do -- ===> Problem here! How can I > retrieve Ti object. I think I need a "this" pointer inside the task > body. Ti has to notify T4 who's the sender of data. > Inside the body of T1 (or any task type), the name T1 acts as a "this", i.e. it is not interpreted as a task type, but as a name that designate the current task. If all your clients are of the same type, use an access to this task type and T1'access can be used as a pointer to the current task. If you need several task types, use a pointer to an interface that all task types implement. But there can be many other solutions, assuming you really need two-stage communication. F.E., if know you have a limited number of clients, Retrieve_Data could be turned into an entry family, and Send_Data would provide a token (index into the entry family) where the client would retrieve its own data. This way, it's always the client who calls the server. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr