From b1b61878dd972e9a4d8c8f9855774b1afe161ccb Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 3 Dec 2014 01:13:37 +0000 Subject: Don't create things for classes with no operations --- project2/ice/slice2Daemon.cpp | 2 ++ project2/ice/slice2Rows.cpp | 2 ++ project2/ice/slice2Task.cpp | 2 ++ 3 files changed, 6 insertions(+) diff --git a/project2/ice/slice2Daemon.cpp b/project2/ice/slice2Daemon.cpp index 3e889d3..73da741 100644 --- a/project2/ice/slice2Daemon.cpp +++ b/project2/ice/slice2Daemon.cpp @@ -19,6 +19,8 @@ Slice2Daemon::visitModuleStart(const Slice::ModulePtr & m) bool Slice2Daemon::visitClassDefStart(const Slice::ClassDefPtr & c) { + if (c->operations().empty()) return false; + interface = c->name(); fprintf(code, "\tclass %sImpl : public IceDaemonModule, public %s {\n", c->name().c_str(), c->name().c_str()); fprintf(code, "\t\tpublic:\n"); diff --git a/project2/ice/slice2Rows.cpp b/project2/ice/slice2Rows.cpp index cea2d6b..10d319e 100644 --- a/project2/ice/slice2Rows.cpp +++ b/project2/ice/slice2Rows.cpp @@ -20,6 +20,8 @@ Slice2Rows::visitModuleStart(const Slice::ModulePtr & m) bool Slice2Rows::visitClassDefStart(const Slice::ClassDefPtr & c) { + if (c->operations().empty()) return false; + interface = c->name(); fprintf(code, "\t\tnamespace %s {\n", c->name().c_str()); return true; diff --git a/project2/ice/slice2Task.cpp b/project2/ice/slice2Task.cpp index 1fbacaf..16be9e0 100644 --- a/project2/ice/slice2Task.cpp +++ b/project2/ice/slice2Task.cpp @@ -20,6 +20,8 @@ Slice2Task::visitModuleStart(const Slice::ModulePtr & m) bool Slice2Task::visitClassDefStart(const Slice::ClassDefPtr & c) { + if (c->operations().empty()) return false; + interface = c->name(); fprintf(code, "\t\tnamespace %s {\n", c->name().c_str()); return true; -- cgit v1.2.3