[hydra-commits] kpfleming: branch techdemo/kpfleming/slicing r571 - in /techdemo/team/kpflemi...

SVN commits to the Hydra project hydra-commits at lists.digium.com
Fri Apr 9 12:04:41 CDT 2010


Author: kpfleming
Date: Fri Apr  9 12:04:40 2010
New Revision: 571

URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=571
Log:
start work on unsliceable exceptions

Modified:
    techdemo/team/kpfleming/slicing/exceptions/Server.cpp
    techdemo/team/kpfleming/slicing/exceptions/Test.ice
    techdemo/team/kpfleming/slicing/exceptions/TestI.cpp
    techdemo/team/kpfleming/slicing/exceptions/TestI.h
    techdemo/team/kpfleming/slicing/objects/TestI.cpp

Modified: techdemo/team/kpfleming/slicing/exceptions/Server.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/Server.cpp?view=diff&rev=571&r1=570&r2=571
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/Server.cpp (original)
+++ techdemo/team/kpfleming/slicing/exceptions/Server.cpp Fri Apr  9 12:04:40 2010
@@ -15,11 +15,11 @@
 int
 run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
 {
-    Ice::PropertiesPtr properties = communicator->getProperties();
+    Ice::PropertiesPtr properties(communicator->getProperties());
     properties->setProperty("Ice.Warn.Dispatch", "0");
     communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000");
-    Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
-    Ice::ObjectPtr object = new TestI();
+    Ice::ObjectAdapterPtr adapter(communicator->createObjectAdapter("TestAdapter"));
+    Ice::ObjectPtr object(new TestI(communicator));
     adapter->add(object, communicator->stringToIdentity("Test"));
     adapter->activate();
     communicator->waitForShutdown();

Modified: techdemo/team/kpfleming/slicing/exceptions/Test.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/Test.ice?view=diff&rev=571&r1=570&r2=571
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/Test.ice (original)
+++ techdemo/team/kpfleming/slicing/exceptions/Test.ice Fri Apr  9 12:04:40 2010
@@ -33,6 +33,10 @@
     string kmd;
 };
 
+exception BaseUnsliceable extends Base
+{
+};
+
 ["ami"] interface TestIntf
 {
     void baseAsBase() throws Base;

Modified: techdemo/team/kpfleming/slicing/exceptions/TestI.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/TestI.cpp?view=diff&rev=571&r1=570&r2=571
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/TestI.cpp (original)
+++ techdemo/team/kpfleming/slicing/exceptions/TestI.cpp Fri Apr  9 12:04:40 2010
@@ -10,10 +10,38 @@
 #include <TestI.h>
 #include <Ice/Ice.h>
 
+using namespace std;
 using namespace Test;
 
-TestI::TestI()
+template <typename T>
+class PreserverFactory : public IceInternal::UserExceptionFactory
 {
+public:
+	virtual void createAndThrow() {
+		throw Preserver();
+	}
+private:
+	class Preserver : virtual public T
+	{
+	public:
+		vector< ::Ice::Byte > __skippedSlices;
+		virtual void __write(IceInternal::BasicStream* stream) const
+		{
+			stream->writeBlob(__skippedSlices);
+			T::__write(stream);
+		}
+		virtual void __read(IceInternal::BasicStream* stream, bool rid)
+		{
+			stream->readSkippedSlicesBlob(__skippedSlices);
+			T::__read(stream, rid);
+		}
+		virtual ~Preserver() throw() {}
+	};
+};
+
+TestI::TestI(const Ice::CommunicatorPtr& communicator)
+{
+	IceInternal::factoryTable->addExceptionFactory("::Test::BaseUnsliceable", new PreserverFactory<BaseUnsliceable>);
 }
 
 void

Modified: techdemo/team/kpfleming/slicing/exceptions/TestI.h
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/exceptions/TestI.h?view=diff&rev=571&r1=570&r2=571
==============================================================================
--- techdemo/team/kpfleming/slicing/exceptions/TestI.h (original)
+++ techdemo/team/kpfleming/slicing/exceptions/TestI.h Fri Apr  9 12:04:40 2010
@@ -16,7 +16,7 @@
 {
 public:
 
-    TestI();
+    TestI(const Ice::CommunicatorPtr&);
     virtual void baseAsBase(const ::Ice::Current&);
     virtual void unknownDerivedAsBase(const ::Ice::Current&);
     virtual void knownDerivedAsBase(const ::Ice::Current&);

Modified: techdemo/team/kpfleming/slicing/objects/TestI.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/objects/TestI.cpp?view=diff&rev=571&r1=570&r2=571
==============================================================================
--- techdemo/team/kpfleming/slicing/objects/TestI.cpp (original)
+++ techdemo/team/kpfleming/slicing/objects/TestI.cpp Fri Apr  9 12:04:40 2010
@@ -25,6 +25,7 @@
 private:
 	class Preserver : virtual public T
 	{
+	public:
 		vector< ::Ice::Byte > __skippedSlices;
 		virtual void __write(IceInternal::BasicStream* stream) const
 		{
@@ -33,7 +34,7 @@
 		}
 		virtual void __read(IceInternal::BasicStream* stream, bool rid)
 		{
-			stream->readSkippedSliceBlob(__skippedSlices);
+			stream->readSkippedSlicesBlob(__skippedSlices);
 			T::__read(stream, rid);
 		}
 	};





More information about the asterisk-scf-commits mailing list