[hydra-commits] file: branch ice/slice-translator-versioning r655 - /ice/branches/slice-trans...

SVN commits to the Hydra project hydra-commits at lists.digium.com
Wed Jun 2 11:57:38 CDT 2010


Author: file
Date: Wed Jun  2 11:57:38 2010
New Revision: 655

URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=655
Log:
Add suppress support to slice2cs.

Modified:
    ice/branches/slice-translator-versioning/cpp/src/slice2cs/Gen.cpp
    ice/branches/slice-translator-versioning/cpp/src/slice2cs/Gen.h
    ice/branches/slice-translator-versioning/cpp/src/slice2cs/Main.cpp

Modified: ice/branches/slice-translator-versioning/cpp/src/slice2cs/Gen.cpp
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/slice-translator-versioning/cpp/src/slice2cs/Gen.cpp?view=diff&rev=655&r1=654&r2=655
==============================================================================
--- ice/branches/slice-translator-versioning/cpp/src/slice2cs/Gen.cpp (original)
+++ ice/branches/slice-translator-versioning/cpp/src/slice2cs/Gen.cpp Wed Jun  2 11:57:38 2010
@@ -42,6 +42,25 @@
 using IceUtilInternal::spar;
 using IceUtilInternal::epar;
 using IceUtilInternal::trim;
+
+static string
+suppressedscoped(const ContainerPtr& cp, string scope, bool _suppress)
+{
+    string suppressed_scope = scope;
+
+    if (_suppress) {
+	for (ContainedPtr contained = ContainedPtr::dynamicCast(cp); contained; contained = ContainedPtr::dynamicCast(contained->container())) {
+	    ModulePtr mod = ModulePtr::dynamicCast(contained);
+	    if (mod && mod->hasMetaData("suppress")) {
+		string suppress_string = "::" + mod->name();
+		string::size_type pos = suppressed_scope.rfind(suppress_string);
+		suppressed_scope.replace(pos, suppress_string.length(), "");
+	    }
+	}
+    }
+
+    return suppressed_scope;
+}
 
 static string // Should be an anonymous namespace, but VC++ 6 can't handle that.
 sliceModeToIceMode(Operation::Mode opMode)
@@ -1732,9 +1751,10 @@
 }
 
 Slice::Gen::Gen(const string& base, const vector<string>& includePaths, const string& dir,
-                bool impl, bool implTie, bool stream)
+                bool impl, bool implTie, bool stream, bool suppress)
     : _includePaths(includePaths),
-      _stream(stream)
+      _stream(stream),
+      _suppress(suppress)
 {
     string fileBase = base;
     string::size_type pos = base.find_last_of("/\\");
@@ -1808,59 +1828,59 @@
     UnitVisitor unitVisitor(_out);
     p->visit(&unitVisitor, false);
 
-    TypesVisitor typesVisitor(_out, _stream);
+    TypesVisitor typesVisitor(_out, _stream, _suppress);
     p->visit(&typesVisitor, false);
 
     //
     // The async delegates are emitted before the proxy definition
     // because the proxy methods need to know the type.
     //
-    AsyncDelegateVisitor asyncDelegateVisitor(_out);
+    AsyncDelegateVisitor asyncDelegateVisitor(_out, _suppress);
     p->visit(&asyncDelegateVisitor, false);
 
-    ProxyVisitor proxyVisitor(_out);
+    ProxyVisitor proxyVisitor(_out, _suppress);
     p->visit(&proxyVisitor, false);
 
-    OpsVisitor opsVisitor(_out);
+    OpsVisitor opsVisitor(_out, _suppress);
     p->visit(&opsVisitor, false);
 
-    HelperVisitor helperVisitor(_out, _stream);
+    HelperVisitor helperVisitor(_out, _stream, _suppress);
     p->visit(&helperVisitor, false);
 
-    DelegateVisitor delegateVisitor(_out);
+    DelegateVisitor delegateVisitor(_out, _suppress);
     p->visit(&delegateVisitor, false);
 
-    DelegateMVisitor delegateMVisitor(_out);
+    DelegateMVisitor delegateMVisitor(_out, _suppress);
     p->visit(&delegateMVisitor, false);
 
-    DelegateDVisitor delegateDVisitor(_out);
+    DelegateDVisitor delegateDVisitor(_out, _suppress);
     p->visit(&delegateDVisitor, false);
 
-    DispatcherVisitor dispatcherVisitor(_out, _stream);
+    DispatcherVisitor dispatcherVisitor(_out, _stream, _suppress);
     p->visit(&dispatcherVisitor, false);
 
-    AsyncVisitor asyncVisitor(_out);
+    AsyncVisitor asyncVisitor(_out, _suppress);
     p->visit(&asyncVisitor, false);
 }
 
 void
 Slice::Gen::generateTie(const UnitPtr& p)
 {
-    TieVisitor tieVisitor(_out);
+    TieVisitor tieVisitor(_out, _suppress);
     p->visit(&tieVisitor, false);
 }
 
 void
 Slice::Gen::generateImpl(const UnitPtr& p)
 {
-    ImplVisitor implVisitor(_impl);
+    ImplVisitor implVisitor(_impl, _suppress);
     p->visit(&implVisitor, false);
 }
 
 void
 Slice::Gen::generateImplTie(const UnitPtr& p)
 {
-    ImplTieVisitor implTieVisitor(_impl);
+    ImplTieVisitor implTieVisitor(_impl, _suppress);
     p->visit(&implTieVisitor, false);
 }
 
