Skip to content

Commit

Permalink
Add InterfaceDef/Decl to the Slice Parser (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier authored Jan 9, 2024
1 parent edbf664 commit 01d3b24
Show file tree
Hide file tree
Showing 311 changed files with 18,249 additions and 23,193 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG-3.8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
The entries below contain brief descriptions of the changes in each release, in no particular order. Some of the
entries reflect significant new additions, while others represent minor corrections. Although this list is not a
comprehensive report of every change we made in a release, it does provide details on the changes we feel Ice users
might need to be aware of.

We recommend that you use the release notes as a guide for migrating your applications to this release, and the manual
for complete details on a particular aspect of Ice.

# Changes in Ice 3.8.0

These are the changes since the Ice 3.7.10 release in [CHANGELOG-3.7.md](./CHANGELOG-3.7.md).

## Slice Language Changes

- Removed local Slice. `local` is no longer a Slice keyword.

- Slice classes can no longer define operations or implement interfaces, and `implements` is no longer a Slice keyword.
This feature has been deprecated since Ice 3.7.

- Slice classes no longer represent remote Ice objects; the syntax `MyClass*` (a proxy to a class) is now invalid.

- An interface can no longer be used as a type This feature, known as "interface by value", has been deprecated since
Ice 3.7. You can still define proxies with the usual syntax, `Greeter*`, where `Greeter` represents an interface.

## Ice Service Changes

- The implementations of Glacier2, IceGrid, IceStorm and IcePatch2 were updated to use the new C++ mapping.
77 changes: 12 additions & 65 deletions cpp/src/Slice/CPlusPlusUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,14 +690,7 @@ Slice::typeToString(const TypePtr& type, const string& scope, const StringList&
{
if(cpp11)
{
if(cl->isInterface())
{
return getUnqualified(cpp11BuiltinTable[Builtin::KindValue], scope);
}
else
{
return "::std::shared_ptr<" + getUnqualified(cl->scoped(), scope) + ">";
}
return "::std::shared_ptr<" + getUnqualified(cl->scoped(), scope) + ">";
}
else
{
Expand All @@ -721,28 +714,16 @@ Slice::typeToString(const TypePtr& type, const string& scope, const StringList&
}
}

ProxyPtr proxy = ProxyPtr::dynamicCast(type);
InterfaceDeclPtr proxy = InterfaceDeclPtr::dynamicCast(type);
if(proxy)
{
if(cpp11)
{
ClassDefPtr def = proxy->_class()->definition();
//
// Classes without operations map to the base
// proxy class shared_ptr<Ice::ObjectPrx>
//
if(!def || def->isAbstract())
{
return "::std::shared_ptr<" + getUnqualified(fixKwd(proxy->_class()->scoped() + "Prx"), scope) + ">";
}
else
{
return getUnqualified(cpp11BuiltinTable[Builtin::KindObjectProxy], scope);
}
return "::std::shared_ptr<" + getUnqualified(fixKwd(proxy->scoped() + "Prx"), scope) + ">";
}
else
{
return getUnqualified(fixKwd(proxy->_class()->scoped() + "Prx"), scope);
return getUnqualified(fixKwd(proxy->scoped() + "Prx"), scope);
}
}

Expand Down Expand Up @@ -869,14 +850,7 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const string& scope
{
if(cpp11)
{
if(cl->isInterface())
{
return getUnqualified(cpp11InputBuiltinTable[Builtin::KindValue], scope);
}
else
{
return "const ::std::shared_ptr<" + getUnqualified(fixKwd(cl->scoped()), scope) + ">&";
}
return "const ::std::shared_ptr<" + getUnqualified(fixKwd(cl->scoped()), scope) + ">&";
}
else
{
Expand Down Expand Up @@ -904,24 +878,16 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const string& scope
}
}

ProxyPtr proxy = ProxyPtr::dynamicCast(type);
InterfaceDeclPtr proxy = InterfaceDeclPtr::dynamicCast(type);
if(proxy)
{
if(cpp11)
{
ClassDefPtr def = proxy->_class()->definition();
if(def && !def->isInterface() && def->allOperations().empty())
{
return getUnqualified(cpp11InputBuiltinTable[Builtin::KindObjectProxy], scope);
}
else
{
return "const ::std::shared_ptr<" + getUnqualified(fixKwd(proxy->_class()->scoped() + "Prx"), scope) + ">&";
}
return "const ::std::shared_ptr<" + getUnqualified(fixKwd(proxy->scoped() + "Prx"), scope) + ">&";
}
else
{
return "const " + getUnqualified(fixKwd(proxy->_class()->scoped() + "Prx"), scope) + "&";
return "const " + getUnqualified(fixKwd(proxy->scoped() + "Prx"), scope) + "&";
}
}

Expand Down Expand Up @@ -1016,14 +982,7 @@ Slice::outputTypeToString(const TypePtr& type, bool optional, const string& scop
{
if(cpp11)
{
if(cl->isInterface())
{
return getUnqualified(cpp11OutputBuiltinTable[Builtin::KindValue], scope);
}
else
{
return "::std::shared_ptr<" + getUnqualified(fixKwd(cl->scoped()), scope) + ">&";
}
return "::std::shared_ptr<" + getUnqualified(fixKwd(cl->scoped()), scope) + ">&";
}
else
{
Expand All @@ -1044,28 +1003,16 @@ Slice::outputTypeToString(const TypePtr& type, bool optional, const string& scop
}
}

ProxyPtr proxy = ProxyPtr::dynamicCast(type);
InterfaceDeclPtr proxy = InterfaceDeclPtr::dynamicCast(type);
if(proxy)
{
if(cpp11)
{
ClassDefPtr def = proxy->_class()->definition();
//
// Classes without operations map to the base
// proxy class shared_ptr<Ice::ObjectPrx>
//
if(def && !def->isInterface() && def->allOperations().empty())
{
return getUnqualified(cpp11OutputBuiltinTable[Builtin::KindObjectProxy], scope);
}
else
{
return "::std::shared_ptr<" + getUnqualified(fixKwd(proxy->_class()->scoped() + "Prx"), scope) + ">&";
}
return "::std::shared_ptr<" + getUnqualified(fixKwd(proxy->scoped() + "Prx"), scope) + ">&";
}
else
{
return getUnqualified(fixKwd(proxy->_class()->scoped() + "Prx&"), scope);
return getUnqualified(fixKwd(proxy->scoped() + "Prx&"), scope);
}
}

Expand Down
Loading

0 comments on commit 01d3b24

Please sign in to comment.