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

SVN commits to the Hydra project hydra-commits at lists.digium.com
Fri May 28 12:04:53 CDT 2010


Author: file
Date: Fri May 28 12:04:52 2010
New Revision: 646

URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=646
Log:
Add progress thus far. It suppresses the namespace if told to, still needs work though!

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

Modified: ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp?view=diff&rev=646&r1=645&r2=646
==============================================================================
--- ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp (original)
+++ ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp Fri May 28 12:04:52 2010
@@ -128,7 +128,7 @@
 Slice::Gen::Gen(const string& base, const string& headerExtension, const string& sourceExtension,
                 const vector<string>& extraHeaders, const string& include,
                 const vector<string>& includePaths, const string& dllExport, const string& dir,
-                bool imp, bool checksum, bool stream, bool ice) :
+                bool imp, bool checksum, bool stream, bool ice, bool suppress) :
     _base(base),
     _headerExtension(headerExtension),
     _implHeaderExtension(headerExtension),
@@ -141,7 +141,8 @@
     _impl(imp),
     _checksum(checksum),
     _stream(stream),
-    _ice(ice)
+    _ice(ice),
+    _suppress(suppress)
 {
     for(vector<string>::iterator p = _includePaths.begin(); p != _includePaths.end(); ++p)
     {
@@ -400,25 +401,25 @@
         _dllExport += " ";
     }
 
-    ProxyDeclVisitor proxyDeclVisitor(H, C, _dllExport);
+    ProxyDeclVisitor proxyDeclVisitor(H, C, _dllExport, _suppress);
     p->visit(&proxyDeclVisitor, false);
 
-    ObjectDeclVisitor objectDeclVisitor(H, C, _dllExport);
+    ObjectDeclVisitor objectDeclVisitor(H, C, _dllExport, _suppress);
     p->visit(&objectDeclVisitor, false);
 
     IceInternalVisitor iceInternalVisitor(H, C, _dllExport);
     p->visit(&iceInternalVisitor, false);
 
-    HandleVisitor handleVisitor(H, C, _dllExport, _stream);
+    HandleVisitor handleVisitor(H, C, _dllExport, _stream, _suppress);
     p->visit(&handleVisitor, false);
 
-    TypesVisitor typesVisitor(H, C, _dllExport, _stream);
+    TypesVisitor typesVisitor(H, C, _dllExport, _stream, _suppress);
     p->visit(&typesVisitor, false);
 
-    AsyncVisitor asyncVisitor(H, C, _dllExport);
+    AsyncVisitor asyncVisitor(H, C, _dllExport, _suppress);
     p->visit(&asyncVisitor, false);
 
-    AsyncImplVisitor asyncImplVisitor(H, C, _dllExport);
+    AsyncImplVisitor asyncImplVisitor(H, C, _dllExport, _suppress);
     p->visit(&asyncImplVisitor, false);
 
     //
@@ -427,22 +428,22 @@
     // the proxy relies on knowing the hierarchy to make the begin_
     // methods type-safe.
     //
-    AsyncCallbackVisitor asyncCallbackVisitor(H, C, _dllExport);
+    AsyncCallbackVisitor asyncCallbackVisitor(H, C, _dllExport, _suppress);
     p->visit(&asyncCallbackVisitor, false);
 
-    ProxyVisitor proxyVisitor(H, C, _dllExport);
+    ProxyVisitor proxyVisitor(H, C, _dllExport, _suppress);
     p->visit(&proxyVisitor, false);
 
-    DelegateVisitor delegateVisitor(H, C, _dllExport);
+    DelegateVisitor delegateVisitor(H, C, _dllExport, _suppress);
     p->visit(&delegateVisitor, false);
 
-    DelegateMVisitor delegateMVisitor(H, C, _dllExport);
+    DelegateMVisitor delegateMVisitor(H, C, _dllExport, _suppress);
     p->visit(&delegateMVisitor, false);
 
-    DelegateDVisitor delegateDVisitor(H, C, _dllExport);
+    DelegateDVisitor delegateDVisitor(H, C, _dllExport, _suppress);
     p->visit(&delegateDVisitor, false);
 
-    ObjectVisitor objectVisitor(H, C, _dllExport, _stream);
+    ObjectVisitor objectVisitor(H, C, _dllExport, _stream, _suppress);
     p->visit(&objectVisitor, false);
 
     if(_stream)
@@ -456,7 +457,7 @@
     // definition, because __completed calls the begin_ method in the
     // proxy.
     //
-    AsyncCallbackTemplateVisitor asyncCallbackTemplateVisitor(H, C, _dllExport);
+    AsyncCallbackTemplateVisitor asyncCallbackTemplateVisitor(H, C, _dllExport, _suppress);
     p->visit(&asyncCallbackTemplateVisitor, false);
 
     if(_impl)
@@ -477,7 +478,7 @@
         }
         implC << _base << "I." << _implHeaderExtension << ">";
 