@@ -1964,8 +1984,8 @@
     return false;
 }
 
-Slice::Gen::TypesVisitor::TypesVisitor(IceUtilInternal::Output& out, bool stream)
-    : CsVisitor(out), _stream(stream)
+Slice::Gen::TypesVisitor::TypesVisitor(IceUtilInternal::Output& out, bool stream, bool suppress)
+    : CsVisitor(out), _stream(stream), _suppress(suppress)
 {
 }
 
@@ -1997,20 +2017,24 @@
         }
     }
 
-    string name = fixId(p->name());
-    _out << sp;
-    emitAttributes(p);
-    _out << nl << "namespace " << name;
-
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	string name = fixId(p->name());
+	_out << sp;
+	emitAttributes(p);
+	_out << nl << "namespace " << name;
+
+	_out << sb;
+    }
 
     return true;
 }
 
 void
-Slice::Gen::TypesVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::TypesVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -3590,8 +3614,8 @@
     }
 }
 
-Slice::Gen::ProxyVisitor::ProxyVisitor(IceUtilInternal::Output& out)
-    : CsVisitor(out)
+Slice::Gen::ProxyVisitor::ProxyVisitor(IceUtilInternal::Output& out, bool suppress)
+    : CsVisitor(out), _suppress(suppress)
 {
 }
 
@@ -3603,15 +3627,20 @@
         return false;
     }
 
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
+
     return true;
 }
 
 void
-Slice::Gen::ProxyVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::ProxyVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -3706,7 +3735,7 @@
     // Write the operations for the new async mapping.
     //
     vector<string> paramsNewAsync = getParamsAsync(p, false, true);
-    string clScope = fixId(cl->scope());
+    string clScope = fixId(suppressedscoped(p->container(), cl->scope(), _suppress));
     string delType = clScope + "Callback_" + cl->name() + "_" + p->name();
 
     _out << sp;
@@ -3772,23 +3801,27 @@
     }
 }
 
-Slice::Gen::AsyncDelegateVisitor::AsyncDelegateVisitor(IceUtilInternal::Output& out)
-    : CsVisitor(out)
+Slice::Gen::AsyncDelegateVisitor::AsyncDelegateVisitor(IceUtilInternal::Output& out, bool suppress)
+    : CsVisitor(out), _suppress(suppress)
 {
 }
 
 bool
 Slice::Gen::AsyncDelegateVisitor::visitModuleStart(const ModulePtr& p)
 {
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
     return true;
 }
 
 void
