diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/demo/Freeze/phonebook/Makefile | 6 | ||||
-rw-r--r-- | cpp/src/IceStorm/Makefile | 2 | ||||
-rw-r--r-- | cpp/src/slice2freeze/Main.cpp | 36 | ||||
-rw-r--r-- | cpp/test/Freeze/complex/Makefile | 2 |
4 files changed, 20 insertions, 26 deletions
diff --git a/cpp/demo/Freeze/phonebook/Makefile b/cpp/demo/Freeze/phonebook/Makefile index fce5e3be70b..ffbd4f6280d 100644 --- a/cpp/demo/Freeze/phonebook/Makefile +++ b/cpp/demo/Freeze/phonebook/Makefile @@ -50,15 +50,15 @@ LDFLAGS := $(LDFLAGS) -L$(DB_HOME)/lib $(CLIENT): $(OBJS) $(COBJS) rm -f $@ - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) $(LIBS) -lFreeze -lIceXML -ldb -lreadline -lcurses + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) $(LIBS) -lFreeze -ldb -lreadline -lcurses $(SERVER): $(OBJS) $(SOBJS) rm -f $@ - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) -lFreeze -lIceXML -ldb $(LIBS) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) -lFreeze -ldb $(LIBS) $(COLLOCATED): $(OBJS) $(COLOBJS) rm -f $@ - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(COLOBJS) $(LIBS) -lFreeze -lIceXML -ldb -lreadline -lcurses + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(COLOBJS) $(LIBS) -lFreeze -ldb -lreadline -lcurses Grammar.cpp Grammar.h: Grammar.y bison -dvt Grammar.y diff --git a/cpp/src/IceStorm/Makefile b/cpp/src/IceStorm/Makefile index 7549e4d8262..4ba740c7f36 100644 --- a/cpp/src/IceStorm/Makefile +++ b/cpp/src/IceStorm/Makefile @@ -68,7 +68,7 @@ $(NAME): $(VERSIONED_NAME) $(SERVER): $(SOBJS) rm -f $@ - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(SOBJS) -lIceStorm -lFreeze -lIceXML -ldb $(LIBS) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(SOBJS) -lIceStorm -lFreeze -ldb $(LIBS) $(ADMIN): $(AOBJS) rm -f $@ diff --git a/cpp/src/slice2freeze/Main.cpp b/cpp/src/slice2freeze/Main.cpp index a10d7492b97..ef34ac40ed1 100644 --- a/cpp/src/slice2freeze/Main.cpp +++ b/cpp/src/slice2freeze/Main.cpp @@ -9,11 +9,12 @@ // ********************************************************************** #include <Slice/CPlusPlusUtil.h> +#include <IceUtil/OutputUtil.h> #include <fstream> using namespace std; -using namespace Slice; using namespace IceUtil; +using namespace Slice; struct Dict { @@ -87,39 +88,33 @@ writeCodecH(const TypePtr& type, const string& name, const string& freezeType, O H << sp << nl << "public:"; H << sp; H.inc(); - H << nl << "static void write(" << inputTypeToString(type) << ", Freeze::" << freezeType - << "&, const ::Ice::CommunicatorPtr&);"; - H << nl << "static void read(" << typeToString(type) << "&, const Freeze::" << freezeType << "&, " - << "const ::Ice::CommunicatorPtr&);"; + H << nl << "static void write(" << inputTypeToString(type) + << ", Freeze::" << freezeType << "& bytes, const ::Ice::CommunicatorPtr& communicator);"; + H << nl << "static void read(" << typeToString(type) << "&, const Freeze::" << freezeType << "& bytes, " + << "const ::Ice::CommunicatorPtr& communicator);"; H << eb << ';'; } void writeCodecC(const TypePtr& type, const string& name, const string& freezeType, Output& C) { - string tagName = "\""; - tagName += freezeType; - tagName += "\""; - C << sp << nl << "void" << nl << name << "::write(" << inputTypeToString(type) << " v, " << "Freeze::" << freezeType << "& bytes, const ::Ice::CommunicatorPtr& communicator)"; C << sb; - C << nl << "::std::ostringstream os;"; - C << nl << "os << \"<data>\";"; - C << nl << "::Ice::StreamPtr stream = new ::IceXML::StreamI(communicator, os);"; - writeGenericMarshalUnmarshalCode(C, type, "v", true, tagName, "stream", true); - C << nl << "os << \"\\n</data>\";"; - C << nl << "bytes.resize(os.str().size());"; - C << nl << "memcpy(&bytes[0], os.str().data(), os.str().size());"; + C << nl << "IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);"; + C << nl << "IceInternal::BasicStream stream(instance);"; + writeMarshalUnmarshalCode(C, type, "v", true, "stream", false); + C << nl << "bytes = stream.b;"; C << eb; C << sp << nl << "void" << nl << name << "::read(" << typeToString(type) << "& v, " << "const Freeze::" << freezeType << "& bytes, const ::Ice::CommunicatorPtr& communicator)"; C << sb; - C << nl << "::std::string data(bytes.begin(), bytes.end());"; - C << nl << "::std::istringstream is(data);"; - C << nl << "::Ice::StreamPtr stream = new ::IceXML::StreamI(communicator, is, false);"; - writeGenericMarshalUnmarshalCode(C, type, "v", false, tagName, "stream", true); + C << nl << "IceInternal::InstancePtr instance = IceInternal::getInstance(communicator);"; + C << nl << "IceInternal::BasicStream stream(instance);"; + C << nl << "stream.b = bytes;"; + C << nl << "stream.i = stream.b.begin();"; + writeMarshalUnmarshalCode(C, type, "v", false, "stream", false); C << eb; } @@ -504,7 +499,6 @@ main(int argc, char* argv[]) } C << "\n#include <Ice/BasicStream.h>"; - C << "\n#include <IceXML/StreamI.h>"; C << "\n#include <"; if (include.size()) { diff --git a/cpp/test/Freeze/complex/Makefile b/cpp/test/Freeze/complex/Makefile index 1e3b53a6f3f..7dcc6edf139 100644 --- a/cpp/test/Freeze/complex/Makefile +++ b/cpp/test/Freeze/complex/Makefile @@ -30,7 +30,7 @@ LDFLAGS := $(LDFLAGS) -L$(DB_HOME)/lib $(CLIENT): $(OBJS) rm -f $@ - $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) -lFreeze -lIceXML -ldb + $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) -lFreeze -ldb Grammar.cpp Grammar.h: Grammar.y bison -dvt Grammar.y |