-        ImplVisitor implVisitor(implH, implC, _dllExport);
+        ImplVisitor implVisitor(implH, implC, _dllExport, _suppress);
         p->visit(&implVisitor, false);
     }
 
@@ -547,8 +548,9 @@
     }
 }
 
-Slice::Gen::TypesVisitor::TypesVisitor(Output& h, Output& c, const string& dllExport, bool stream) :
-    H(h), C(c), _dllExport(dllExport), _stream(stream), _doneStaticSymbol(false), _useWstring(false)
+Slice::Gen::TypesVisitor::TypesVisitor(Output& h, Output& c, const string& dllExport, bool stream, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _stream(stream), _doneStaticSymbol(false), _useWstring(false),
+    _suppress(suppress)
 {
 }
 
@@ -560,9 +562,11 @@
         return false;
     }
 
-    _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
-
-    H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+
+	H << sp << nl << "namespace " << fixKwd(p->name()) << nl << '{';
+    }
 
     return true;
 }
@@ -570,9 +574,11 @@
 void
 Slice::Gen::TypesVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    H << sp << nl << '}';
-
-    _useWstring = resetUseWstring(_useWstringHist);
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp << nl << '}';
+
+	_useWstring = resetUseWstring(_useWstringHist);
+    }
 }
 
 bool
@@ -1843,8 +1849,8 @@
     C.restoreIndent();
 }
 
-Slice::Gen::ProxyDeclVisitor::ProxyDeclVisitor(Output& h, Output& c, const string& dllExport) :
-    H(h), C(c), _dllExport(dllExport)
+Slice::Gen::ProxyDeclVisitor::ProxyDeclVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _suppress(suppress)
 {
 }
 
@@ -1875,34 +1881,38 @@
         return false;
     }
 
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	string name = fixKwd(p->name());
+
+	H << sp << nl << "namespace " << name << nl << '{';
+    }
+
+    return true;
+}
+
+void
+Slice::Gen::ProxyDeclVisitor::visitModuleEnd(const ModulePtr& p)
+{
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp << nl << '}';
+    }
+}
+
+void
+Slice::Gen::ProxyDeclVisitor::visitClassDecl(const ClassDeclPtr& p)
+{
+    if(p->isLocal())
+    {
+        return;
+    }
+
     string name = fixKwd(p->name());
 
-    H << sp << nl << "namespace " << name << nl << '{';
-
-    return true;
-}
-
-void
-Slice::Gen::ProxyDeclVisitor::visitModuleEnd(const ModulePtr& p)
-{
-    H << sp << nl << '}';
-}
-
-void
-Slice::Gen::ProxyDeclVisitor::visitClassDecl(const ClassDeclPtr& p)
-{
-    if(p->isLocal())
-    {
-        return;
-    }
-
-    string name = fixKwd(p->name());
-
     H << sp << nl << "class " << name << ';';
 }
 
-Slice::Gen::ProxyVisitor::ProxyVisitor(Output& h, Output& c, const string& dllExport) :
-    H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::ProxyVisitor::ProxyVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
 {
 }
 
@@ -1933,11 +1943,13 @@
         return false;
     }
 
-    _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
-
-    string name = fixKwd(p->name());
-
-    H << sp << nl << "namespace " << name << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+
+	string name = fixKwd(p->name());
+
+	H << sp << nl << "namespace " << name << nl << '{';
+    }
 
     return true;
 }
@@ -1945,9 +1957,11 @@
 void
 Slice::Gen::ProxyVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    H << sp << nl << '}';
-
-    _useWstring = resetUseWstring(_useWstringHist);
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp << nl << '}';
+
+	_useWstring = resetUseWstring(_useWstringHist);
+    }
 }
 
 bool