-Slice::Gen::AsyncDelegateVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::AsyncDelegateVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -3827,8 +3860,8 @@
     _out << paramDeclAMI << epar << ';';
 }
 
-Slice::Gen::OpsVisitor::OpsVisitor(IceUtilInternal::Output& out)
-    : CsVisitor(out)
+Slice::Gen::OpsVisitor::OpsVisitor(IceUtilInternal::Output& out, bool suppress)
+    : CsVisitor(out), _suppress(suppress)
 {
 }
 
@@ -3840,15 +3873,20 @@
         return false;
     }
 
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
+
     return true;
 }
 
 void
-Slice::Gen::OpsVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::OpsVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -3974,8 +4012,8 @@
     _out << eb;
 }
 
-Slice::Gen::HelperVisitor::HelperVisitor(IceUtilInternal::Output& out, bool stream)
-    : CsVisitor(out), _stream(stream)
+Slice::Gen::HelperVisitor::HelperVisitor(IceUtilInternal::Output& out, bool stream, bool suppress)
+    : CsVisitor(out), _stream(stream), _suppress(suppress)
 {
 }
 
@@ -3987,15 +4025,20 @@
         return false;
     }
 
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
+
     return true;
 }
 
 void
-Slice::Gen::HelperVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::HelperVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -4150,7 +4193,7 @@
         // Write the begin_ methods.
         //
         ClassDefPtr cl = ClassDefPtr::dynamicCast(op->container());
-        string clScope = fixId(cl->scope());
+        string clScope = fixId(suppressedscoped(op->container(), cl->scope(), _suppress));
         string delType = clScope + "Callback_" + cl->name() + "_" + op->name();
 
         _out << sp;
@@ -4987,8 +5030,8 @@
     _out << eb;
 }
 
-Slice::Gen::DelegateVisitor::DelegateVisitor(IceUtilInternal::Output& out)
-    : CsVisitor(out)
+Slice::Gen::DelegateVisitor::DelegateVisitor(IceUtilInternal::Output& out, bool suppress)
+    : CsVisitor(out), _suppress(suppress)
 {
 }
 
@@ -5000,15 +5043,20 @@
         return false;
     }
 
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
+
     return true;
 }
 
 void
-Slice::Gen::DelegateVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::DelegateVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -5068,8 +5116,8 @@
     _out << eb;
 }
 
-Slice::Gen::DelegateMVisitor::DelegateMVisitor(IceUtilInternal::Output& out)
-    : CsVisitor(out)
+Slice::Gen::DelegateMVisitor::DelegateMVisitor(IceUtilInternal::Output& out, bool suppress)
+    : CsVisitor(out), _suppress(suppress)
 {
 }
 
@@ -5081,15 +5129,20 @@
         return false;
     }
 
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
+
     return true;
 }
 
 void
-Slice::Gen::DelegateMVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::DelegateMVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -5332,8 +5385,8 @@
     _out << eb;
 }
 
-Slice::Gen::DelegateDVisitor::DelegateDVisitor(IceUtilInternal::Output& out)
-    : CsVisitor(out)
+Slice::Gen::DelegateDVisitor::DelegateDVisitor(IceUtilInternal::Output& out, bool suppress)
+    : CsVisitor(out), _suppress(suppress)
 {
 }
 
@@ -5345,15 +5398,20 @@
         return false;
     }
 
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
+
     return true;
 }
 
 void
-Slice::Gen::DelegateDVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::DelegateDVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -5551,8 +5609,8 @@
     _out << eb;
 }
 
-Slice::Gen::DispatcherVisitor::DispatcherVisitor(::IceUtilInternal::Output &out, bool stream)
-    : CsVisitor(out), _stream(stream)
+Slice::Gen::DispatcherVisitor::DispatcherVisitor(::IceUtilInternal::Output &out, bool stream, bool suppress)
+    : CsVisitor(out), _stream(stream), _suppress(suppress)
 {
 }
 
@@ -5564,15 +5622,20 @@
         return false;
     }
 
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
+
     return true;
 }
 
 void
