[hydra-commits] file: branch ice/slice-translator-versioning r648 - /ice/branches/slice-trans...
SVN commits to the Hydra project
hydra-commits at lists.digium.com
Tue Jun 1 10:46:44 CDT 2010
Author: file
Date: Tue Jun 1 10:46:43 2010
New Revision: 648
URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=648
Log:
Add suppressing to some of the scope usage, this is not yet complete though.
Modified:
ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp
ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.h
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=648&r1=647&r2=648
==============================================================================
--- ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp (original)
+++ ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.cpp Tue Jun 1 10:46:43 2010
@@ -25,6 +25,40 @@
using namespace Slice;
using namespace IceUtil;
using namespace IceUtilInternal;
+
+static string
+suppressedflattenedScope(const ContainerPtr& cp, string flattenedScope, bool _suppress)
+{
+ string suppressed_scope = flattenedScope;
+
+ for (ContainedPtr contained = ContainedPtr::dynamicCast(cp); contained; contained = ContainedPtr::dynamicCast(contained->container())) {
+ ModulePtr mod = ModulePtr::dynamicCast(contained);
+ if (mod && mod->hasMetaData("suppress") && _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
+suppressedscoped(const ContainerPtr& cp, string scope, bool _suppress)
+{
+ string suppressed_scope = scope;
+
+ for (ContainedPtr contained = ContainedPtr::dynamicCast(cp); contained; contained = ContainedPtr::dynamicCast(contained->container())) {
+ ModulePtr mod = ModulePtr::dynamicCast(contained);
+ if (mod && mod->hasMetaData("suppress") && _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
getDeprecateSymbol(const ContainedPtr& p1, const ContainedPtr& p2)
@@ -407,7 +441,7 @@
ObjectDeclVisitor objectDeclVisitor(H, C, _dllExport, _suppress);
p->visit(&objectDeclVisitor, false);
- IceInternalVisitor iceInternalVisitor(H, C, _dllExport);
+ IceInternalVisitor iceInternalVisitor(H, C, _dllExport, _suppress);
p->visit(&iceInternalVisitor, false);
HandleVisitor handleVisitor(H, C, _dllExport, _stream, _suppress);
@@ -448,7 +482,7 @@
if(_stream)
{
- StreamVisitor streamVistor(H, C);
+ StreamVisitor streamVistor(H, C, _suppress);
p->visit(&streamVistor, false);
}
@@ -593,7 +627,7 @@
_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
string name = fixKwd(p->name());
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
ExceptionPtr base = p->base();
DataMemberList dataMembers = p->dataMembers();
DataMemberList allDataMembers = p->allDataMembers();
@@ -635,7 +669,7 @@
}
else
{
- H << fixKwd(base->scoped());
+ H << fixKwd(suppressedscoped(base->container(), base->scoped(), _suppress));
}
H.restoreIndent();
H << sb;
@@ -760,9 +794,9 @@
H << nl << "virtual ::std::string ice_name() const;";
- string flatName = p->flattenedScope() + p->name() + "_name";
-
- C << sp << nl << "static const char* " << flatName << " = \"" << p->scoped().substr(2) << "\";";
+ string flatName = suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name() + "_name";
+
+ C << sp << nl << "static const char* " << flatName << " = \"" << suppressedscoped(p->container(), p->scoped(), _suppress).substr(2) << "\";";
C << sp << nl << "::std::string" << nl << scoped.substr(2) << "::ice_name() const";
C << sb;
C << nl << "return " << flatName << ';';
@@ -800,8 +834,8 @@
Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
{
string name = fixKwd(p->name());
- string scope = fixKwd(p->scope());
- string scoped = fixKwd(p->scoped());
+ string scope = fixKwd(suppressedscoped(p->container(), p->scope(), _suppress));
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
DataMemberList dataMembers = p->dataMembers();
DataMemberList::const_iterator q;
@@ -826,7 +860,7 @@
C << sp << nl << "void" << nl << scoped.substr(2) << "::__write(::IceInternal::BasicStream* __os) const";
C << sb;
- C << nl << "__os->write(::std::string(\"" << p->scoped() << "\"), false);";
+ C << nl << "__os->write(::std::string(\"" << suppressedscoped(p->container(), p->scoped(), _suppress) << "\"), false);";
C << nl << "__os->startWriteSlice();";
for(q = dataMembers.begin(); q != dataMembers.end(); ++q)
{
@@ -868,7 +902,7 @@
C << nl << "void" << nl << scoped.substr(2)
<< "::__write(const ::Ice::OutputStreamPtr& __outS) const";
C << sb;
- C << nl << "__outS->write(::std::string(\"" << p->scoped() << "\"));";
+ C << nl << "__outS->write(::std::string(\"" << suppressedscoped(p->container(), p->scoped(), _suppress) << "\"));";
C << nl << "__outS->startSlice();";
for(q = dataMembers.begin(); q != dataMembers.end(); ++q)
{
@@ -949,7 +983,7 @@
}
}
- factoryName = "__F" + p->flattenedScope() + p->name();
+ factoryName = "__F" + suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name();
C << sp << nl << "struct " << factoryName << " : public ::IceInternal::UserExceptionFactory";
C << sb;
@@ -976,18 +1010,18 @@
C.inc();
C << sp << nl << factoryName << "__Init()";
C << sb;
- C << nl << "::IceInternal::factoryTable->addExceptionFactory(\"" << p->scoped() << "\", " << scoped
+ C << nl << "::IceInternal::factoryTable->addExceptionFactory(\"" << suppressedscoped(p->container(), p->scoped(), _suppress) << "\", " << scoped
<< "::ice_factory());";
C << eb;
C << sp << nl << "~" << factoryName << "__Init()";
C << sb;
- C << nl << "::IceInternal::factoryTable->removeExceptionFactory(\"" << p->scoped() << "\");";
+ C << nl << "::IceInternal::factoryTable->removeExceptionFactory(\"" << suppressedscoped(p->container(), p->scoped(), _suppress) << "\");";
C << eb;
C << eb << ';';
C << sp << nl << "static " << factoryName << "__Init "<< factoryName << "__i;";
C << sp << nl << "#ifdef __APPLE__";
- string initfuncname = "__F" + p->flattenedScope() + p->name() + "__initializer";
+ string initfuncname = "__F" + suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name() + "__initializer";
C << nl << "extern \"C\" { void " << initfuncname << "() {} }";
C << nl << "#endif";
}
@@ -1030,7 +1064,7 @@
{
H << nl << name << "();";
- C << sp << nl << fixKwd(p->scoped()).substr(2) << "::" << fixKwd(p->name()) << "() :";
+ C << sp << nl << fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress)).substr(2) << "::" << fixKwd(p->name()) << "() :";
C.inc();
writeDataMemberInitializers(C, dataMembers, _useWstring);
C.dec();
@@ -1061,7 +1095,7 @@
}
H << name << spar << types << epar << ';';
- C << sp << nl << fixKwd(p->scoped()).substr(2) << "::"
+ C << sp << nl << fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress)).substr(2) << "::"
<< fixKwd(p->name()) << spar << paramDecls << epar << " :";
C.inc();
@@ -1088,7 +1122,7 @@
{
H << nl << name << "();";
- C << sp << nl << fixKwd(p->scoped()).substr(2) << "::" << fixKwd(p->name()) << "() :";
+ C << sp << nl << fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress)).substr(2) << "::" << fixKwd(p->name()) << "() :";
C.inc();
writeDataMemberInitializers(C, dataMembers, _useWstring);
C.dec();
@@ -1104,8 +1138,8 @@
Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p)
{
string name = fixKwd(p->name());
- string scoped = fixKwd(p->scoped());
- string scope = fixKwd(p->scope());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
+ string scope = fixKwd(suppressedscoped(p->container(), p->scope(), _suppress));
DataMemberList dataMembers = p->dataMembers();
DataMemberList::const_iterator q;
@@ -1270,13 +1304,13 @@
C << nl << "#if !defined(_MSC_VER) || (_MSC_VER >= 1300)";
C.restoreIndent();
C << nl << "void" << nl << scope.substr(2) << "ice_write" << p->name()
- << "(const ::Ice::OutputStreamPtr& __outS, const " << fixKwd(p->scoped() + "Ptr") << "& __v)";
+ << "(const ::Ice::OutputStreamPtr& __outS, const " << fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress) + "Ptr") << "& __v)";
C << sb;
C << nl << "__v->ice_write(__outS);";
C << eb;
C << sp << nl << "void" << nl << scope.substr(2) << "ice_read" << p->name()
- << "(const ::Ice::InputStreamPtr& __inS, " << fixKwd(p->scoped() + "Ptr") << "& __v)";
+ << "(const ::Ice::InputStreamPtr& __inS, " << fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress) + "Ptr") << "& __v)";
C << sb;
C << nl << "__v->ice_read(__inS);";
C << eb;
@@ -1380,8 +1414,8 @@
BuiltinPtr builtin = BuiltinPtr::dynamicCast(type);
if(!p->isLocal())
{
- string scoped = fixKwd(p->scoped());
- string scope = fixKwd(p->scope());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
+ string scope = fixKwd(suppressedscoped(p->container(), p->scope(), _suppress));
if(protobuf || !seqType.empty())
{
@@ -1635,8 +1669,8 @@
if(!p->isLocal())
{
- string scoped = fixKwd(p->scoped());
- string scope = fixKwd(p->scope());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
+ string scope = fixKwd(suppressedscoped(p->container(), p->scope(), _suppress));
H << nl << _dllExport << "void __write" << name << "(::IceInternal::BasicStream*, const " << name << "&);";
H << nl << _dllExport << "void __read" << name << "(::IceInternal::BasicStream*, " << name << "&);";
@@ -1740,8 +1774,8 @@
if(!p->isLocal())
{
- string scoped = fixKwd(p->scoped());
- string scope = fixKwd(p->scope());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
+ string scope = fixKwd(suppressedscoped(p->container(), p->scope(), _suppress));
size_t sz = enumerators.size();
assert(sz <= 0x7fffffff); // 64-bit enums are not supported
@@ -1842,7 +1876,7 @@
C.zeroIndent();
C << nl << "#else";
C.restoreIndent();
- C << nl << (base ? fixKwd(base->scoped()) : string(isLocal ? "::Ice::LocalException" : "::Ice::UserException"))
+ C << nl << (base ? fixKwd(suppressedscoped(base->container(), base->scoped(), _suppress)) : string(isLocal ? "::Ice::LocalException" : "::Ice::UserException"))
<< call;
C.zeroIndent();
C << nl << "#endif";
@@ -1975,7 +2009,7 @@
_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
string name = fixKwd(p->name());
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
ClassList bases = p->bases();
H << sp << nl << "class " << name << " : ";
@@ -2022,8 +2056,8 @@
Slice::Gen::ProxyVisitor::visitClassDefEnd(const ClassDefPtr& p)
{
string name = fixKwd(p->name());
- string scoped = fixKwd(p->scoped());
- string scope = fixKwd(p->scope());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
+ string scope = fixKwd(suppressedscoped(p->container(), p->scope(), _suppress));
//
// "Overwrite" various non-virtual functions in ::IceProxy::Ice::Object that return an ObjectPrx and
@@ -2372,8 +2406,8 @@
Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
{
string name = p->name();
- string scoped = fixKwd(p->scoped());
- string scope = fixKwd(p->scope());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
+ string scope = fixKwd(suppressedscoped(p->container(), p->scope(), _suppress));
TypePtr ret = p->returnType();
string retS = returnTypeToString(ret, p->getMetaData(), _useWstring | TypeContextAMIEnd);
@@ -2552,7 +2586,7 @@
if(p->returnsData())
{
- C << nl << "__checkTwowayOnly(" << p->flattenedScope() + p->name() + "_name);";
+ C << nl << "__checkTwowayOnly(" << suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name() + "_name);";
}
C << nl << "__delBase = __getDelegate(false);";
C << nl << "::IceDelegate" << thisPointer << " __del = dynamic_cast< ::IceDelegate"
@@ -2590,7 +2624,7 @@
<< "const ::Ice::Context* __ctx" << "const ::IceInternal::CallbackBasePtr& __del"
<< "const ::Ice::LocalObjectPtr& __cookie" << epar;
C << sb;
- string flatName = p->flattenedScope() + name + "_name";
+ string flatName = suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + name + "_name";
if(p->returnsData())
{
C << nl << "__checkAsyncTwowayOnly(" << flatName << ");";
@@ -3072,7 +3106,7 @@
_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
string name = fixKwd(p->name());
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
ClassList bases = p->bases();
H << sp << nl << "class " << _dllExport << name << " : ";
@@ -3115,7 +3149,7 @@
Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p)
{
string name = fixKwd(p->name());
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
TypePtr ret = p->returnType();
string retS = returnTypeToString(ret, p->getMetaData(), _useWstring);
@@ -3151,7 +3185,7 @@
params.push_back("const ::Ice::Context*");
paramsDecl.push_back("const ::Ice::Context* __context");
- string flatName = p->flattenedScope() + p->name() + "_name";
+ string flatName = suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name() + "_name";
H << sp << nl << "virtual " << retS << ' ' << name << spar << params << epar << ';';
C << sp << nl << retS << nl << "IceDelegateM" << scoped << spar << paramsDecl << epar;
@@ -3350,7 +3384,7 @@
_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
string name = fixKwd(p->name());
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
ClassList bases = p->bases();
H << sp << nl << "class " << _dllExport << name << " : ";
@@ -3393,7 +3427,7 @@
Slice::Gen::DelegateDVisitor::visitOperation(const OperationPtr& p)
{
string name = fixKwd(p->name());
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
TypePtr ret = p->returnType();
string retS = returnTypeToString(ret, p->getMetaData(), _useWstring);
@@ -3565,7 +3599,7 @@
C << eb << ";";
C << nl << nl << "::Ice::Current __current;";
- C << nl << "__initCurrent(__current, " << p->flattenedScope() + p->name() + "_name, "
+ C << nl << "__initCurrent(__current, " << suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name() + "_name, "
<< operationModeToString(p->sendMode()) << ", __context);";
if(ret)
@@ -3683,7 +3717,7 @@
void
Slice::Gen::ObjectDeclVisitor::visitOperation(const OperationPtr& p)
{
- string flatName = p->flattenedScope() + p->name() + "_name";
+ string flatName = suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name() + "_name";
C << sp << nl << "static const ::std::string " << flatName << " = \"" << p->name() << "\";";
}
@@ -3728,7 +3762,7 @@
_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
string name = fixKwd(p->name());
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
ClassList bases = p->bases();
ClassDefPtr base;
if(!bases.empty() && !bases.front()->isInterface())
@@ -3964,7 +3998,7 @@
C << sb;
if(!p->isAbstract())
{
- C << nl << fixKwd(p->scope()) << p->name() << "Ptr __p = new " << scoped << "(*this);";
+ C << nl << fixKwd(suppressedscoped(p->container(), p->scope(), _suppress)) << p->name() << "Ptr __p = new " << scoped << "(*this);";
C << nl << "return __p;";
}
else
@@ -4009,7 +4043,7 @@
H << sp;
}
- string flatName = p->flattenedScope() + p->name() + "_ids";
+ string flatName = suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name() + "_ids";
C << sp;
C << nl << "static const ::std::string " << flatName << '[' << ids.size() << "] =";
@@ -4063,8 +4097,8 @@
void
Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
{
- string scoped = fixKwd(p->scoped());
- string scope = fixKwd(p->scope());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
+ string scope = fixKwd(suppressedscoped(p->container(), p->scope(), _suppress));
if(!p->isLocal())
{
@@ -4102,7 +4136,7 @@
H << nl
<< "virtual ::Ice::DispatchStatus __dispatch(::IceInternal::Incoming&, const ::Ice::Current&);";
- string flatName = p->flattenedScope() + p->name() + "_all";
+ string flatName = suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name() + "_all";
C << sp;
C << nl << "static ::std::string " << flatName << "[] =";
C << sb;
@@ -4167,7 +4201,7 @@
H << nl
<< "virtual ::Ice::Int ice_operationAttributes(const ::std::string&) const;";
- string opAttrFlatName = p->flattenedScope() + p->name() + "_operationAttributes";
+ string opAttrFlatName = suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name() + "_operationAttributes";
C << sp;
C << nl << "static int " << opAttrFlatName << "[] = ";
@@ -4330,7 +4364,7 @@
{
H << sp << nl << "static const ::Ice::ObjectFactoryPtr& ice_factory();";
- string factoryName = "__F" + p->flattenedScope() + p->name();
+ string factoryName = "__F" + suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name();
C << sp;
C << nl << "class " << factoryName << " : public ::Ice::ObjectFactory";
C << sb;
@@ -4376,7 +4410,7 @@
C << sp;
C << nl << "static " << factoryName << "__Init " << factoryName << "__i;";
C << sp << nl << "#ifdef __APPLE__";
- std::string initfuncname = "__F" + p->flattenedScope() + p->name() + "__initializer";
+ std::string initfuncname = "__F" + suppressedflattenedScope(p->container(), p->flattenedScope(), _suppress) + p->name() + "__initializer";
C << nl << "extern \"C\" { void " << initfuncname << "() {} }";
C << nl << "#endif";
}
@@ -4535,8 +4569,8 @@
Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p)
{
string name = p->name();
- string scoped = fixKwd(p->scoped());
- string scope = fixKwd(p->scope());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
+ string scope = fixKwd(suppressedscoped(p->container(), p->scope(), _suppress));
TypePtr ret = p->returnType();
string retS = returnTypeToString(ret, p->getMetaData(), _useWstring);
@@ -4820,7 +4854,7 @@
void
Slice::Gen::ObjectVisitor::emitGCFunctions(const ClassDefPtr& p)
{
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
ClassList bases = p->bases();
DataMemberList dataMembers = p->dataMembers();
@@ -5082,7 +5116,7 @@
C.zeroIndent();
C << nl << "#else";
C.restoreIndent();
- C << nl << fixKwd(p->scoped()) << upcall;
+ C << nl << fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress)) << upcall;
C.zeroIndent();
C << nl << "#endif";
C << nl;
@@ -5107,7 +5141,7 @@
if(!allDataMembers.empty())
{
- C << sp << nl << fixKwd(p->scoped()).substr(2) << "::" << fixKwd(p->name())
+ C << sp << nl << fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress)).substr(2) << "::" << fixKwd(p->name())
<< spar << allParamDecls << epar << " :";
C.inc();
@@ -5156,7 +5190,7 @@
C.zeroIndent();
C << nl << "#else";
C.restoreIndent();
- C << nl << (base ? fixKwd(base->scoped()) : string("::Ice::Object")) << call;
+ C << nl << (base ? fixKwd(suppressedscoped(base->container(), base->scoped(), _suppress)) : string("::Ice::Object")) << call;
C.zeroIndent();
C << nl << "#endif";
C.restoreIndent();
@@ -5589,8 +5623,8 @@
}
}
-Slice::Gen::IceInternalVisitor::IceInternalVisitor(Output& h, Output& c, const string& dllExport) :
- H(h), C(c), _dllExport(dllExport)
+Slice::Gen::IceInternalVisitor::IceInternalVisitor(Output& h, Output& c, const string& dllExport, bool suppress) :
+ H(h), C(c), _dllExport(dllExport), _suppress(suppress)
{
}
@@ -5618,7 +5652,7 @@
void
Slice::Gen::IceInternalVisitor::visitClassDecl(const ClassDeclPtr& p)
{
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
H << sp;
@@ -5636,7 +5670,7 @@
bool
Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p)
{
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
C << sp;
if(!p->isLocal())
@@ -5695,7 +5729,7 @@
Slice::Gen::HandleVisitor::visitClassDecl(const ClassDeclPtr& p)
{
string name = p->name();
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
H << sp;
H << nl << "typedef ::IceInternal::Handle< " << scoped << "> " << name << "Ptr;";
@@ -5735,8 +5769,8 @@
if(!p->isLocal())
{
string name = p->name();
- string scoped = fixKwd(p->scoped());
- string scope = fixKwd(p->scope());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
+ string scope = fixKwd(suppressedscoped(p->container(), p->scope(), _suppress));
string factory;
string type;
@@ -6015,7 +6049,7 @@
_useWstring = setUseWstring(p, _useWstringHist, _useWstring);
string name = p->name();
- string scope = fixKwd(p->scope());
+ string scope = fixKwd(suppressedscoped(p->container(), p->scope(), _suppress));
string cls = scope.substr(2) + name + "I";
string classScopedAMD = scope + "AMD_" + name;
ClassList bases = p->bases();
@@ -6661,8 +6695,8 @@
}
}
-Slice::Gen::StreamVisitor::StreamVisitor(Output& h, Output& c) :
- H(h), C(c)
+Slice::Gen::StreamVisitor::StreamVisitor(Output& h, Output& c, bool suppress) :
+ H(h), C(c), _suppress(suppress)
{
}
@@ -6700,7 +6734,7 @@
{
if(!p->isLocal())
{
- string scoped = p->scoped();
+ string scoped = suppressedscoped(p->container(), p->scoped(), _suppress);
H << nl << "template<>";
H << nl << "struct StreamTrait< " << fixKwd(scoped) << ">";
H << sb;
@@ -6721,7 +6755,7 @@
if(!p->isLocal())
{
bool classMetaData = findMetaData(p->getMetaData(), false) == "class";
- string scoped = p->scoped();
+ string scoped = suppressedscoped(p->container(), p->scoped(), _suppress);
H << nl << "template<>";
if(classMetaData)
{
@@ -6754,7 +6788,7 @@
void
Slice::Gen::StreamVisitor::visitEnum(const EnumPtr& p)
{
- string scoped = fixKwd(p->scoped());
+ string scoped = fixKwd(suppressedscoped(p->container(), p->scoped(), _suppress));
H << nl << "template<>";
H << nl << "struct StreamTrait< " << scoped << ">";
H << sb;
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=648&r1=647&r2=648
==============================================================================
--- ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.h (original)
+++ ice/branches/slice-translator-versioning/cpp/src/slice2cpp/Gen.h Tue Jun 1 10:46:43 2010
@@ -336,7 +336,7 @@
{
public:
- IceInternalVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&);
+ IceInternalVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, const std::string&, bool);
virtual bool visitUnitStart(const UnitPtr&);
virtual void visitUnitEnd(const UnitPtr&);
@@ -349,6 +349,7 @@
::IceUtilInternal::Output& C;
std::string _dllExport;
+ bool _suppress;
};
class HandleVisitor : private ::IceUtil::noncopyable, public ParserVisitor
@@ -459,7 +460,7 @@
{
public:
- StreamVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&);
+ StreamVisitor(::IceUtilInternal::Output&, ::IceUtilInternal::Output&, bool);
virtual bool visitModuleStart(const ModulePtr&);
virtual void visitModuleEnd(const ModulePtr&);
@@ -473,6 +474,7 @@
::IceUtilInternal::Output& H;
::IceUtilInternal::Output& C;
+ bool _suppress;
};
private:
More information about the asterisk-scf-commits
mailing list