@@ -2853,8 +2867,8 @@
     }
 }
 
-Slice::Gen::DelegateVisitor::DelegateVisitor(Output& h, Output& c, const string& dllExport) :
-    H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::DelegateVisitor::DelegateVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
 {
 }
 
@@ -2885,11 +2899,13 @@
         return false;
     }
 
-    _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
-
-    string name = fixKwd(p->name());
-
-    H << sp << nl << "namespace " << name << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+
+	string name = fixKwd(p->name());
+
+	H << sp << nl << "namespace " << name << nl << '{';
+    }
 
     return true;
 }
@@ -2897,9 +2913,11 @@
 void
 Slice::Gen::DelegateVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    H << sp << nl << '}';
-
-    _useWstring = resetUseWstring(_useWstringHist);
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp << nl << '}';
+
+	_useWstring = resetUseWstring(_useWstringHist);
+    }
 }
 
 bool
@@ -2990,8 +3008,8 @@
     H << sp << nl << "virtual " << retS << ' ' << name << spar << params << epar << " = 0;";
 }
 
-Slice::Gen::DelegateMVisitor::DelegateMVisitor(Output& h, Output& c, const string& dllExport) :
-    H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::DelegateMVisitor::DelegateMVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
 {
 }
 
@@ -3022,11 +3040,13 @@
         return false;
     }
 
-    _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
-
-    string name = fixKwd(p->name());
-
-    H << sp << nl << "namespace " << name << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+
+	string name = fixKwd(p->name());
+
+	H << sp << nl << "namespace " << name << nl << '{';
+    }
 
     return true;
 }
@@ -3034,9 +3054,11 @@
 void
 Slice::Gen::DelegateMVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    H << sp << nl << '}';
-
-    _useWstring = resetUseWstring(_useWstringHist);
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp << nl << '}';
+
+	_useWstring = resetUseWstring(_useWstringHist);
+    }
 }
 
 bool
@@ -3264,8 +3286,8 @@
     C << eb;
 }
 
-Slice::Gen::DelegateDVisitor::DelegateDVisitor(Output& h, Output& c, const string& dllExport) :
-    H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::DelegateDVisitor::DelegateDVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
 {
 }
 
@@ -3296,11 +3318,13 @@
         return false;
     }
 
-    _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
-
-    string name = fixKwd(p->name());
-
-    H << sp << nl << "namespace " << name << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+
+	string name = fixKwd(p->name());
+
+	H << sp << nl << "namespace " << name << nl << '{';
+    }
 
     return true;
 }
@@ -3308,9 +3332,11 @@
 void
 Slice::Gen::DelegateDVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    H << sp << nl << '}';
-
-    _useWstring = resetUseWstring(_useWstringHist);
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp << nl << '}';
+
+	_useWstring = resetUseWstring(_useWstringHist);
+    }
 }
 
 bool
@@ -3614,8 +3640,8 @@
     }
 }
 
-Slice::Gen::ObjectDeclVisitor::ObjectDeclVisitor(Output& h, Output& c, const string& dllExport) :
-    H(h), C(c), _dllExport(dllExport)
+Slice::Gen::ObjectDeclVisitor::ObjectDeclVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _suppress(suppress)
 {
 }
 
@@ -3627,9 +3653,11 @@
         return false;
     }
 
-    string name = fixKwd(p->name());
-
-    H << sp << nl << "namespace " << name << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	string name = fixKwd(p->name());
+
+	H << sp << nl << "namespace " << name << nl << '{';
+    }
 
     return true;
 }
@@ -3637,7 +3665,9 @@
 void
 Slice::Gen::ObjectDeclVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    H << sp << nl << '}';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp << nl << '}';
+    }
 }
 
 void
@@ -3657,8 +3687,8 @@
     C << sp << nl << "static const ::std::string " << flatName << " = \"" << p->name() << "\";";
 }
 
-Slice::Gen::ObjectVisitor::ObjectVisitor(Output& h, Output& c, const string& dllExport, bool stream) :
-    H(h), C(c), _dllExport(dllExport), _stream(stream), _doneStaticSymbol(false), _useWstring(false)
+Slice::Gen::ObjectVisitor::ObjectVisitor(Output& h, Output& c, const string& dllExport, bool stream, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _stream(stream), _doneStaticSymbol(false), _useWstring(false), _suppress(suppress)
 {
 }
 
@@ -3670,11 +3700,13 @@
         return false;
     }
 