-Slice::Gen::DispatcherVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::DispatcherVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -5648,8 +5711,8 @@
     return true;
 }
 
-Slice::Gen::AsyncVisitor::AsyncVisitor(::IceUtilInternal::Output &out)
-    : CsVisitor(out)
+Slice::Gen::AsyncVisitor::AsyncVisitor(::IceUtilInternal::Output &out, bool suppress)
+    : CsVisitor(out), _suppress(suppress)
 {
 }
 
@@ -5661,15 +5724,20 @@
         return false;
     }
 
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
+
     return true;
 }
 
 void
-Slice::Gen::AsyncVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::AsyncVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -5834,8 +5902,8 @@
     }
 }
 
-Slice::Gen::TieVisitor::TieVisitor(IceUtilInternal::Output& out)
-    : CsVisitor(out)
+Slice::Gen::TieVisitor::TieVisitor(IceUtilInternal::Output& out, bool suppress)
+    : CsVisitor(out), _suppress(suppress)
 {
 }
 
@@ -5847,16 +5915,20 @@
         return false;
     }
 
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
 
     return true;
 }
 
 void
-Slice::Gen::TieVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::TieVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -6186,8 +6258,8 @@
 }
 
 
-Slice::Gen::ImplVisitor::ImplVisitor(IceUtilInternal::Output& out)
-    : BaseImplVisitor(out)
+Slice::Gen::ImplVisitor::ImplVisitor(IceUtilInternal::Output& out, bool suppress)
+    : BaseImplVisitor(out), _suppress(suppress)
 {
 }
 
@@ -6199,16 +6271,20 @@
         return false;
     }
 
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
 
     return true;
 }
 
 void
-Slice::Gen::ImplVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::ImplVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool
@@ -6254,8 +6330,8 @@
     _out << eb;
 }
 
-Slice::Gen::ImplTieVisitor::ImplTieVisitor(IceUtilInternal::Output& out)
-    : BaseImplVisitor(out)
+Slice::Gen::ImplTieVisitor::ImplTieVisitor(IceUtilInternal::Output& out, bool suppress)
+    : BaseImplVisitor(out), _suppress(suppress)
 {
 }
 
@@ -6267,16 +6343,20 @@
         return false;
     }
 
-    _out << sp << nl << "namespace " << fixId(p->name());
-    _out << sb;
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << sp << nl << "namespace " << fixId(p->name());
+	_out << sb;
+    }
 
     return true;
 }
 
 void
-Slice::Gen::ImplTieVisitor::visitModuleEnd(const ModulePtr&)
-{
-    _out << eb;
+Slice::Gen::ImplTieVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_out << eb;
+    }
 }
 
 bool

Modified: ice/branches/slice-translator-versioning/cpp/src/slice2cs/Gen.h
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/slice-translator-versioning/cpp/src/slice2cs/Gen.h?view=diff&rev=655&r1=654&r2=655
==============================================================================
--- ice/branches/slice-translator-versioning/cpp/src/slice2cs/Gen.h (original)
+++ ice/branches/slice-translator-versioning/cpp/src/slice2cs/Gen.h Wed Jun  2 11:57:38 2010
@@ -70,7 +70,8 @@
         const std::string&,
         bool,
         bool,
-        bool);
+        bool,
+	bool);
     ~Gen();
 
     void generate(const UnitPtr&);
@@ -89,6 +90,8 @@
 
     bool _stream;
 
+    bool _suppress;
+
     void printHeader();
 
     class UnitVisitor : public CsVisitor
