etch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vei...@apache.org
Subject svn commit: r1518241 - in /etch/trunk/binding-cpp: compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/ runtime/include/support/
Date Wed, 28 Aug 2013 15:05:24 GMT
Author: veithm
Date: Wed Aug 28 15:05:23 2013
New Revision: 1518241

URL: http://svn.apache.org/r1518241
Log:
ETCH-267 Forwarding session events to user code

Till now session events are transferred through the
stack, but were not passed to the user code.
This patch makes it possible for the user code to override
_session* events.

Change-Id: Ida6b51a215888e70a6e02df748b772c188994053

Modified:
    etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/base_cpp.vm
    etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/base_h.vm
    etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/intf_cpp.vm
    etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/intf_h.vm
    etch/trunk/binding-cpp/runtime/include/support/EtchStubBase.h

Modified: etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/base_cpp.vm
URL: http://svn.apache.org/viewvc/etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/base_cpp.vm?rev=1518241&r1=1518240&r2=1518241&view=diff
==============================================================================
--- etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/base_cpp.vm
(original)
+++ etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/base_cpp.vm
Wed Aug 28 15:05:23 2013
@@ -114,16 +114,3 @@ $intfname::$n.name()AsyncResultPtr $clna
 #end
 #end
 
-  status_t $clname::_sessionQuery(capu::SmartPointer<EtchObject> query, capu::SmartPointer<EtchObject>
&result)
-  {
-    return ETCH_EUNIMPL;
-  }
-  status_t $clname::_sessionControl(capu::SmartPointer<EtchObject> control, capu::SmartPointer<EtchObject>
value)
-  {
-    return ETCH_EUNIMPL;
-  }
-
-  status_t $clname::_sessionNotify(capu::SmartPointer<EtchObject> event )
-  {
-    return ETCH_EUNIMPL;
-  }
\ No newline at end of file

Modified: etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/base_h.vm
URL: http://svn.apache.org/viewvc/etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/base_h.vm?rev=1518241&r1=1518240&r2=1518241&view=diff
==============================================================================
--- etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/base_h.vm
(original)
+++ etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/base_h.vm
Wed Aug 28 15:05:23 2013
@@ -35,7 +35,6 @@
 \#define __$helper.getBaseName($intf, $mc).toUpperCase()_H__
 
 \#include "$inc"
-\#include "support/EtchObjectSession.h"
 
 namespace $namespace {
   /**
@@ -47,7 +46,7 @@ namespace $namespace {
    */
 
    class $clname
-    : public $intfname, public EtchObjectSession
+    : public $intfname
    {
 #foreach ($mthd in $intf.iterator())
 #if ($mthd.isMsgDir($mc) || $mthd.isMsgDirBoth())
@@ -85,10 +84,7 @@ namespace $namespace {
 #end
 #end
 #end
-    public:
-      status_t _sessionQuery( capu::SmartPointer<EtchObject> query, capu::SmartPointer<EtchObject>
&result );
-      status_t _sessionControl( capu::SmartPointer<EtchObject> control, capu::SmartPointer<EtchObject>
value );
-      status_t _sessionNotify( capu::SmartPointer<EtchObject> event );
+
    };
 }
 #endif /* $helper.getBaseName($intf, $mc).toUpperCase() */
\ No newline at end of file

Modified: etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/intf_cpp.vm
URL: http://svn.apache.org/viewvc/etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/intf_cpp.vm?rev=1518241&r1=1518240&r2=1518241&view=diff
==============================================================================
--- etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/intf_cpp.vm
(original)
+++ etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/intf_cpp.vm
Wed Aug 28 15:05:23 2013
@@ -139,4 +139,18 @@ void $class::$n.name()::$helper.getSette
 #end
 #end
 #end
-#end
\ No newline at end of file
+#end
+
+status_t $class::_sessionQuery(capu::SmartPointer<EtchObject> query, capu::SmartPointer<EtchObject>
&result)
+{
+  return ETCH_EUNIMPL;
+}
+status_t $class::_sessionControl(capu::SmartPointer<EtchObject> control, capu::SmartPointer<EtchObject>
value)
+{
+  return ETCH_EUNIMPL;
+}
+
+status_t $class::_sessionNotify(capu::SmartPointer<EtchObject> event )
+{
+  return ETCH_EUNIMPL;
+}
\ No newline at end of file

Modified: etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/intf_h.vm
URL: http://svn.apache.org/viewvc/etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/intf_h.vm?rev=1518241&r1=1518240&r2=1518241&view=diff
==============================================================================
--- etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/intf_h.vm
(original)
+++ etch/trunk/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/intf_h.vm
Wed Aug 28 15:05:23 2013
@@ -39,6 +39,7 @@
 \#include "common/EtchTypes.h"
 #end
 \#include "support/EtchAsyncResult.h"
+\#include "support/EtchObjectSession.h"
 
 #if ($intf.hasDescr())
 /**
@@ -117,7 +118,7 @@ namespace $namespace {
 #end
 
 #if ($hasBaseClass)
-  class $intf.name()$suffix : public virtual $intf.name()
+  class $intf.name()$suffix : public virtual $intf.name(), public EtchObjectSession
 #else
   class $intf.name()$suffix
 #end
@@ -140,6 +141,11 @@ namespace $namespace {
     $intf.name()();
 #end
     virtual ~$intf.name()$suffix() {}
+    
+    // default implementation of EtchObjectSession
+    virtual status_t _sessionQuery( capu::SmartPointer<EtchObject> query, capu::SmartPointer<EtchObject>
&result );
+    virtual status_t _sessionControl( capu::SmartPointer<EtchObject> control, capu::SmartPointer<EtchObject>
value );
+    virtual status_t _sessionNotify( capu::SmartPointer<EtchObject> event );
 
 #foreach( $n in $intf.iterator() )
 #if ($n.isMessage())

Modified: etch/trunk/binding-cpp/runtime/include/support/EtchStubBase.h
URL: http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/include/support/EtchStubBase.h?rev=1518241&r1=1518240&r2=1518241&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/include/support/EtchStubBase.h (original)
+++ etch/trunk/binding-cpp/runtime/include/support/EtchStubBase.h Wed Aug 28 15:05:23 2013
@@ -26,7 +26,7 @@
 #include "support/EtchQueuedPool.h"
 #include "transport/EtchWho.h"
 #include "transport/EtchMessage.h"
-
+#include "support/EtchObjectSession.h"
 /**
  * Base class of stub implementations.
  * @param <T> The type of object used to implement stub.
@@ -183,8 +183,8 @@ status_t EtchStubBase<T>::sessionMessage
 
 template<typename T>
 status_t EtchStubBase<T>::sessionNotify(capu::SmartPointer<EtchObject> event)
{
-  //TODO: add implementation
-  return ETCH_EUNIMPL;
+  //TODO: Check if mObj is of type EtchObjectSession
+  return ((EtchObjectSession*) mObj)->_sessionNotify(event);
 }
 
 template<typename T>



Mime
View raw message