-    _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
-
-    string name = fixKwd(p->name());
-
-    H << sp << nl << "namespace " << name << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+
+	string name = fixKwd(p->name());
+
+	H << sp << nl << "namespace " << name << nl << '{';
+    }
 
     return true;
 }
@@ -3682,10 +3714,12 @@
 void
 Slice::Gen::ObjectVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    H << sp;
-    H << nl << '}';
-
-    _useWstring = resetUseWstring(_useWstringHist);
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp;
+	H << nl << '}';
+
+	_useWstring = resetUseWstring(_useWstringHist);
+    }
 }
 
 bool
@@ -5128,8 +5162,8 @@
     C.restoreIndent();
 }
 
-Slice::Gen::AsyncCallbackVisitor::AsyncCallbackVisitor(Output& h, Output& c, const string& dllExport) :
-    H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::AsyncCallbackVisitor::AsyncCallbackVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
 {
 }
 
@@ -5141,9 +5175,11 @@
         return false;
     }
 
-    _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
-
-    H << sp << nl << "namespace " << fixKwd(p->name())  << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+
+	H << sp << nl << "namespace " << fixKwd(p->name())  << nl << '{';
+    }
 
     return true;
 }
@@ -5151,9 +5187,11 @@
 void
 Slice::Gen::AsyncCallbackVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    _useWstring = resetUseWstring(_useWstringHist);
-
-    H << sp << nl << '}';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = resetUseWstring(_useWstringHist);
+
+	H << sp << nl << '}';
+    }
 }
 
 bool
@@ -5189,8 +5227,8 @@
 
 Slice::Gen::AsyncCallbackTemplateVisitor::AsyncCallbackTemplateVisitor(Output& h, 
                                                                        Output& c,
-                                                                       const string& dllExport)
-    : H(h), C(c), _dllExport(dllExport), _useWstring(false)
+                                                                       const string& dllExport, bool suppress)
+    : H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
 {
 }
 
@@ -5213,18 +5251,23 @@
         return false;
     }
 
-    _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
-
-    H << sp << nl << "namespace " << fixKwd(p->name())  << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+
+	H << sp << nl << "namespace " << fixKwd(p->name())  << nl << '{';
+    }
+
     return true;
 }
 
 void
 Slice::Gen::AsyncCallbackTemplateVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    _useWstring = resetUseWstring(_useWstringHist);
-
-    H << sp << nl << '}';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = resetUseWstring(_useWstringHist);
+
+	H << sp << nl << '}';
+    }
 }
 
 bool
@@ -5616,8 +5659,8 @@
     return true;
 }
 
-Slice::Gen::HandleVisitor::HandleVisitor(Output& h, Output& c, const string& dllExport, bool stream) :
-    H(h), C(c), _dllExport(dllExport), _stream(stream)
+Slice::Gen::HandleVisitor::HandleVisitor(Output& h, Output& c, const string& dllExport, bool stream, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _stream(stream), _suppress(suppress)
 {
 }
 
@@ -5629,10 +5672,12 @@
         return false;
     }
 
-    string name = fixKwd(p->name());
-
-    H << sp;
-    H << nl << "namespace " << name << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	string name = fixKwd(p->name());
+
+	H << sp;
+	H << nl << "namespace " << name << nl << '{';
+    }
 
     return true;
 }
@@ -5640,8 +5685,10 @@
 void
 Slice::Gen::HandleVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    H << sp;
-    H << nl << '}';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp;
+	H << nl << '}';
+    }
 }
 
 void
@@ -5764,8 +5811,8 @@
 }
 
 Slice::Gen::ImplVisitor::ImplVisitor(Output& h, Output& c,
-                                     const string& dllExport) :
-    H(h), C(c), _dllExport(dllExport), _useWstring(false)
+                                     const string& dllExport, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
 {
 }
 
@@ -5936,10 +5983,12 @@
     {
         H << nl << "#include <" << *it << "I.h>";
     }
-    
-    string name = fixKwd(p->name());
-
-    H << sp << nl << "namespace " << name << nl << '{';
+
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	string name = fixKwd(p->name());
+
+	H << sp << nl << "namespace " << name << nl << '{';
+    }
 
     return true;
 }