@@ -104,7 +107,7 @@
     {
     public:
 
-        TypesVisitor(::IceUtilInternal::Output&, bool);
+	    TypesVisitor(::IceUtilInternal::Output&, bool, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
@@ -127,39 +130,48 @@
         void writeMemberEquals(const DataMemberList&, int);
 
         bool _stream;
+	bool _suppress;
     };
 
     class AsyncDelegateVisitor : public CsVisitor
     {
     public:
 
-        AsyncDelegateVisitor(::IceUtilInternal::Output&);
+	    AsyncDelegateVisitor(::IceUtilInternal::Output&, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
         virtual bool visitClassDefStart(const ClassDefPtr&);
         virtual void visitClassDefEnd(const ClassDefPtr&);
 	virtual void visitOperation(const OperationPtr&);
+
+    private:
+
+	bool _suppress;
     };
 
     class ProxyVisitor : public CsVisitor
     {
     public:
 
-        ProxyVisitor(::IceUtilInternal::Output&);
+	    ProxyVisitor(::IceUtilInternal::Output&, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
         virtual bool visitClassDefStart(const ClassDefPtr&);
         virtual void visitClassDefEnd(const ClassDefPtr&);
         virtual void visitOperation(const OperationPtr&);
+
+    private:
+
+	bool _suppress;
     };
 
     class OpsVisitor : public CsVisitor
     {
     public:
 
-        OpsVisitor(::IceUtilInternal::Output&);
+	    OpsVisitor(::IceUtilInternal::Output&, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
@@ -167,13 +179,15 @@
 
     private:
         void writeOperations(const ClassDefPtr&, bool);
+
+	bool _suppress;
     };
 
     class HelperVisitor : public CsVisitor
     {
     public:
 
-        HelperVisitor(::IceUtilInternal::Output&, bool);
+	    HelperVisitor(::IceUtilInternal::Output&, bool, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
@@ -185,49 +199,63 @@
     private:
 
         bool _stream;
+
+	bool _suppress;
     };
 
     class DelegateVisitor : public CsVisitor
     {
     public:
 
-        DelegateVisitor(::IceUtilInternal::Output&);
-
-        virtual bool visitModuleStart(const ModulePtr&);
-        virtual void visitModuleEnd(const ModulePtr&);
-        virtual bool visitClassDefStart(const ClassDefPtr&);
-        virtual void visitClassDefEnd(const ClassDefPtr&);
+	    DelegateVisitor(::IceUtilInternal::Output&, bool);
+
+        virtual bool visitModuleStart(const ModulePtr&);
+        virtual void visitModuleEnd(const ModulePtr&);
+        virtual bool visitClassDefStart(const ClassDefPtr&);
+        virtual void visitClassDefEnd(const ClassDefPtr&);
+
+    private:
+
+	bool _suppress;
     };
 
     class DelegateMVisitor : public CsVisitor
     {
     public:
 
-        DelegateMVisitor(::IceUtilInternal::Output&);
-
-        virtual bool visitModuleStart(const ModulePtr&);
-        virtual void visitModuleEnd(const ModulePtr&);
-        virtual bool visitClassDefStart(const ClassDefPtr&);
-        virtual void visitClassDefEnd(const ClassDefPtr&);
+	    DelegateMVisitor(::IceUtilInternal::Output&, bool);
+
+        virtual bool visitModuleStart(const ModulePtr&);
+        virtual void visitModuleEnd(const ModulePtr&);
+        virtual bool visitClassDefStart(const ClassDefPtr&);
+        virtual void visitClassDefEnd(const ClassDefPtr&);
+
+    private:
+
+	bool _suppress;
     };
 
     class DelegateDVisitor : public CsVisitor
     {
     public:
 
-        DelegateDVisitor(::IceUtilInternal::Output&);
-
-        virtual bool visitModuleStart(const ModulePtr&);
-        virtual void visitModuleEnd(const ModulePtr&);
-        virtual bool visitClassDefStart(const ClassDefPtr&);
-        virtual void visitClassDefEnd(const ClassDefPtr&);
+	    DelegateDVisitor(::IceUtilInternal::Output&, bool);
+
+        virtual bool visitModuleStart(const ModulePtr&);
+        virtual void visitModuleEnd(const ModulePtr&);
+        virtual bool visitClassDefStart(const ClassDefPtr&);
+        virtual void visitClassDefEnd(const ClassDefPtr&);
+
+    private:
+
+	bool _suppress;
     };
 
     class DispatcherVisitor : public CsVisitor
     {
     public:
 
-        DispatcherVisitor(::IceUtilInternal::Output&, bool);
+	    DispatcherVisitor(::IceUtilInternal::Output&, bool, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
@@ -236,26 +264,32 @@
     private:
 
         bool _stream;
+
+	bool _suppress;
     };
 
     class AsyncVisitor : public CsVisitor
     {
     public:
 
-        AsyncVisitor(::IceUtilInternal::Output&);
+	    AsyncVisitor(::IceUtilInternal::Output&, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
         virtual bool visitClassDefStart(const ClassDefPtr&);
         virtual void visitClassDefEnd(const ClassDefPtr&);
         virtual void visitOperation(const OperationPtr&);
+
+    private:
+
+	bool _suppress;
     };
 
     class TieVisitor : public CsVisitor
     {
     public:
 
-        TieVisitor(::IceUtilInternal::Output&);
+	    TieVisitor(::IceUtilInternal::Output&, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
@@ -266,6 +300,8 @@
 
         typedef std::set<std::string> NameSet;
         void writeInheritedOperationsWithOpNames(const ClassDefPtr&, NameSet&);
+
+	bool _suppress;
     };
 
     class BaseImplVisitor : public CsVisitor
@@ -283,23 +319,31 @@
     {
     public:
 
-        ImplVisitor(::IceUtilInternal::Output&);
-
-        virtual bool visitModuleStart(const ModulePtr&);
-        virtual void visitModuleEnd(const ModulePtr&);
-        virtual bool visitClassDefStart(const ClassDefPtr&);
-        virtual void visitClassDefEnd(const ClassDefPtr&);
+	    ImplVisitor(::IceUtilInternal::Output&, bool);
+
+        virtual bool visitModuleStart(const ModulePtr&);
+        virtual void visitModuleEnd(const ModulePtr&);
+        virtual bool visitClassDefStart(const ClassDefPtr&);
+        virtual void visitClassDefEnd(const ClassDefPtr&);
+
+    private:
+
+	bool _suppress;
     };
 
     class ImplTieVisitor : public BaseImplVisitor
     {
     public:
 
-        ImplTieVisitor(::IceUtilInternal::Output&);
-
-        virtual bool visitModuleStart(const ModulePtr&);
-        virtual void visitModuleEnd(const ModulePtr&);
-        virtual bool visitClassDefStart(const ClassDefPtr&);
+	    ImplTieVisitor(::IceUtilInternal::Output&, bool);
+
+        virtual bool visitModuleStart(const ModulePtr&);
+        virtual void visitModuleEnd(const ModulePtr&);
+        virtual bool visitClassDefStart(const ClassDefPtr&);
+
+    private:
+
+	bool _suppress;
     };
 };
 

Modified: ice/branches/slice-translator-versioning/cpp/src/slice2cs/Main.cpp
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/slice-translator-versioning/cpp/src/slice2cs/Main.cpp?view=diff&rev=655&r1=654&r2=655
==============================================================================
--- ice/branches/slice-translator-versioning/cpp/src/slice2cs/Main.cpp (original)
+++ ice/branches/slice-translator-versioning/cpp/src/slice2cs/Main.cpp Wed Jun  2 11:57:38 2010
@@ -97,6 +97,7 @@
     opts.addOpt("", "ice");
     opts.addOpt("", "checksum");
     opts.addOpt("", "stream");
+    opts.addOpt("", "suppress");
 
     vector<string> args;
     try
@@ -161,6 +162,8 @@
     bool checksum = opts.isSet("checksum");
 
     bool stream = opts.isSet("stream");
+
+    bool suppress = opts.isSet("suppress");
 
     if(args.empty())
     {
@@ -255,7 +258,7 @@
                 {
                     try
                     {
-                        Gen gen(icecpp->getBaseName(), includePaths, output, impl, implTie, stream);
+                        Gen gen(icecpp->getBaseName(), includePaths, output, impl, implTie, stream, suppress);
                         gen.generate(p);
                         if(tie)
                         {





More information about the asterisk-scf-commits mailing list