summaryrefslogtreecommitdiff
path: root/project2/ice/slice2Rows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'project2/ice/slice2Rows.cpp')
-rw-r--r--project2/ice/slice2Rows.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/project2/ice/slice2Rows.cpp b/project2/ice/slice2Rows.cpp
index 10d319e..2f1c6f2 100644
--- a/project2/ice/slice2Rows.cpp
+++ b/project2/ice/slice2Rows.cpp
@@ -12,6 +12,9 @@ bool
Slice2Rows::visitModuleStart(const Slice::ModulePtr & m)
{
module = m->name();
+
+ if (!code) return true;
+
fprintf(code, "namespace IceRowsWrappers {\n");
fprintf(code, "\tnamespace %s {\n", m->name().c_str());
return true;
@@ -23,6 +26,9 @@ Slice2Rows::visitClassDefStart(const Slice::ClassDefPtr & c)
if (c->operations().empty()) return false;
interface = c->name();
+
+ if (!code) return true;
+
fprintf(code, "\t\tnamespace %s {\n", c->name().c_str());
return true;
}
@@ -31,6 +37,10 @@ void
Slice2Rows::visitOperation(const Slice::OperationPtr & o)
{
if (o->hasMetaData("project2:rows")) {
+ components += 1;
+
+ if (!code) return;
+
fprintf(code, "\t\t\tclass %s : public IceRows< ::%s::%sPrx > {\n", o->name().c_str(), module.c_str(), interface.c_str());
fprintf(code, "\t\t\t\tpublic:\n");
// Constructor
@@ -61,12 +71,16 @@ Slice2Rows::visitOperation(const Slice::OperationPtr & o)
void
Slice2Rows::visitClassDefEnd(const Slice::ClassDefPtr & c)
{
+ if (!code) return;
+
fprintf(code, "\t\t} // namespace %s\n\n", c->name().c_str());
}
void
Slice2Rows::visitModuleEnd(const Slice::ModulePtr & m)
{
+ if (!code) return;
+
fprintf(code, "\t}; // namespace %s\n", m->name().c_str());
fprintf(code, "}; // namespace IceRowsWrappers\n\n");
}