@@ -5947,10 +5996,12 @@
 void
 Slice::Gen::ImplVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    H << sp;
-    H << nl << '}';
-
-    _useWstring = resetUseWstring(_useWstringHist);
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp;
+	H << nl << '}';
+
+	_useWstring = resetUseWstring(_useWstringHist);
+    }
 }
 
 bool
@@ -6185,8 +6236,8 @@
     return true;
 }
 
-Slice::Gen::AsyncVisitor::AsyncVisitor(Output& h, Output& c, const string& dllExport) :
-    H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::AsyncVisitor::AsyncVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
 {
 }
 
@@ -6198,11 +6249,13 @@
         return false;
     }
 
-    _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
-
-    string name = fixKwd(p->name());
-
-    H << sp << nl << "namespace " << name << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+
+	string name = fixKwd(p->name());
+
+	H << sp << nl << "namespace " << name << nl << '{';
+    }
 
     return true;
 }
@@ -6210,9 +6263,11 @@
 void
 Slice::Gen::AsyncVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    H << sp << nl << '}';
-
-    _useWstring = resetUseWstring(_useWstringHist);
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp << nl << '}';
+
+	_useWstring = resetUseWstring(_useWstringHist);
+    }
 }
 
 bool
@@ -6355,8 +6410,8 @@
     }
 }
 
-Slice::Gen::AsyncImplVisitor::AsyncImplVisitor(Output& h, Output& c, const string& dllExport) :
-    H(h), C(c), _dllExport(dllExport), _useWstring(false)
+Slice::Gen::AsyncImplVisitor::AsyncImplVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+    H(h), C(c), _dllExport(dllExport), _useWstring(false), _suppress(suppress)
 {
 }
 
@@ -6387,11 +6442,13 @@
         return false;
     }
 
-    _useWstring = setUseWstring(p, _useWstringHist, _useWstring);
-
-    string name = fixKwd(p->name());
-
-    H << sp << nl << "namespace " << name << nl << '{';
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
+
+	string name = fixKwd(p->name());
+
+	H << sp << nl << "namespace " << name << nl << '{';
+    }
 
     return true;
 }
@@ -6399,9 +6456,11 @@
 void
 Slice::Gen::AsyncImplVisitor::visitModuleEnd(const ModulePtr& p)
 {
-    H << sp << nl << '}';
-
-    _useWstring = resetUseWstring(_useWstringHist);
+    if (!p->hasMetaData("suppress") || !_suppress) {
+	H << sp << nl << '}';
+
+	_useWstring = resetUseWstring(_useWstringHist);
+    }
 }
 
 bool

Modified: ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.h
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.h?view=diff&rev=646&r1=645&r2=646
==============================================================================
--- ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.h (original)
+++ ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.h Fri May 28 12:04:52 2010
@@ -31,7 +31,8 @@
         bool,
         bool,
         bool,
-        bool);
+        bool,
+	bool);
     ~Gen();
 
     void generate(const UnitPtr&);
@@ -70,12 +71,13 @@
     bool _checksum;
     bool _stream;
     bool _ice;
+    bool _suppress;
 
     class TypesVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        TypesVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+	    TypesVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
@@ -102,13 +104,14 @@
         bool _doneStaticSymbol;
         int _useWstring;
         std::list<int> _useWstringHist;
+	bool _suppress;
     };
 
     class ProxyDeclVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        ProxyDeclVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+	    ProxyDeclVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
 
         virtual bool visitUnitStart(const UnitPtr&);
         virtual void visitUnitEnd(const UnitPtr&);
@@ -122,109 +125,114 @@
         ::IceUtilInternal::Output& C;
 
         std::string _dllExport;
+	bool _suppress;
     };
 
     class ProxyVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        ProxyVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
-
-        virtual bool visitUnitStart(const UnitPtr&);
-        virtual void visitUnitEnd(const UnitPtr&);
-        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:
-
-        ::IceUtilInternal::Output& H;
-        ::IceUtilInternal::Output& C;
-
-        std::string _dllExport;
-        int _useWstring;
-        std::list<int> _useWstringHist;
+	    ProxyVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+
+        virtual bool visitUnitStart(const UnitPtr&);
+        virtual void visitUnitEnd(const UnitPtr&);
+        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:
+
+        ::IceUtilInternal::Output& H;
+        ::IceUtilInternal::Output& C;
+
+        std::string _dllExport;
+        int _useWstring;
+        std::list<int> _useWstringHist;
+	bool _suppress;
     };
 
     class DelegateVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        DelegateVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
