Return-Path: X-Original-To: apmail-etch-commits-archive@www.apache.org Delivered-To: apmail-etch-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C07D110DEF for ; Wed, 28 Aug 2013 15:06:42 +0000 (UTC) Received: (qmail 16789 invoked by uid 500); 28 Aug 2013 15:06:42 -0000 Delivered-To: apmail-etch-commits-archive@etch.apache.org Received: (qmail 16771 invoked by uid 500); 28 Aug 2013 15:06:42 -0000 Mailing-List: contact commits-help@etch.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@etch.apache.org Delivered-To: mailing list commits@etch.apache.org Received: (qmail 16763 invoked by uid 99); 28 Aug 2013 15:06:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Aug 2013 15:06:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Aug 2013 15:06:41 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 482AF2388A02; Wed, 28 Aug 2013 15:06:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1518245 - in /etch/trunk/examples/helloworld/cpp/src/main: include/ImplHelloWorldClient.h src/ImplHelloWorldClient.cpp src/MainHelloWorldClient.cpp Date: Wed, 28 Aug 2013 15:06:21 -0000 To: commits@etch.apache.org From: veithm@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130828150621.482AF2388A02@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: veithm Date: Wed Aug 28 15:06:20 2013 New Revision: 1518245 URL: http://svn.apache.org/r1518245 Log: ETCH-267 Using session events in CPP Hello World example This patch demonstrates how session event handlers can be registered in user code. Change-Id: I4260d875893d37141ab61fc4d4432eb3f9f3259c Modified: etch/trunk/examples/helloworld/cpp/src/main/include/ImplHelloWorldClient.h etch/trunk/examples/helloworld/cpp/src/main/src/ImplHelloWorldClient.cpp etch/trunk/examples/helloworld/cpp/src/main/src/MainHelloWorldClient.cpp Modified: etch/trunk/examples/helloworld/cpp/src/main/include/ImplHelloWorldClient.h URL: http://svn.apache.org/viewvc/etch/trunk/examples/helloworld/cpp/src/main/include/ImplHelloWorldClient.h?rev=1518245&r1=1518244&r2=1518245&view=diff ============================================================================== --- etch/trunk/examples/helloworld/cpp/src/main/include/ImplHelloWorldClient.h (original) +++ etch/trunk/examples/helloworld/cpp/src/main/include/ImplHelloWorldClient.h Wed Aug 28 15:06:20 2013 @@ -35,6 +35,9 @@ namespace org_apache_etch_examples_hello ImplHelloWorldClient( RemoteHelloWorldServer* mServer ); virtual ~ImplHelloWorldClient() {} + + virtual status_t _sessionNotify(capu::SmartPointer event ); + // TODO insert methods here to provide declarations of HelloWorldClient // messages from the mServer. }; Modified: etch/trunk/examples/helloworld/cpp/src/main/src/ImplHelloWorldClient.cpp URL: http://svn.apache.org/viewvc/etch/trunk/examples/helloworld/cpp/src/main/src/ImplHelloWorldClient.cpp?rev=1518245&r1=1518244&r2=1518245&view=diff ============================================================================== --- etch/trunk/examples/helloworld/cpp/src/main/src/ImplHelloWorldClient.cpp (original) +++ etch/trunk/examples/helloworld/cpp/src/main/src/ImplHelloWorldClient.cpp Wed Aug 28 15:06:20 2013 @@ -19,5 +19,12 @@ using namespace org_apache_etch_examples this->mServer = mServer; } + status_t ImplHelloWorldClient::_sessionNotify(capu::SmartPointer event ) { + EtchStringPtr eventName = capu::smartpointer_cast(event); + printf("Got sessionNotifyEvent %s\n",eventName->c_str()); + + return ETCH_OK; + } + // TODO insert methods here to provide implementations of HelloWorldClient // messages from the mServer. Modified: etch/trunk/examples/helloworld/cpp/src/main/src/MainHelloWorldClient.cpp URL: http://svn.apache.org/viewvc/etch/trunk/examples/helloworld/cpp/src/main/src/MainHelloWorldClient.cpp?rev=1518245&r1=1518244&r2=1518245&view=diff ============================================================================== --- etch/trunk/examples/helloworld/cpp/src/main/src/MainHelloWorldClient.cpp (original) +++ etch/trunk/examples/helloworld/cpp/src/main/src/MainHelloWorldClient.cpp Wed Aug 28 15:06:20 2013 @@ -64,6 +64,10 @@ capu::int32_t main(int argc, const char* // Disconnect from the service remote->transportControl(new EtchString(EtchTransportData::STOP_AND_WAIT_DOWN()), new EtchInt32(4000)); + //waiting + printf("\n\npress any key to close client\n"); + getchar(); + //delete remote delete remote;