[hydra-commits] kpfleming: branch techdemo/kpfleming/slicing r577 - /techdemo/team/kpfleming/...
SVN commits to the Hydra project
hydra-commits at lists.digium.com
Mon Apr 12 11:59:11 CDT 2010
Author: kpfleming
Date: Mon Apr 12 11:59:11 2010
New Revision: 577
URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=577
Log:
add unsliceable testing to AMD server
Modified:
techdemo/team/kpfleming/slicing/objects/ServerAMD.cpp
techdemo/team/kpfleming/slicing/objects/TestAMD.ice
techdemo/team/kpfleming/slicing/objects/TestAMDI.cpp
techdemo/team/kpfleming/slicing/objects/TestAMDI.h
Modified: techdemo/team/kpfleming/slicing/objects/ServerAMD.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/objects/ServerAMD.cpp?view=diff&rev=577&r1=576&r2=577
==============================================================================
--- techdemo/team/kpfleming/slicing/objects/ServerAMD.cpp (original)
+++ techdemo/team/kpfleming/slicing/objects/ServerAMD.cpp Mon Apr 12 11:59:11 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();
+ properties->setProperty("TestAdapter.Endpoints", "default -p 12010 -t 2000");
+ 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/objects/TestAMD.ice
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/objects/TestAMD.ice?view=diff&rev=577&r1=576&r2=577
==============================================================================
--- techdemo/team/kpfleming/slicing/objects/TestAMD.ice (original)
+++ techdemo/team/kpfleming/slicing/objects/TestAMD.ice Mon Apr 12 11:59:11 2010
@@ -27,6 +27,10 @@
{
string sb;
B pb;
+};
+
+class BU extends B
+{
};
class D1 extends B
Modified: techdemo/team/kpfleming/slicing/objects/TestAMDI.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/objects/TestAMDI.cpp?view=diff&rev=577&r1=576&r2=577
==============================================================================
--- techdemo/team/kpfleming/slicing/objects/TestAMDI.cpp (original)
+++ techdemo/team/kpfleming/slicing/objects/TestAMDI.cpp Mon Apr 12 11:59:11 2010
@@ -11,10 +11,38 @@
#include <Ice/Ice.h>
#include <sstream>
+using namespace std;
using namespace Test;
-TestI::TestI()
-{
+template <typename T>
+class PreserverFactory : public Ice::ObjectFactory
+{
+public:
+ Ice::ObjectPtr create(const string& type) {
+ return new Preserver();
+ }
+ void destroy() {}
+private:
+ class Preserver : virtual public T
+ {
+ public:
+ vector< ::Ice::Byte > __skippedSlices;
+ void __write(IceInternal::BasicStream* stream) const
+ {
+ stream->writeBlob(__skippedSlices);
+ T::__write(stream);
+ }
+ void __read(IceInternal::BasicStream* stream, bool rid)
+ {
+ stream->readSkippedSlicesBlob(__skippedSlices);
+ T::__read(stream, rid);
+ }
+ };
+};
+
+TestI::TestI(const Ice::CommunicatorPtr& communicator)
+{
+ communicator->addObjectFactory(new PreserverFactory<BU>, BU::ice_staticId());
}
void
Modified: techdemo/team/kpfleming/slicing/objects/TestAMDI.h
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/kpfleming/slicing/objects/TestAMDI.h?view=diff&rev=577&r1=576&r2=577
==============================================================================
--- techdemo/team/kpfleming/slicing/objects/TestAMDI.h (original)
+++ techdemo/team/kpfleming/slicing/objects/TestAMDI.h Mon Apr 12 11:59:11 2010
@@ -17,7 +17,7 @@
{
public:
- TestI();
+ TestI(const Ice::CommunicatorPtr& communicator);
virtual void SBaseAsObject_async(const ::Test::AMD_TestIntf_SBaseAsObjectPtr&, const ::Ice::Current&);
virtual void SBaseAsSBase_async(const ::Test::AMD_TestIntf_SBaseAsSBasePtr&, const ::Ice::Current&);
More information about the asterisk-scf-commits
mailing list