-
-        virtual bool visitUnitStart(const UnitPtr&);
-        virtual void visitUnitEnd(const UnitPtr&);
-        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:
-
-        ::IceUtilInternal::Output& H;
-        ::IceUtilInternal::Output& C;
-
-        std::string _dllExport;
-        int _useWstring;
-        std::list<int> _useWstringHist;
+	    DelegateVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+
+        virtual bool visitUnitStart(const UnitPtr&);
+        virtual void visitUnitEnd(const UnitPtr&);
+        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:
+
+        ::IceUtilInternal::Output& H;
+        ::IceUtilInternal::Output& C;
+
+        std::string _dllExport;
+        int _useWstring;
+        std::list<int> _useWstringHist;
+	bool _suppress;
     };
 
     class DelegateMVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        DelegateMVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
-
-        virtual bool visitUnitStart(const UnitPtr&);
-        virtual void visitUnitEnd(const UnitPtr&);
-        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:
-
-        ::IceUtilInternal::Output& H;
-        ::IceUtilInternal::Output& C;
-
-        std::string _dllExport;
-        int _useWstring;
-        std::list<int> _useWstringHist;
+	    DelegateMVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+
+        virtual bool visitUnitStart(const UnitPtr&);
+        virtual void visitUnitEnd(const UnitPtr&);
+        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:
+
+        ::IceUtilInternal::Output& H;
+        ::IceUtilInternal::Output& C;
+
+        std::string _dllExport;
+        int _useWstring;
+        std::list<int> _useWstringHist;
+	bool _suppress;
     };
 
     class DelegateDVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        DelegateDVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
-
-        virtual bool visitUnitStart(const UnitPtr&);
-        virtual void visitUnitEnd(const UnitPtr&);
-        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:
-
-        ::IceUtilInternal::Output& H;
-        ::IceUtilInternal::Output& C;
-
-        std::string _dllExport;
-        int _useWstring;
-        std::list<int> _useWstringHist;
+	    DelegateDVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+
+        virtual bool visitUnitStart(const UnitPtr&);
+        virtual void visitUnitEnd(const UnitPtr&);
+        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:
+
+        ::IceUtilInternal::Output& H;
+        ::IceUtilInternal::Output& C;
+
+        std::string _dllExport;
+        int _useWstring;
+        std::list<int> _useWstringHist;
+	bool _suppress;
     };
 
     class ObjectDeclVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        ObjectDeclVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+	    ObjectDeclVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
@@ -237,13 +245,14 @@
         ::IceUtilInternal::Output& C;
 
         std::string _dllExport;
+	bool _suppress;
     };
 
     class ObjectVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        ObjectVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+	    ObjectVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
@@ -270,35 +279,37 @@
         bool _doneStaticSymbol;
         int _useWstring;
         std::list<int> _useWstringHist;
+	bool _suppress;
     };
 
     class AsyncCallbackVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        AsyncCallbackVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
-
-        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:
-
-        ::IceUtilInternal::Output& H;
-        ::IceUtilInternal::Output& C;
-
-        std::string _dllExport;
-        int _useWstring;
-        std::list<int> _useWstringHist;
+	    AsyncCallbackVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, 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:
+
+        ::IceUtilInternal::Output& H;
+        ::IceUtilInternal::Output& C;
+
+        std::string _dllExport;
+        int _useWstring;
+        std::list<int> _useWstringHist;
+	bool _suppress;
     };
 
     class AsyncCallbackTemplateVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        AsyncCallbackTemplateVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+	    AsyncCallbackTemplateVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
 
         virtual bool visitUnitStart(const UnitPtr&);
         virtual void visitUnitEnd(const UnitPtr&);
@@ -318,6 +329,7 @@
         std::string _dllExport;
         int _useWstring;
         std::list<int> _useWstringHist;
+	bool _suppress;
     };
 
     class IceInternalVisitor : private ::IceUtil::noncopyable, public ParserVisitor
@@ -343,7 +355,7 @@
     {
     public:
 
-        HandleVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+	    HandleVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool, bool);
 
         virtual bool visitModuleStart(const ModulePtr&);
         virtual void visitModuleEnd(const ModulePtr&);
@@ -357,26 +369,29 @@
 
         std::string _dllExport;
         bool _stream;
+	bool _suppress;
     };
 
     class ImplVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        ImplVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
-
-        virtual bool visitModuleStart(const ModulePtr&);
-        virtual void visitModuleEnd(const ModulePtr&);
-        virtual bool visitClassDefStart(const ClassDefPtr&);
-
-    private:
-
-        ::IceUtilInternal::Output& H;
-        ::IceUtilInternal::Output& C;
-
-        std::string _dllExport;
-        int _useWstring;
-        std::list<int> _useWstringHist;
+	    ImplVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+
+        virtual bool visitModuleStart(const ModulePtr&);
+        virtual void visitModuleEnd(const ModulePtr&);
+        virtual bool visitClassDefStart(const ClassDefPtr&);
+
+    private:
+
+        ::IceUtilInternal::Output& H;
+        ::IceUtilInternal::Output& C;
+
+        std::string _dllExport;
+        int _useWstring;
+        std::list<int> _useWstringHist;
+
+	bool _suppress;
 
         //
         // Generate code to emit a local variable declaration and initialize it
@@ -394,46 +409,50 @@
     {
     public:
 
-        AsyncVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
-
-        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:
-
-        ::IceUtilInternal::Output& H;
-        ::IceUtilInternal::Output& C;
-
-        std::string _dllExport;
-        int _useWstring;
-        std::list<int> _useWstringHist;
+	    AsyncVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, 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:
+
+        ::IceUtilInternal::Output& H;
+        ::IceUtilInternal::Output& C;
+
+        std::string _dllExport;
+        int _useWstring;
+        std::list<int> _useWstringHist;
+
+	bool _suppress;
     };
 
     class AsyncImplVisitor : private ::IceUtil::noncopyable, public ParserVisitor
     {
     public:
 
-        AsyncImplVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
-
-        virtual bool visitUnitStart(const UnitPtr&);
-        virtual void visitUnitEnd(const UnitPtr&);
-        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:
-
-        ::IceUtilInternal::Output& H;
-        ::IceUtilInternal::Output& C;
-
-        std::string _dllExport;
-        int _useWstring;
-        std::list<int> _useWstringHist;
+	    AsyncImplVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
+
+        virtual bool visitUnitStart(const UnitPtr&);
+        virtual void visitUnitEnd(const UnitPtr&);
+        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:
+
+        ::IceUtilInternal::Output& H;
+        ::IceUtilInternal::Output& C;
+
+        std::string _dllExport;
+        int _useWstring;
+        std::list<int> _useWstringHist;
+
+	bool _suppress;
     };
     
     class StreamVisitor : private ::IceUtil::noncopyable, public ParserVisitor

Modified: ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Main.cpp
URL: https://origsvn.digium.com/svn-view/hydra/ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Main.cpp?view=diff&rev=646&r1=645&r2=646
==============================================================================
--- ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Main.cpp (original)
+++ ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Main.cpp Fri May 28 12:04:52 2010
@@ -78,6 +78,7 @@
         "--ice                    Permit `Ice' prefix (for building Ice source code only)\n"
         "--checksum               Generate checksums for Slice definitions.\n"
         "--stream                 Generate marshaling support for public stream API.\n"
+	"--suppress               Suppress tagged modules from being written.\n"
         ;
 }
 
@@ -103,6 +104,7 @@
     opts.addOpt("", "ice");
     opts.addOpt("", "checksum");
     opts.addOpt("", "stream");
+    opts.addOpt("", "suppress");
 
     vector<string> args;
     try
@@ -173,6 +175,8 @@
     bool checksum = opts.isSet("checksum");
 
     bool stream = opts.isSet("stream");
+
+    bool suppress = opts.isSet("suppress");
 
     if(args.empty())
     {
@@ -262,7 +266,7 @@
                     try
                     {
                         Gen gen(icecpp->getBaseName(), headerExtension, sourceExtension, extraHeaders, include,
-                                includePaths, dllExport, output, impl, checksum, stream, ice);
+                                includePaths, dllExport, output, impl, checksum, stream, ice, suppress);
                         gen.generate(u);
                     }
                     catch(const Slice::FileException& ex)





More information about the asterisk-scf-commits mailing list