diff options
author | Marc Laukien <marc@zeroc.com> | 2001-09-07 21:31:09 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-09-07 21:31:09 +0000 |
commit | 3bc54265fc832fbd3da9dd17cfda4f8f0e26874c (patch) | |
tree | 2f7a19e6f6127ae26b07a489e837b8d79b565b20 /cpp | |
parent | Started to add structs and maps (diff) | |
download | ice-3bc54265fc832fbd3da9dd17cfda4f8f0e26874c.tar.bz2 ice-3bc54265fc832fbd3da9dd17cfda4f8f0e26874c.tar.xz ice-3bc54265fc832fbd3da9dd17cfda4f8f0e26874c.zip |
sequence, dictionary
Diffstat (limited to 'cpp')
43 files changed, 703 insertions, 474 deletions
diff --git a/cpp/include/Slice/Parser.h b/cpp/include/Slice/Parser.h index c4a030b9ad9..660f5ba9992 100644 --- a/cpp/include/Slice/Parser.h +++ b/cpp/include/Slice/Parser.h @@ -39,8 +39,8 @@ class Proxy; class Struct; class Operation; class DataMember; -class Vector; -class Map; +class Sequence; +class Dictionary; class Enum; class Enumerator; class Native; @@ -79,10 +79,10 @@ void ICE_API incRef(::Slice::Operation*); void ICE_API decRef(::Slice::Operation*); void ICE_API incRef(::Slice::DataMember*); void ICE_API decRef(::Slice::DataMember*); -void ICE_API incRef(::Slice::Vector*); -void ICE_API decRef(::Slice::Vector*); -void ICE_API incRef(::Slice::Map*); -void ICE_API decRef(::Slice::Map*); +void ICE_API incRef(::Slice::Sequence*); +void ICE_API decRef(::Slice::Sequence*); +void ICE_API incRef(::Slice::Dictionary*); +void ICE_API decRef(::Slice::Dictionary*); void ICE_API incRef(::Slice::Enum*); void ICE_API decRef(::Slice::Enum*); void ICE_API incRef(::Slice::Enumerator*); @@ -111,8 +111,8 @@ typedef ::IceInternal::Handle<Proxy> ProxyPtr; typedef ::IceInternal::Handle<Struct> StructPtr; typedef ::IceInternal::Handle<Operation> OperationPtr; typedef ::IceInternal::Handle<DataMember> DataMemberPtr; -typedef ::IceInternal::Handle<Vector> VectorPtr; -typedef ::IceInternal::Handle<Map> MapPtr; +typedef ::IceInternal::Handle<Sequence> SequencePtr; +typedef ::IceInternal::Handle<Dictionary> DictionaryPtr; typedef ::IceInternal::Handle<Enum> EnumPtr; typedef ::IceInternal::Handle<Enumerator> EnumeratorPtr; typedef ::IceInternal::Handle<Native> NativePtr; @@ -131,8 +131,8 @@ typedef std::list<ContainedPtr> ContainedList; typedef std::list<ModulePtr> ModuleList; typedef std::list<ClassDefPtr> ClassList; typedef std::list<StructPtr> StructList; -typedef std::list<VectorPtr> VectorList; -typedef std::list<MapPtr> MapList; +typedef std::list<SequencePtr> SequenceList; +typedef std::list<DictionaryPtr> DictionaryList; typedef std::list<EnumPtr> EnumList; typedef std::list<NativePtr> NativeList; typedef std::list<OperationPtr> OperationList; @@ -158,8 +158,8 @@ public: virtual void visitStructEnd(const StructPtr&) { } virtual void visitOperation(const OperationPtr&) { } virtual void visitDataMember(const DataMemberPtr&) { } - virtual void visitVector(const VectorPtr&) { } - virtual void visitMap(const MapPtr&) { } + virtual void visitSequence(const SequencePtr&) { } + virtual void visitDictionary(const DictionaryPtr&) { } virtual void visitEnum(const EnumPtr&) { } virtual void visitNative(const NativePtr&) { } }; @@ -255,8 +255,8 @@ public: enum ContainedType { - ContainedTypeVector, - ContainedTypeMap, + ContainedTypeSequence, + ContainedTypeDictionary, ContainedTypeEnum, ContainedTypeEnumerator, ContainedTypeNative, @@ -295,8 +295,8 @@ public: ClassDefPtr createClassDef(const std::string&, bool, bool, const ClassList&); ClassDeclPtr createClassDecl(const std::string&, bool, bool); StructPtr createStruct(const std::string&); - VectorPtr createVector(const std::string&, const TypePtr&); - MapPtr createMap(const std::string&, const TypePtr&, const TypePtr&); + SequencePtr createSequence(const std::string&, const TypePtr&); + DictionaryPtr createDictionary(const std::string&, const TypePtr&, const TypePtr&); EnumPtr createEnum(const std::string&, const StringList&); EnumeratorPtr createEnumerator(const std::string&); NativePtr createNative(const std::string&); @@ -306,8 +306,8 @@ public: ModuleList modules(); ClassList classes(); StructList structs(); - VectorList vectors(); - MapList maps(); + SequenceList sequences(); + DictionaryList dictionaries(); EnumList enums(); NativeList natives(); int includeLevel(); @@ -505,10 +505,10 @@ protected: }; // ---------------------------------------------------------------------- -// Vector +// Sequence // ---------------------------------------------------------------------- -class ICE_API Vector : virtual public Constructed +class ICE_API Sequence : virtual public Constructed { public: @@ -518,17 +518,17 @@ public: protected: - Vector(const ContainerPtr&, const std::string&, const TypePtr&); + Sequence(const ContainerPtr&, const std::string&, const TypePtr&); friend class ICE_API Container; TypePtr _type; }; // ---------------------------------------------------------------------- -// Map +// Dictionary // ---------------------------------------------------------------------- -class ICE_API Map : virtual public Constructed +class ICE_API Dictionary : virtual public Constructed { public: @@ -539,7 +539,7 @@ public: protected: - Map(const ContainerPtr&, const std::string&, const TypePtr&, const TypePtr&); + Dictionary(const ContainerPtr&, const std::string&, const TypePtr&, const TypePtr&); friend class ICE_API Container; TypePtr _keyType; diff --git a/cpp/slice/IcePack/Admin.ice b/cpp/slice/IcePack/Admin.ice index 1d36f3a45c0..ea84a58c600 100644 --- a/cpp/slice/IcePack/Admin.ice +++ b/cpp/slice/IcePack/Admin.ice @@ -24,7 +24,7 @@ module IcePack * A vector of strings representing command line arguments. * **/ -vector<string> Args; +sequence<string> Args; /** * @@ -96,7 +96,7 @@ class ServerDescription * A vector of server descriptions. * **/ -vector<ServerDescription> ServerDescriptions; +sequence<ServerDescription> ServerDescriptions; /** * diff --git a/cpp/src/Slice/Grammer.y b/cpp/src/Slice/Grammer.y index 026daa19d42..30520b322a4 100644 --- a/cpp/src/Slice/Grammer.y +++ b/cpp/src/Slice/Grammer.y @@ -45,8 +45,8 @@ yyerror(const char* s) %token ICE_OBJECT %token ICE_LOCAL_OBJECT %token ICE_NATIVE -%token ICE_VECTOR -%token ICE_MAP +%token ICE_SEQUENCE +%token ICE_DICTIONARY %token ICE_ENUM %token ICE_NONMUTATING %token ICE_IDENTIFIER @@ -105,10 +105,10 @@ definition | native_def { } -| vector_def +| sequence_def { } -| map_def +| dictionary_def { } | enum_def @@ -706,27 +706,27 @@ native_def ; // ---------------------------------------------------------------------- -vector_def +sequence_def // ---------------------------------------------------------------------- -: ICE_VECTOR '<' type '>' ICE_IDENTIFIER +: ICE_SEQUENCE '<' type '>' ICE_IDENTIFIER { StringTokPtr ident = StringTokPtr::dynamicCast($5); TypePtr type = TypePtr::dynamicCast($3); ContainerPtr cont = unit->currentContainer(); - cont->createVector(ident->v, type); + cont->createSequence(ident->v, type); } ; // ---------------------------------------------------------------------- -map_def +dictionary_def // ---------------------------------------------------------------------- -: ICE_MAP '<' type ',' type '>' ICE_IDENTIFIER +: ICE_DICTIONARY '<' type ',' type '>' ICE_IDENTIFIER { StringTokPtr ident = StringTokPtr::dynamicCast($7); TypePtr keyType = TypePtr::dynamicCast($3); TypePtr valueType = TypePtr::dynamicCast($5); ContainerPtr cont = unit->currentContainer(); - cont->createMap(ident->v, keyType, valueType); + cont->createDictionary(ident->v, keyType, valueType); } ; diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index ac26565e3a2..5b655387fd1 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -49,10 +49,10 @@ void IceInternal::incRef(Operation* p) { p->__incRef(); } void IceInternal::decRef(Operation* p) { p->__decRef(); } void IceInternal::incRef(DataMember* p) { p->__incRef(); } void IceInternal::decRef(DataMember* p) { p->__decRef(); } -void IceInternal::incRef(Vector* p) { p->__incRef(); } -void IceInternal::decRef(Vector* p) { p->__decRef(); } -void IceInternal::incRef(Map* p) { p->__incRef(); } -void IceInternal::decRef(Map* p) { p->__decRef(); } +void IceInternal::incRef(Sequence* p) { p->__incRef(); } +void IceInternal::decRef(Sequence* p) { p->__decRef(); } +void IceInternal::incRef(Dictionary* p) { p->__incRef(); } +void IceInternal::decRef(Dictionary* p) { p->__decRef(); } void IceInternal::incRef(Enum* p) { p->__incRef(); } void IceInternal::decRef(Enum* p) { p->__decRef(); } void IceInternal::incRef(Enumerator* p) { p->__incRef(); } @@ -406,13 +406,13 @@ Slice::Container::createStruct(const string& name) return p; } -VectorPtr -Slice::Container::createVector(const string& name, const TypePtr& type) +SequencePtr +Slice::Container::createSequence(const string& name, const TypePtr& type) { ContainedList matches = _unit->findContents(thisScope() + name); if (!matches.empty()) { - VectorPtr p = VectorPtr::dynamicCast(matches.front()); + SequencePtr p = SequencePtr::dynamicCast(matches.front()); if (p) { if (_unit->ignRedefs()) @@ -420,7 +420,7 @@ Slice::Container::createVector(const string& name, const TypePtr& type) return p; } - string msg = "redefinition of vector `"; + string msg = "redefinition of sequence `"; msg += name; msg += "'"; _unit->error(msg); @@ -429,23 +429,23 @@ Slice::Container::createVector(const string& name, const TypePtr& type) string msg = "redefinition of `"; msg += name; - msg += "' as vector"; + msg += "' as sequence"; _unit->error(msg); return 0; } - VectorPtr p = new Vector(this, name, type); + SequencePtr p = new Sequence(this, name, type); _contents.push_back(p); return p; } -MapPtr -Slice::Container::createMap(const string& name, const TypePtr& keyType, const TypePtr& valueType) +DictionaryPtr +Slice::Container::createDictionary(const string& name, const TypePtr& keyType, const TypePtr& valueType) { ContainedList matches = _unit->findContents(thisScope() + name); if (!matches.empty()) { - MapPtr p = MapPtr::dynamicCast(matches.front()); + DictionaryPtr p = DictionaryPtr::dynamicCast(matches.front()); if (p) { if (_unit->ignRedefs()) @@ -453,7 +453,7 @@ Slice::Container::createMap(const string& name, const TypePtr& keyType, const Ty return p; } - string msg = "redefinition of map `"; + string msg = "redefinition of dictionary `"; msg += name; msg += "'"; _unit->error(msg); @@ -462,12 +462,12 @@ Slice::Container::createMap(const string& name, const TypePtr& keyType, const Ty string msg = "redefinition of `"; msg += name; - msg += "' as map"; + msg += "' as dictionary"; _unit->error(msg); return 0; } - MapPtr p = new Map(this, name, keyType, valueType); + DictionaryPtr p = new Dictionary(this, name, keyType, valueType); _contents.push_back(p); return p; } @@ -747,13 +747,13 @@ Slice::Container::structs() return result; } -VectorList -Slice::Container::vectors() +SequenceList +Slice::Container::sequences() { - VectorList result; + SequenceList result; for (ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) { - VectorPtr q = VectorPtr::dynamicCast(*p); + SequencePtr q = SequencePtr::dynamicCast(*p); if (q) { result.push_back(q); @@ -762,13 +762,13 @@ Slice::Container::vectors() return result; } -MapList -Slice::Container::maps() +DictionaryList +Slice::Container::dictionaries() { - MapList result; + DictionaryList result; for (ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) { - MapPtr q = MapPtr::dynamicCast(*p); + DictionaryPtr q = DictionaryPtr::dynamicCast(*p); if (q) { result.push_back(q); @@ -1647,28 +1647,28 @@ Slice::Native::Native(const ContainerPtr& container, const string& name) : } // ---------------------------------------------------------------------- -// Vector +// Sequence // ---------------------------------------------------------------------- TypePtr -Slice::Vector::type() +Slice::Sequence::type() { return _type; } Slice::Contained::ContainedType -Slice::Vector::containedType() +Slice::Sequence::containedType() { - return ContainedTypeVector; + return ContainedTypeSequence; } void -Slice::Vector::visit(ParserVisitor* visitor) +Slice::Sequence::visit(ParserVisitor* visitor) { - visitor->visitVector(this); + visitor->visitSequence(this); } -Slice::Vector::Vector(const ContainerPtr& container, const string& name, const TypePtr& type) : +Slice::Sequence::Sequence(const ContainerPtr& container, const string& name, const TypePtr& type) : Constructed(container, name), Type(container->unit()), Contained(container, name), @@ -1678,34 +1678,35 @@ Slice::Vector::Vector(const ContainerPtr& container, const string& name, const T } // ---------------------------------------------------------------------- -// Map +// Dictionary // ---------------------------------------------------------------------- TypePtr -Slice::Map::keyType() +Slice::Dictionary::keyType() { return _keyType; } TypePtr -Slice::Map::valueType() +Slice::Dictionary::valueType() { return _valueType; } Slice::Contained::ContainedType -Slice::Map::containedType() +Slice::Dictionary::containedType() { - return ContainedTypeMap; + return ContainedTypeDictionary; } void -Slice::Map::visit(ParserVisitor* visitor) +Slice::Dictionary::visit(ParserVisitor* visitor) { - visitor->visitMap(this); + visitor->visitDictionary(this); } -Slice::Map::Map(const ContainerPtr& container, const string& name, const TypePtr& keyType, const TypePtr& valueType) : +Slice::Dictionary::Dictionary(const ContainerPtr& container, const string& name, const TypePtr& keyType, + const TypePtr& valueType) : Constructed(container, name), Type(container->unit()), Contained(container, name), diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index bb4980ebc32..28ae3658b92 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -181,12 +181,12 @@ L [a-zA-Z_] return ICE_NATIVE; } -"vector" { - return ICE_VECTOR; +"sequence" { + return ICE_SEQUENCE; } -"map" { - return ICE_MAP; +"dictionary" { + return ICE_DICTIONARY; } "enum" { diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index bdd00d101c4..040da988a2c 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -280,11 +280,11 @@ Slice::Gen::TypesVisitor::visitModuleEnd(const ModulePtr& p) } void -Slice::Gen::TypesVisitor::visitVector(const VectorPtr& p) +Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) { string name = p->name(); - TypePtr subtype = p->type(); - string s = typeToString(subtype); + TypePtr type = p->type(); + string s = typeToString(type); if (s[0] == ':') { s.insert(0, " "); @@ -292,7 +292,7 @@ Slice::Gen::TypesVisitor::visitVector(const VectorPtr& p) H << sp; H << nl << "typedef ::std::vector<" << s << "> " << name << ';'; - BuiltinPtr builtin = BuiltinPtr::dynamicCast(subtype); + BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if (!builtin) { string scoped = p->scoped(); @@ -315,7 +315,7 @@ Slice::Gen::TypesVisitor::visitVector(const VectorPtr& p) C << nl << scoped << "::const_iterator p;"; C << nl << "for (p = v.begin(); p != v.end(); ++p)"; C << sb; - writeMarshalUnmarshalCode(C, subtype, "*p", true); + writeMarshalUnmarshalCode(C, type, "*p", true); C << eb; C << eb; C << sp; @@ -331,7 +331,7 @@ Slice::Gen::TypesVisitor::visitVector(const VectorPtr& p) C.zeroIndent(); C << nl << "#ifdef WIN32"; // STLBUG C.restoreIndent(); - C << nl << "v.push_back(" << typeToString(subtype) << "());"; + C << nl << "v.push_back(" << typeToString(type) << "());"; C.zeroIndent(); C << nl << "#else"; C.restoreIndent(); @@ -339,13 +339,67 @@ Slice::Gen::TypesVisitor::visitVector(const VectorPtr& p) C.zeroIndent(); C << nl << "#endif"; C.restoreIndent(); - writeMarshalUnmarshalCode(C, subtype, "v.back()", false); + writeMarshalUnmarshalCode(C, type, "v.back()", false); C << eb; C << eb; } } void +Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) +{ + string name = p->name(); + TypePtr keyType = p->keyType(); + TypePtr valueType = p->valueType(); + string ks = typeToString(keyType); + if (ks[0] == ':') + { + ks.insert(0, " "); + } + string vs = typeToString(valueType); + H << sp; + H << nl << "typedef ::std::map<" << ks << ", " << vs << "> " << name << ';'; + + string scoped = p->scoped(); + string scope = p->scope(); + if (scope.length()) + { + scope.erase(0, 2); + } + + H << sp; + H << nl << "class __U__" << name << " { };"; + H << nl << "void" << _dllExport << " __write(::IceInternal::Stream*, const " << name << "&, __U__" << name << ");"; + H << nl << "void" << _dllExport << " __read(::IceInternal::Stream*, " << name << "&, __U__" << name << ");"; + C << sp; + C << nl << "void" << nl << scope << "::__write(::IceInternal::Stream* __os, const " << scoped << "& v, ::" + << scope << "::__U__" << name << ')'; + C << sb; + C << nl << "__os->write(::Ice::Int(v.size()));"; + C << nl << scoped << "::const_iterator p;"; + C << nl << "for (p = v.begin(); p != v.end(); ++p)"; + C << sb; + writeMarshalUnmarshalCode(C, keyType, "p->first", true); + writeMarshalUnmarshalCode(C, valueType, "p->second", true); + C << eb; + C << eb; + C << sp; + C << nl << "void" << nl << scope << "::__read(::IceInternal::Stream* __is, " << scoped << "& v, ::" << scope + << "::__U__" << name << ')'; + C << sb; + C << nl << "::Ice::Int sz;"; + C << nl << "__is->read(sz);"; + C << nl << "while (sz--)"; + C << sb; + C << nl << "::std::pair<" << ks << ", " << vs << "> pair;"; + writeMarshalUnmarshalCode(C, keyType, "pair.first", false); + writeMarshalUnmarshalCode(C, valueType, "pair.second", false); + C << nl << "v.insert(v.end(), pair);"; + C << eb; + C << eb; +} + +void Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) { string name = p->name(); diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h index 7019d69d868..77002b264a3 100644 --- a/cpp/src/slice2cpp/Gen.h +++ b/cpp/src/slice2cpp/Gen.h @@ -53,7 +53,8 @@ private: virtual void visitModuleStart(const ModulePtr&); virtual void visitModuleEnd(const ModulePtr&); - virtual void visitVector(const VectorPtr&); + virtual void visitSequence(const SequencePtr&); + virtual void visitDictionary(const DictionaryPtr&); virtual void visitEnum(const EnumPtr&); virtual void visitNative(const NativePtr&); diff --git a/cpp/src/slice2cpp/GenUtil.cpp b/cpp/src/slice2cpp/GenUtil.cpp index 4249d7a7cda..1a94c7a1a41 100644 --- a/cpp/src/slice2cpp/GenUtil.cpp +++ b/cpp/src/slice2cpp/GenUtil.cpp @@ -287,21 +287,29 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& return; } - VectorPtr vec = VectorPtr::dynamicCast(type); - if (vec) + SequencePtr seq = SequencePtr::dynamicCast(type); + if (seq) { - if (BuiltinPtr::dynamicCast(vec->type())) + if (BuiltinPtr::dynamicCast(seq->type())) { out << nl << stream << "->" << func << param << ");"; } else { - out << nl << vec->scope() << "::__" << func << stream << ", " << param << ", " << vec->scope() - << "::__U__" << vec->name() << "());"; + out << nl << seq->scope() << "::__" << func << stream << ", " << param << ", " << seq->scope() + << "::__U__" << seq->name() << "());"; } return; } + DictionaryPtr dict = DictionaryPtr::dynamicCast(type); + if (dict) + { + out << nl << dict->scope() << "::__" << func << stream << ", " << param << ", " << dict->scope() + << "::__U__" << dict->name() << "());"; + return; + } + NativePtr native = NativePtr::dynamicCast(type); assert(!native); // TODO diff --git a/cpp/src/slice2docbook/Gen.cpp b/cpp/src/slice2docbook/Gen.cpp index f0dbc86d38c..d65d7588f23 100644 --- a/cpp/src/slice2docbook/Gen.cpp +++ b/cpp/src/slice2docbook/Gen.cpp @@ -173,14 +173,60 @@ Slice::Gen::visitContainer(const ContainerPtr& p) end(); } - VectorList vectors = p->vectors(); - vectors.sort(); - if (!vectors.empty()) + StructList structs = p->structs(); + structs.sort(); + if (!structs.empty()) { - start("section", "Vector Index"); + start("section", "Struct Index"); start("variablelist"); - for (VectorList::iterator q = vectors.begin(); q != vectors.end(); ++q) + for (StructList::iterator q = structs.begin(); q != structs.end(); ++q) + { + start("varlistentry"); + start("term"); + O << nl << toString(*q, p); + end(); + start("listitem"); + printSummary(*q); + end(); + end(); + } + + end(); + end(); + } + + SequenceList sequences = p->sequences(); + sequences.sort(); + if (!sequences.empty()) + { + start("section", "Sequence Index"); + start("variablelist"); + + for (SequenceList::iterator q = sequences.begin(); q != sequences.end(); ++q) + { + start("varlistentry"); + start("term"); + O << nl << toString(*q, p); + end(); + start("listitem"); + printSummary(*q); + end(); + end(); + } + + end(); + end(); + } + + DictionaryList dictionaries = p->dictionaries(); + dictionaries.sort(); + if (!dictionaries.empty()) + { + start("section", "Dictionary Index"); + start("variablelist"); + + for (DictionaryList::iterator q = dictionaries.begin(); q != dictionaries.end(); ++q) { start("varlistentry"); start("term"); @@ -245,14 +291,14 @@ Slice::Gen::visitContainer(const ContainerPtr& p) end(); { - for (VectorList::iterator q = vectors.begin(); q != vectors.end(); ++q) + for (SequenceList::iterator q = sequences.begin(); q != sequences.end(); ++q) { TypePtr type = (*q)->type(); start("section id=" + scopedToId((*q)->scoped()), (*q)->name()); O.zeroIndent(); - O << nl << "<synopsis>vector< " << toString(type, p) << " > <type>" << (*q)->name() + O << nl << "<synopsis>sequence< " << toString(type, p) << " > <type>" << (*q)->name() << "</type>;</synopsis>"; O.restoreIndent(); @@ -263,6 +309,25 @@ Slice::Gen::visitContainer(const ContainerPtr& p) } { + for (DictionaryList::iterator q = dictionaries.begin(); q != dictionaries.end(); ++q) + { + TypePtr keyType = (*q)->keyType(); + TypePtr valueType = (*q)->valueType(); + + start("section id=" + scopedToId((*q)->scoped()), (*q)->name()); + + O.zeroIndent(); + O << nl << "<synopsis>dictionary< " << toString(keyType, p) << ", " << toString(valueType, p) + << " > <type>" << (*q)->name() << "</type>;</synopsis>"; + O.restoreIndent(); + + printComment(*q); + + end(); + } + } + + { for (EnumList::iterator q = enums.begin(); q != enums.end(); ++q) { start("section id=" + scopedToId((*q)->scoped()), (*q)->name()); @@ -504,6 +569,66 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p) } void +Slice::Gen::visitStructStart(const StructPtr& p) +{ + start(_chapter + " id=" + scopedToId(p->scoped()), p->scoped().substr(2)); + + start("section", "Overview"); + O.zeroIndent(); + O << nl << "<synopsis>"; + O << "struct <structname>" << p->name() << "</structname>"; + O << "</synopsis>"; + O.restoreIndent(); + + printComment(p); + + DataMemberList dataMembers = p->dataMembers(); + dataMembers.sort(); + if (!dataMembers.empty()) + { + start("section", "Data Member Index"); + start("variablelist"); + + for (DataMemberList::iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) + { + start("varlistentry"); + start("term"); + O << nl << toString(*q, p); + end(); + start("listitem"); + printSummary(*q); + end(); + end(); + } + + end(); + end(); + } + + end(); + + { + for (DataMemberList::iterator q = dataMembers.begin(); q != dataMembers.end(); ++q) + { + TypePtr type = (*q)->type(); + + start("section id=" + scopedToId((*q)->scoped()), (*q)->name()); + + O.zeroIndent(); + O << nl << "<synopsis>" << toString(type, p) << " <structfield>" << (*q)->name() + << "</structfield>;</synopsis>"; + O.restoreIndent(); + + printComment(*q); + + end(); + } + } + + end(); +} + +void Slice::Gen::printHeader() { static const char* header = @@ -836,6 +961,14 @@ Slice::Gen::toString(const SyntaxTreeBasePtr& p, const ContainerPtr& container) s = getScopedMinimized(cl, container); } + StructPtr st = StructPtr::dynamicCast(p); + if (st) + { + tag = "structname"; + linkend = scopedToId(st->scoped()); + s = getScopedMinimized(st, container); + } + if (s.empty()) { ContainedPtr contained = ContainedPtr::dynamicCast(p); diff --git a/cpp/src/slice2docbook/Gen.h b/cpp/src/slice2docbook/Gen.h index bb2fa8c5b31..86fcc9c881f 100644 --- a/cpp/src/slice2docbook/Gen.h +++ b/cpp/src/slice2docbook/Gen.h @@ -34,6 +34,7 @@ public: virtual void visitModuleStart(const ModulePtr&); virtual void visitContainer(const ContainerPtr&); virtual void visitClassDefStart(const ClassDefPtr&); + virtual void visitStructStart(const StructPtr&); private: diff --git a/cpp/test/Ice/operations/Exceptions.cpp b/cpp/test/Ice/operations/Exceptions.cpp index 7d480bf0dd1..436156824e0 100644 --- a/cpp/test/Ice/operations/Exceptions.cpp +++ b/cpp/test/Ice/operations/Exceptions.cpp @@ -105,7 +105,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(10); } - catch(const Test::ByteV& ex) + catch(const Test::ByteS& ex) { test(ex.size() == 2); test(ex[0] == Ice::Byte(0x0f)); @@ -116,7 +116,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(11); } - catch(const Test::BoolV& ex) + catch(const Test::BoolS& ex) { test(ex.size() == 2); test(ex[0] == true); @@ -127,7 +127,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(12); } - catch(const Test::ShortV& ex) + catch(const Test::ShortS& ex) { test(ex.size() == 2); test(ex[0] == 1); @@ -138,7 +138,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(13); } - catch(const Test::IntV& ex) + catch(const Test::IntS& ex) { test(ex.size() == 2); test(ex[0] == 3); @@ -149,7 +149,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(14); } - catch(const Test::LongV& ex) + catch(const Test::LongS& ex) { test(ex.size() == 2); test(ex[0] == 5); @@ -160,7 +160,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(15); } - catch(const Test::FloatV& ex) + catch(const Test::FloatS& ex) { test(ex.size() == 2); test(ex[0] == Ice::Float(7.7)); @@ -171,7 +171,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(16); } - catch(const Test::DoubleV& ex) + catch(const Test::DoubleS& ex) { test(ex.size() == 2); test(ex[0] == Ice::Double(9.9)); @@ -182,7 +182,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(17); } - catch(const Test::StringV& ex) + catch(const Test::StringS& ex) { test(ex.size() == 2); test(ex[0] == "abc"); @@ -193,7 +193,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(18); } - catch(const Test::WStringV& ex) + catch(const Test::WStringS& ex) { test(ex.size() == 2); test(ex[0] == L"xxx"); @@ -204,7 +204,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(19); } - catch(const Test::ByteVV& ex) + catch(const Test::ByteSS& ex) { test(ex.size() == 2); test(ex[0].size() == 1); @@ -218,7 +218,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(20); } - catch(const Test::BoolVV& ex) + catch(const Test::BoolSS& ex) { test(ex.size() == 2); test(ex[0].size() == 1); @@ -232,7 +232,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(21); } - catch(const Test::ShortVV& ex) + catch(const Test::ShortSS& ex) { test(ex.size() == 2); test(ex[0].size() == 1); @@ -246,7 +246,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(22); } - catch(const Test::IntVV& ex) + catch(const Test::IntSS& ex) { test(ex.size() == 2); test(ex[0].size() == 1); @@ -260,7 +260,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(23); } - catch(const Test::LongVV& ex) + catch(const Test::LongSS& ex) { test(ex.size() == 2); test(ex[0].size() == 1); @@ -274,7 +274,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(24); } - catch(const Test::FloatVV& ex) + catch(const Test::FloatSS& ex) { test(ex.size() == 2); test(ex[0].size() == 1); @@ -288,7 +288,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(25); } - catch(const Test::DoubleVV& ex) + catch(const Test::DoubleSS& ex) { test(ex.size() == 2); test(ex[0].size() == 1); @@ -302,7 +302,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(26); } - catch(const Test::StringVV& ex) + catch(const Test::StringSS& ex) { test(ex.size() == 2); test(ex[0].size() == 1); @@ -316,7 +316,7 @@ exceptions(Test::MyClassPrx p) { p->opEx(27); } - catch(const Test::WStringVV& ex) + catch(const Test::WStringSS& ex) { test(ex.size() == 2); test(ex[0].size() == 1); diff --git a/cpp/test/Ice/operations/Test.ice b/cpp/test/Ice/operations/Test.ice index 57a6aff81a7..700e3ddf1da 100644 --- a/cpp/test/Ice/operations/Test.ice +++ b/cpp/test/Ice/operations/Test.ice @@ -23,29 +23,36 @@ enum MyEnum class MyClass; -vector<byte> ByteV; -vector<bool> BoolV; -vector<short> ShortV; -vector<int> IntV; -vector<long> LongV; -vector<float> FloatV; -vector<double> DoubleV; -vector<string> StringV; -vector<wstring> WStringV; -vector<MyEnum> MyEnumV; -vector<MyClass*> MyClassV; - -vector<ByteV> ByteVV; -vector<BoolV> BoolVV; -vector<ShortV> ShortVV; -vector<IntV> IntVV; -vector<LongV> LongVV; -vector<FloatV> FloatVV; -vector<DoubleV> DoubleVV; -vector<StringV> StringVV; -vector<WStringV> WStringVV; -vector<MyEnumV> MyEnumVV; -vector<MyClassV> MyClassVV; +sequence<byte> ByteS; +sequence<bool> BoolS; +sequence<short> ShortS; +sequence<int> IntS; +sequence<long> LongS; +sequence<float> FloatS; +sequence<double> DoubleS; +sequence<string> StringS; +sequence<wstring> WStringS; +sequence<MyEnum> MyEnumS; +sequence<MyClass*> MyClassS; + +sequence<ByteS> ByteSS; +sequence<BoolS> BoolSS; +sequence<ShortS> ShortSS; +sequence<IntS> IntSS; +sequence<LongS> LongSS; +sequence<FloatS> FloatSS; +sequence<DoubleS> DoubleSS; +sequence<StringS> StringSS; +sequence<WStringS> WStringSS; +sequence<MyEnumS> MyEnumSS; +sequence<MyClassS> MyClassSS; + +dictionary<byte, bool> ByteBoolD; +dictionary<short, int> ShortIntD; +dictionary<long, float> LongFloatD; +dictionary<double, string> DoubleStringD; +dictionary<wstring, MyEnum> WStringMyEnumD; +dictionary<MyClass*, string> MyClassStringD; class MyClass { @@ -75,78 +82,78 @@ class MyClass MyClass* opMyClass(MyClass* p1; MyClass* p2); - ByteV opByteV(ByteV p1, ByteV p2; - ByteV p3); + ByteS opByteS(ByteS p1, ByteS p2; + ByteS p3); - BoolV opBoolV(BoolV p1, BoolV p2; - BoolV p3); + BoolS opBoolS(BoolS p1, BoolS p2; + BoolS p3); - LongV opShortIntLongV(Test::ShortV p1, IntV p2, LongV p3; - ::Test::ShortV p4, IntV p5, LongV p6); + LongS opShortIntLongS(Test::ShortS p1, IntS p2, LongS p3; + ::Test::ShortS p4, IntS p5, LongS p6); - DoubleV opFloatDoubleV(FloatV p1, DoubleV p2; - FloatV p3, DoubleV p4); + DoubleS opFloatDoubleS(FloatS p1, DoubleS p2; + FloatS p3, DoubleS p4); - StringV opStringV(StringV p1, StringV p2; - StringV p3); + StringS opStringS(StringS p1, StringS p2; + StringS p3); - WStringV opWStringV(WStringV p1, WStringV p2; - WStringV p3); + WStringS opWStringS(WStringS p1, WStringS p2; + WStringS p3); - ByteVV opByteVV(ByteVV p1, ByteVV p2; - ByteVV p3); + ByteSS opByteSS(ByteSS p1, ByteSS p2; + ByteSS p3); - BoolVV opBoolVV(BoolVV p1, BoolVV p2; - BoolVV p3); + BoolSS opBoolSS(BoolSS p1, BoolSS p2; + BoolSS p3); - LongVV opShortIntLongVV(ShortVV p1, IntVV p2, LongVV p3; - ShortVV p4, IntVV p5, LongVV p6); + LongSS opShortIntLongSS(ShortSS p1, IntSS p2, LongSS p3; + ShortSS p4, IntSS p5, LongSS p6); - DoubleVV opFloatDoubleVV(FloatVV p1, DoubleVV p2; - FloatVV p3, DoubleVV p4); + DoubleSS opFloatDoubleSS(FloatSS p1, DoubleSS p2; + FloatSS p3, DoubleSS p4); - StringVV opStringVV(StringVV p1, StringVV p2; - StringVV p3); - - WStringVV opWStringVV(WStringVV p1, WStringVV p2; - WStringVV p3); - - void opEx(int p) throws byte, bool, short, int, long, float, double, - string, wstring, ByteV, BoolV, ShortV, IntV, LongV, FloatV, DoubleV, - StringV, WStringV, ByteVV, BoolVV, ShortVV, IntVV, LongVV, FloatVV, - DoubleVV, StringVV, WStringVV, MyClass*; - -/* - bool bool_; - short short_; - int int_; - long long_; - float float_; - double double_; - string string_; - wstring wstring_; - - ByteV ByteV_; - BoolV BoolV_; - ShortV ShortV_; - IntV IntV_; - LongV LongV_; - FloatV FloatV_; - DoubleV DoubleV_; - StringV StringV_; - WStringV WStringV_; - - ByteVV ByteVV_; - BoolVV BoolVV_; - ShortVV ShortVV_; - IntVV IntVV_; - LongVV LongVV_; - FloatVV FloatVV_; - DoubleVV DoubleVV_; - StringVV StringVV_; - WStringVV WStringVV_; -*/ + StringSS opStringSS(StringSS p1, StringSS p2; + StringSS p3); + + WStringSS opWStringSS(WStringSS p1, WStringSS p2; + WStringSS p3); + + void opEx(int p) throws + byte, + bool, + short, + int, + long, + float, + double, + string, + wstring, + ByteS, + BoolS, + ShortS, + IntS, + LongS, + FloatS, + DoubleS, + StringS, + WStringS, + ByteSS, + BoolSS, + ShortSS, + IntSS, + LongSS, + FloatSS, + DoubleSS, + StringSS, + WStringSS, + ByteBoolD, + ShortIntD, + LongFloatD, + DoubleStringD, + WStringMyEnumD, + MyClassStringD, + MyClass*; }; class MyDerivedClass extends MyClass diff --git a/cpp/test/Ice/operations/TestI.cpp b/cpp/test/Ice/operations/TestI.cpp index f2a55800a3f..600f8b5b2ec 100644 --- a/cpp/test/Ice/operations/TestI.cpp +++ b/cpp/test/Ice/operations/TestI.cpp @@ -104,38 +104,38 @@ MyDerivedClassI::opMyClass(const Test::MyClassPrx& p1, return Test::MyClassPrx::uncheckedCast(_adapter->objectToProxy(this)); } -Test::ByteV -MyDerivedClassI::opByteV(const Test::ByteV& p1, - const Test::ByteV& p2, - Test::ByteV& p3) +Test::ByteS +MyDerivedClassI::opByteS(const Test::ByteS& p1, + const Test::ByteS& p2, + Test::ByteS& p3) { p3.resize(p1.size()); std::reverse_copy(p1.begin(), p1.end(), p3.begin()); - Test::ByteV r = p1; + Test::ByteS r = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(r)); return r; } -Test::BoolV -MyDerivedClassI::opBoolV(const Test::BoolV& p1, - const Test::BoolV& p2, - Test::BoolV& p3) +Test::BoolS +MyDerivedClassI::opBoolS(const Test::BoolS& p1, + const Test::BoolS& p2, + Test::BoolS& p3) { p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); - Test::BoolV r; + Test::BoolS r; r.resize(p1.size()); std::reverse_copy(p1.begin(), p1.end(), r.begin()); return r; } -Test::LongV -MyDerivedClassI::opShortIntLongV(const Test::ShortV& p1, - const Test::IntV& p2, - const Test::LongV& p3, - Test::ShortV& p4, - Test::IntV& p5, - Test::LongV& p6) +Test::LongS +MyDerivedClassI::opShortIntLongS(const Test::ShortS& p1, + const Test::IntS& p2, + const Test::LongS& p3, + Test::ShortS& p4, + Test::IntS& p5, + Test::LongS& p6) { p4 = p1; p5.resize(p2.size()); @@ -145,78 +145,78 @@ MyDerivedClassI::opShortIntLongV(const Test::ShortV& p1, return p3; } -Test::DoubleV -MyDerivedClassI::opFloatDoubleV(const Test::FloatV& p1, - const Test::DoubleV& p2, - Test::FloatV& p3, - Test::DoubleV& p4) +Test::DoubleS +MyDerivedClassI::opFloatDoubleS(const Test::FloatS& p1, + const Test::DoubleS& p2, + Test::FloatS& p3, + Test::DoubleS& p4) { p3 = p1; p4.resize(p2.size()); std::reverse_copy(p2.begin(), p2.end(), p4.begin()); - Test::DoubleV r = p2; + Test::DoubleS r = p2; std::copy(p1.begin(), p1.end(), std::back_inserter(r)); return r; } -Test::StringV -MyDerivedClassI::opStringV(const Test::StringV& p1, - const Test::StringV& p2, - Test::StringV& p3) +Test::StringS +MyDerivedClassI::opStringS(const Test::StringS& p1, + const Test::StringS& p2, + Test::StringS& p3) { p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); - Test::StringV r; + Test::StringS r; r.resize(p1.size()); std::reverse_copy(p1.begin(), p1.end(), r.begin()); return r; } -Test::WStringV -MyDerivedClassI::opWStringV(const Test::WStringV& p1, - const Test::WStringV& p2, - Test::WStringV& p3) +Test::WStringS +MyDerivedClassI::opWStringS(const Test::WStringS& p1, + const Test::WStringS& p2, + Test::WStringS& p3) { p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); - Test::WStringV r; + Test::WStringS r; r.resize(p1.size()); std::reverse_copy(p1.begin(), p1.end(), r.begin()); return r; } -Test::ByteVV -MyDerivedClassI::opByteVV(const Test::ByteVV& p1, - const Test::ByteVV& p2, - Test::ByteVV& p3) +Test::ByteSS +MyDerivedClassI::opByteSS(const Test::ByteSS& p1, + const Test::ByteSS& p2, + Test::ByteSS& p3) { p3.resize(p1.size()); std::reverse_copy(p1.begin(), p1.end(), p3.begin()); - Test::ByteVV r = p1; + Test::ByteSS r = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(r)); return r; } -Test::BoolVV -MyDerivedClassI::opBoolVV(const Test::BoolVV& p1, - const Test::BoolVV& p2, - Test::BoolVV& p3) +Test::BoolSS +MyDerivedClassI::opBoolSS(const Test::BoolSS& p1, + const Test::BoolSS& p2, + Test::BoolSS& p3) { p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); - Test::BoolVV r; + Test::BoolSS r; r.resize(p1.size()); std::reverse_copy(p1.begin(), p1.end(), r.begin()); return r; } -Test::LongVV -MyDerivedClassI::opShortIntLongVV(const Test::ShortVV& p1, - const Test::IntVV& p2, - const Test::LongVV& p3, - Test::ShortVV& p4, - Test::IntVV& p5, - Test::LongVV& p6) +Test::LongSS +MyDerivedClassI::opShortIntLongSS(const Test::ShortSS& p1, + const Test::IntSS& p2, + const Test::LongSS& p3, + Test::ShortSS& p4, + Test::IntSS& p5, + Test::LongSS& p6) { p4 = p1; p5.resize(p2.size()); @@ -226,41 +226,41 @@ MyDerivedClassI::opShortIntLongVV(const Test::ShortVV& p1, return p3; } -Test::DoubleVV -MyDerivedClassI::opFloatDoubleVV(const Test::FloatVV& p1, - const Test::DoubleVV& p2, - Test::FloatVV& p3, - Test::DoubleVV& p4) +Test::DoubleSS +MyDerivedClassI::opFloatDoubleSS(const Test::FloatSS& p1, + const Test::DoubleSS& p2, + Test::FloatSS& p3, + Test::DoubleSS& p4) { p3 = p1; p4.resize(p2.size()); std::reverse_copy(p2.begin(), p2.end(), p4.begin()); - Test::DoubleVV r = p2; + Test::DoubleSS r = p2; std::copy(p2.begin(), p2.end(), std::back_inserter(r)); return r; } -Test::StringVV -MyDerivedClassI::opStringVV(const Test::StringVV& p1, - const Test::StringVV& p2, - Test::StringVV& p3) +Test::StringSS +MyDerivedClassI::opStringSS(const Test::StringSS& p1, + const Test::StringSS& p2, + Test::StringSS& p3) { p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); - Test::StringVV r; + Test::StringSS r; r.resize(p2.size()); std::reverse_copy(p2.begin(), p2.end(), r.begin()); return r; } -Test::WStringVV -MyDerivedClassI::opWStringVV(const Test::WStringVV& p1, - const Test::WStringVV& p2, - Test::WStringVV& p3) +Test::WStringSS +MyDerivedClassI::opWStringSS(const Test::WStringSS& p1, + const Test::WStringSS& p2, + Test::WStringSS& p3) { p3 = p1; std::copy(p2.begin(), p2.end(), std::back_inserter(p3)); - Test::WStringVV r; + Test::WStringSS r; r.resize(p2.size()); std::reverse_copy(p2.begin(), p2.end(), r.begin()); return r; @@ -323,7 +323,7 @@ MyDerivedClassI::opEx(Ice::Int p) case 10: { - Test::ByteV ex; + Test::ByteS ex; ex.push_back(Ice::Byte(0x0f)); ex.push_back(Ice::Byte(0xf0)); throw ex; @@ -331,7 +331,7 @@ MyDerivedClassI::opEx(Ice::Int p) case 11: { - Test::BoolV ex; + Test::BoolS ex; ex.push_back(true); ex.push_back(false); throw ex; @@ -339,7 +339,7 @@ MyDerivedClassI::opEx(Ice::Int p) case 12: { - Test::ShortV ex; + Test::ShortS ex; ex.push_back(1); ex.push_back(2); throw ex; @@ -347,7 +347,7 @@ MyDerivedClassI::opEx(Ice::Int p) case 13: { - Test::IntV ex; + Test::IntS ex; ex.push_back(3); ex.push_back(4); throw ex; @@ -355,7 +355,7 @@ MyDerivedClassI::opEx(Ice::Int p) case 14: { - Test::LongV ex; + Test::LongS ex; ex.push_back(5); ex.push_back(6); throw ex; @@ -363,7 +363,7 @@ MyDerivedClassI::opEx(Ice::Int p) case 15: { - Test::FloatV ex; + Test::FloatS ex; ex.push_back(Ice::Float(7.7)); ex.push_back(Ice::Float(8.8)); throw ex; @@ -371,7 +371,7 @@ MyDerivedClassI::opEx(Ice::Int p) case 16: { - Test::DoubleV ex; + Test::DoubleS ex; ex.push_back(Ice::Double(9.9)); ex.push_back(Ice::Double(10.10)); throw ex; @@ -379,7 +379,7 @@ MyDerivedClassI::opEx(Ice::Int p) case 17: { - Test::StringV ex; + Test::StringS ex; ex.push_back("abc"); ex.push_back("def"); throw ex; @@ -387,7 +387,7 @@ MyDerivedClassI::opEx(Ice::Int p) case 18: { - Test::WStringV ex; + Test::WStringS ex; ex.push_back(L"xxx"); ex.push_back(L"XXX"); throw ex; @@ -395,12 +395,12 @@ MyDerivedClassI::opEx(Ice::Int p) case 19: { - Test::ByteV v1; - Test::ByteV v2; + Test::ByteS v1; + Test::ByteS v2; v1.push_back(Ice::Byte(0x01)); v2.push_back(Ice::Byte(0x10)); v2.push_back(Ice::Byte(0x11)); - Test::ByteVV ex; + Test::ByteSS ex; ex.push_back(v1); ex.push_back(v2); throw ex; @@ -408,12 +408,12 @@ MyDerivedClassI::opEx(Ice::Int p) case 20: { - Test::BoolV v1; - Test::BoolV v2; + Test::BoolS v1; + Test::BoolS v2; v1.push_back(true); v2.push_back(false); v2.push_back(true); - Test::BoolVV ex; + Test::BoolSS ex; ex.push_back(v1); ex.push_back(v2); throw ex; @@ -421,12 +421,12 @@ MyDerivedClassI::opEx(Ice::Int p) case 21: { - Test::ShortV v1; - Test::ShortV v2; + Test::ShortS v1; + Test::ShortS v2; v1.push_back(1); v2.push_back(2); v2.push_back(3); - Test::ShortVV ex; + Test::ShortSS ex; ex.push_back(v1); ex.push_back(v2); throw ex; @@ -434,12 +434,12 @@ MyDerivedClassI::opEx(Ice::Int p) case 22: { - Test::IntV v1; - Test::IntV v2; + Test::IntS v1; + Test::IntS v2; v1.push_back(4); v2.push_back(5); v2.push_back(6); - Test::IntVV ex; + Test::IntSS ex; ex.push_back(v1); ex.push_back(v2); throw ex; @@ -447,12 +447,12 @@ MyDerivedClassI::opEx(Ice::Int p) case 23: { - Test::LongV v1; - Test::LongV v2; + Test::LongS v1; + Test::LongS v2; v1.push_back(7); v2.push_back(8); v2.push_back(9); - Test::LongVV ex; + Test::LongSS ex; ex.push_back(v1); ex.push_back(v2); throw ex; @@ -460,12 +460,12 @@ MyDerivedClassI::opEx(Ice::Int p) case 24: { - Test::FloatV v1; - Test::FloatV v2; + Test::FloatS v1; + Test::FloatS v2; v1.push_back(Ice::Float(10.10)); v2.push_back(Ice::Float(11.11)); v2.push_back(Ice::Float(12.12)); - Test::FloatVV ex; + Test::FloatSS ex; ex.push_back(v1); ex.push_back(v2); throw ex; @@ -473,12 +473,12 @@ MyDerivedClassI::opEx(Ice::Int p) case 25: { - Test::DoubleV v1; - Test::DoubleV v2; + Test::DoubleS v1; + Test::DoubleS v2; v1.push_back(Ice::Double(13.13)); v2.push_back(Ice::Double(14.14)); v2.push_back(Ice::Double(15.15)); - Test::DoubleVV ex; + Test::DoubleSS ex; ex.push_back(v1); ex.push_back(v2); throw ex; @@ -486,12 +486,12 @@ MyDerivedClassI::opEx(Ice::Int p) case 26: { - Test::StringV v1; - Test::StringV v2; + Test::StringS v1; + Test::StringS v2; v1.push_back("aaa"); v2.push_back("bbb"); v2.push_back("ccc"); - Test::StringVV ex; + Test::StringSS ex; ex.push_back(v1); ex.push_back(v2); throw ex; @@ -499,12 +499,12 @@ MyDerivedClassI::opEx(Ice::Int p) case 27: { - Test::WStringV v1; - Test::WStringV v2; + Test::WStringS v1; + Test::WStringS v2; v1.push_back(L"aaa"); v2.push_back(L"bbb"); v2.push_back(L"ccc"); - Test::WStringVV ex; + Test::WStringSS ex; ex.push_back(v1); ex.push_back(v2); throw ex; diff --git a/cpp/test/Ice/operations/TestI.h b/cpp/test/Ice/operations/TestI.h index 0ac00a69816..04bbe4d5f10 100644 --- a/cpp/test/Ice/operations/TestI.h +++ b/cpp/test/Ice/operations/TestI.h @@ -57,61 +57,61 @@ public: virtual Test::MyClassPrx opMyClass(const Test::MyClassPrx&, Test::MyClassPrx&); - virtual Test::ByteV opByteV(const Test::ByteV&, - const Test::ByteV&, - Test::ByteV&); - - virtual Test::BoolV opBoolV(const Test::BoolV&, - const Test::BoolV&, - Test::BoolV&); - - virtual Test::LongV opShortIntLongV(const Test::ShortV&, - const Test::IntV&, - const Test::LongV&, - Test::ShortV&, - Test::IntV&, - Test::LongV&); - - virtual Test::DoubleV opFloatDoubleV(const Test::FloatV&, - const Test::DoubleV&, - Test::FloatV&, - Test::DoubleV&); - - virtual Test::StringV opStringV(const Test::StringV&, - const Test::StringV&, - Test::StringV&); - - virtual Test::WStringV opWStringV(const Test::WStringV&, - const Test::WStringV&, - Test::WStringV&); - - virtual Test::ByteVV opByteVV(const Test::ByteVV&, - const Test::ByteVV&, - Test::ByteVV&); - - virtual Test::BoolVV opBoolVV(const Test::BoolVV&, - const Test::BoolVV&, - Test::BoolVV&); - - virtual Test::LongVV opShortIntLongVV(const Test::ShortVV&, - const Test::IntVV&, - const Test::LongVV&, - Test::ShortVV&, - Test::IntVV&, - Test::LongVV&); - - virtual Test::DoubleVV opFloatDoubleVV(const Test::FloatVV&, - const Test::DoubleVV&, - Test::FloatVV&, - Test::DoubleVV&); - - virtual Test::StringVV opStringVV(const Test::StringVV&, - const Test::StringVV&, - Test::StringVV&); + virtual Test::ByteS opByteS(const Test::ByteS&, + const Test::ByteS&, + Test::ByteS&); + + virtual Test::BoolS opBoolS(const Test::BoolS&, + const Test::BoolS&, + Test::BoolS&); + + virtual Test::LongS opShortIntLongS(const Test::ShortS&, + const Test::IntS&, + const Test::LongS&, + Test::ShortS&, + Test::IntS&, + Test::LongS&); + + virtual Test::DoubleS opFloatDoubleS(const Test::FloatS&, + const Test::DoubleS&, + Test::FloatS&, + Test::DoubleS&); + + virtual Test::StringS opStringS(const Test::StringS&, + const Test::StringS&, + Test::StringS&); + + virtual Test::WStringS opWStringS(const Test::WStringS&, + const Test::WStringS&, + Test::WStringS&); + + virtual Test::ByteSS opByteSS(const Test::ByteSS&, + const Test::ByteSS&, + Test::ByteSS&); + + virtual Test::BoolSS opBoolSS(const Test::BoolSS&, + const Test::BoolSS&, + Test::BoolSS&); + + virtual Test::LongSS opShortIntLongSS(const Test::ShortSS&, + const Test::IntSS&, + const Test::LongSS&, + Test::ShortSS&, + Test::IntSS&, + Test::LongSS&); + + virtual Test::DoubleSS opFloatDoubleSS(const Test::FloatSS&, + const Test::DoubleSS&, + Test::FloatSS&, + Test::DoubleSS&); + + virtual Test::StringSS opStringSS(const Test::StringSS&, + const Test::StringSS&, + Test::StringSS&); - virtual Test::WStringVV opWStringVV(const Test::WStringVV&, - const Test::WStringVV&, - Test::WStringVV&); + virtual Test::WStringSS opWStringSS(const Test::WStringSS&, + const Test::WStringSS&, + Test::WStringSS&); virtual void opEx(Ice::Int); diff --git a/cpp/test/Ice/operations/Twoways.cpp b/cpp/test/Ice/operations/Twoways.cpp index 015199cb7ee..e050f2b0f19 100644 --- a/cpp/test/Ice/operations/Twoways.cpp +++ b/cpp/test/Ice/operations/Twoways.cpp @@ -142,8 +142,8 @@ twoways(Test::MyClassPrx p) } { - Test::ByteV bvi1; - Test::ByteV bvi2; + Test::ByteS bvi1; + Test::ByteS bvi2; bvi1.push_back(Ice::Byte(0x01)); bvi1.push_back(Ice::Byte(0x11)); @@ -155,10 +155,10 @@ twoways(Test::MyClassPrx p) bvi2.push_back(Ice::Byte(0xf3)); bvi2.push_back(Ice::Byte(0xf4)); - Test::ByteV bvo; - Test::ByteV rvo; + Test::ByteS bvo; + Test::ByteS rvo; - rvo = p->opByteV(bvi1, bvi2, bvo); + rvo = p->opByteS(bvi1, bvi2, bvo); test(bvo.size() == 4); test(bvo[0] == Ice::Byte(0x22)); test(bvo[1] == Ice::Byte(0x12)); @@ -176,8 +176,8 @@ twoways(Test::MyClassPrx p) } { - Test::BoolV bvi1; - Test::BoolV bvi2; + Test::BoolS bvi1; + Test::BoolS bvi2; bvi1.push_back(true); bvi1.push_back(true); @@ -185,10 +185,10 @@ twoways(Test::MyClassPrx p) bvi2.push_back(false); - Test::BoolV bvo; - Test::BoolV rvo; + Test::BoolS bvo; + Test::BoolS rvo; - rvo = p->opBoolV(bvi1, bvi2, bvo); + rvo = p->opBoolS(bvi1, bvi2, bvo); test(bvo.size() == 4); test(bvo[0]); test(bvo[1]); @@ -201,9 +201,9 @@ twoways(Test::MyClassPrx p) } { - Test::ShortV svi; - Test::IntV ivi; - Test::LongV lvi; + Test::ShortS svi; + Test::IntS ivi; + Test::LongS lvi; svi.push_back(1); svi.push_back(2); @@ -218,12 +218,12 @@ twoways(Test::MyClassPrx p) lvi.push_back(30); lvi.push_back(20); - Test::ShortV svo; - Test::IntV ivo; - Test::LongV lvo; - Test::LongV rvo; + Test::ShortS svo; + Test::IntS ivo; + Test::LongS lvo; + Test::LongS rvo; - rvo = p->opShortIntLongV(svi, ivi, lvi, svo, ivo, lvo); + rvo = p->opShortIntLongS(svi, ivi, lvi, svo, ivo, lvo); test(svo.size() == 3); test(svo[0] == 1); test(svo[1] == 2); @@ -247,8 +247,8 @@ twoways(Test::MyClassPrx p) } { - Test::FloatV fvi; - Test::DoubleV dvi; + Test::FloatS fvi; + Test::DoubleS dvi; fvi.push_back(Ice::Float(3.14)); fvi.push_back(Ice::Float(1.11)); @@ -257,11 +257,11 @@ twoways(Test::MyClassPrx p) dvi.push_back(Ice::Double(1.2E10)); dvi.push_back(Ice::Double(1.3E10)); - Test::FloatV fvo; - Test::DoubleV dvo; - Test::DoubleV rvo; + Test::FloatS fvo; + Test::DoubleS dvo; + Test::DoubleS rvo; - rvo = p->opFloatDoubleV(fvi, dvi, fvo, dvo); + rvo = p->opFloatDoubleS(fvi, dvi, fvo, dvo); test(fvo.size() == 2); test(fvo[0] == ::Ice::Float(3.14)); test(fvo[1] == ::Ice::Float(1.11)); @@ -278,8 +278,8 @@ twoways(Test::MyClassPrx p) } { - Test::StringV svi1; - Test::StringV svi2; + Test::StringS svi1; + Test::StringS svi2; svi1.push_back("abc"); svi1.push_back("de"); @@ -287,10 +287,10 @@ twoways(Test::MyClassPrx p) svi2.push_back("xyz"); - Test::StringV svo; - Test::StringV rvo; + Test::StringS svo; + Test::StringS rvo; - rvo = p->opStringV(svi1, svi2, svo); + rvo = p->opStringS(svi1, svi2, svo); test(svo.size() == 4); test(svo[0] == "abc"); test(svo[1] == "de"); @@ -303,8 +303,8 @@ twoways(Test::MyClassPrx p) } { - Test::WStringV svi1; - Test::WStringV svi2; + Test::WStringS svi1; + Test::WStringS svi2; svi1.push_back(L"abc"); svi1.push_back(L"de"); @@ -312,10 +312,10 @@ twoways(Test::MyClassPrx p) svi2.push_back(L"xyz"); - Test::WStringV svo; - Test::WStringV rvo; + Test::WStringS svo; + Test::WStringS rvo; - rvo = p->opWStringV(svi1, svi2, svo); + rvo = p->opWStringS(svi1, svi2, svo); test(svo.size() == 4); test(svo[0] == L"abc"); test(svo[1] == L"de"); @@ -328,9 +328,9 @@ twoways(Test::MyClassPrx p) } { - Test::ByteVV bvi1; + Test::ByteSS bvi1; bvi1.resize(2); - Test::ByteVV bvi2; + Test::ByteSS bvi2; bvi2.resize(2); bvi1[0].push_back(Ice::Byte(0x01)); @@ -342,10 +342,10 @@ twoways(Test::MyClassPrx p) bvi2[1].push_back(Ice::Byte(0xf2)); bvi2[1].push_back(Ice::Byte(0xf1)); - Test::ByteVV bvo; - Test::ByteVV rvo; + Test::ByteSS bvo; + Test::ByteSS rvo; - rvo = p->opByteVV(bvi1, bvi2, bvo); + rvo = p->opByteSS(bvi1, bvi2, bvo); test(bvo.size() == 2); test(bvo[0].size() == 1); test(bvo[0][0] == Ice::Byte(0xff)); @@ -368,9 +368,9 @@ twoways(Test::MyClassPrx p) } { - Test::FloatVV fvi; + Test::FloatSS fvi; fvi.resize(3); - Test::DoubleVV dvi; + Test::DoubleSS dvi; dvi.resize(1); fvi[0].push_back(Ice::Float(3.14)); @@ -380,11 +380,11 @@ twoways(Test::MyClassPrx p) dvi[0].push_back(Ice::Double(1.2E10)); dvi[0].push_back(Ice::Double(1.3E10)); - Test::FloatVV fvo; - Test::DoubleVV dvo; - Test::DoubleVV rvo; + Test::FloatSS fvo; + Test::DoubleSS dvo; + Test::DoubleSS rvo; - rvo = p->opFloatDoubleVV(fvi, dvi, fvo, dvo); + rvo = p->opFloatDoubleSS(fvi, dvi, fvo, dvo); test(fvo.size() == 3); test(fvo[0].size() == 1); test(fvo[0][0] == ::Ice::Float(3.14)); @@ -408,9 +408,9 @@ twoways(Test::MyClassPrx p) } { - Test::StringVV svi1; + Test::StringSS svi1; svi1.resize(2); - Test::StringVV svi2; + Test::StringSS svi2; svi2.resize(3); svi1[0].push_back("abc"); @@ -419,10 +419,10 @@ twoways(Test::MyClassPrx p) svi2[2].push_back("xyz"); - Test::StringVV svo; - Test::StringVV rvo; + Test::StringSS svo; + Test::StringSS rvo; - rvo = p->opStringVV(svi1, svi2, svo); + rvo = p->opStringSS(svi1, svi2, svo); test(svo.size() == 5); test(svo[0].size() == 1); test(svo[0][0] == "abc"); @@ -441,9 +441,9 @@ twoways(Test::MyClassPrx p) } { - Test::WStringVV svi1; + Test::WStringSS svi1; svi1.resize(2); - Test::WStringVV svi2; + Test::WStringSS svi2; svi2.resize(3); svi1[0].push_back(L"abc"); @@ -452,10 +452,10 @@ twoways(Test::MyClassPrx p) svi2[2].push_back(L"xyz"); - Test::WStringVV svo; - Test::WStringVV rvo; + Test::WStringSS svo; + Test::WStringSS rvo; - rvo = p->opWStringVV(svi1, svi2, svo); + rvo = p->opWStringSS(svi1, svi2, svo); test(svo.size() == 5); test(svo[0].size() == 1); test(svo[0][0] == L"abc"); diff --git a/cpp/test/Slice/errorDetection/DictionaryRedefinition.err b/cpp/test/Slice/errorDetection/DictionaryRedefinition.err new file mode 100644 index 00000000000..b39dc9e34c9 --- /dev/null +++ b/cpp/test/Slice/errorDetection/DictionaryRedefinition.err @@ -0,0 +1 @@ +DictionaryRedefinition.ice:12: redefinition of dictionary `Dictionary' diff --git a/cpp/test/Slice/errorDetection/DictionaryRedefinition.ice b/cpp/test/Slice/errorDetection/DictionaryRedefinition.ice new file mode 100644 index 00000000000..9ee39cb086b --- /dev/null +++ b/cpp/test/Slice/errorDetection/DictionaryRedefinition.ice @@ -0,0 +1,12 @@ +// ********************************************************************** +// +// Copyright (c) 2001 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +dictionary<int, long> Dictionary; +dictionary<int, long> Dictionary; diff --git a/cpp/test/Slice/errorDetection/MapRedefinition.err b/cpp/test/Slice/errorDetection/MapRedefinition.err deleted file mode 100644 index ad9400fda64..00000000000 --- a/cpp/test/Slice/errorDetection/MapRedefinition.err +++ /dev/null @@ -1 +0,0 @@ -MapRedefinition.ice:12: redefinition of map `Map' diff --git a/cpp/test/Slice/errorDetection/NotClassOrInterface.err b/cpp/test/Slice/errorDetection/NotClassOrInterface.err index 922573aab1c..89adf22bc33 100644 --- a/cpp/test/Slice/errorDetection/NotClassOrInterface.err +++ b/cpp/test/Slice/errorDetection/NotClassOrInterface.err @@ -1,9 +1,9 @@ -NotClassOrInterface.ice:15: `Vector' is not an interface -NotClassOrInterface.ice:16: `Vector' is not a class -NotClassOrInterface.ice:17: `Vector3' is not an interface -NotClassOrInterface.ice:17: `Vector2' is not an interface -NotClassOrInterface.ice:17: `Vector1' is not an interface -NotClassOrInterface.ice:18: `Vector' is not a class -NotClassOrInterface.ice:18: `Vector3' is not an interface -NotClassOrInterface.ice:18: `Vector2' is not an interface -NotClassOrInterface.ice:18: `Vector1' is not an interface +NotClassOrInterface.ice:15: `Sequence' is not an interface +NotClassOrInterface.ice:16: `Sequence' is not a class +NotClassOrInterface.ice:17: `Sequence3' is not an interface +NotClassOrInterface.ice:17: `Sequence2' is not an interface +NotClassOrInterface.ice:17: `Sequence1' is not an interface +NotClassOrInterface.ice:18: `Sequence' is not a class +NotClassOrInterface.ice:18: `Sequence3' is not an interface +NotClassOrInterface.ice:18: `Sequence2' is not an interface +NotClassOrInterface.ice:18: `Sequence1' is not an interface diff --git a/cpp/test/Slice/errorDetection/NotClassOrInterface.ice b/cpp/test/Slice/errorDetection/NotClassOrInterface.ice index 61830eaf074..bbb30c6e37d 100644 --- a/cpp/test/Slice/errorDetection/NotClassOrInterface.ice +++ b/cpp/test/Slice/errorDetection/NotClassOrInterface.ice @@ -8,11 +8,11 @@ // // ********************************************************************** -vector<int> Vector; -vector<int> Vector1; -vector<int> Vector2; -vector<int> Vector3; -interface BarIntf extends Vector { }; -class BarClass1 extends Vector { }; -class BarClass2 implements Vector1, Vector2, Vector3 { }; -class BarClass3 extends Vector implements Vector1, Vector2, Vector3 { }; +sequence<int> Sequence; +sequence<int> Sequence1; +sequence<int> Sequence2; +sequence<int> Sequence3; +interface BarIntf extends Sequence { }; +class BarClass1 extends Sequence { }; +class BarClass2 implements Sequence1, Sequence2, Sequence3 { }; +class BarClass3 extends Sequence implements Sequence1, Sequence2, Sequence3 { }; diff --git a/cpp/test/Slice/errorDetection/NotType.err b/cpp/test/Slice/errorDetection/NotType.err index e69de29bb2d..b67886924c4 100644 --- a/cpp/test/Slice/errorDetection/NotType.err +++ b/cpp/test/Slice/errorDetection/NotType.err @@ -0,0 +1,11 @@ +NotType.ice:17: `Module' is not a type +NotType.ice:18: `Module' is not a type +NotType.ice:19: `Module' is not a type +NotType.ice:20: `Module' is not a type +NotType.ice:21: `Module3' is not a type +NotType.ice:21: `Module2' is not a type +NotType.ice:21: `Module1' is not a type +NotType.ice:22: `Module' is not a type +NotType.ice:22: `Module3' is not a type +NotType.ice:22: `Module2' is not a type +NotType.ice:22: `Module1' is not a type diff --git a/cpp/test/Slice/errorDetection/NotType.ice b/cpp/test/Slice/errorDetection/NotType.ice index 406bc214c46..92cacacff0f 100644 --- a/cpp/test/Slice/errorDetection/NotType.ice +++ b/cpp/test/Slice/errorDetection/NotType.ice @@ -14,8 +14,8 @@ module Module3 { }; module Module { -vector<Module> Vector; -map<int, Module> Map; +sequence<Module> Sequence; +dictionary<int, Module> Dictionary; interface BarIntf extends Module { }; class BarClass1 extends Module { }; class BarClass2 implements Module1, Module2, Module3 { }; diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsClass.err b/cpp/test/Slice/errorDetection/RedefinitionAsClass.err index 29968e88b63..7db099191dc 100644 --- a/cpp/test/Slice/errorDetection/RedefinitionAsClass.err +++ b/cpp/test/Slice/errorDetection/RedefinitionAsClass.err @@ -1,2 +1,2 @@ -RedefinitionAsClass.ice:12: declaration of already defined `Vector1' as class -RedefinitionAsClass.ice:15: redefinition of `Vector2' as class +RedefinitionAsClass.ice:12: declaration of already defined `Sequence1' as class +RedefinitionAsClass.ice:15: redefinition of `Sequence2' as class diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsClass.ice b/cpp/test/Slice/errorDetection/RedefinitionAsClass.ice index 5835e1ae3a9..18d1c411bf1 100644 --- a/cpp/test/Slice/errorDetection/RedefinitionAsClass.ice +++ b/cpp/test/Slice/errorDetection/RedefinitionAsClass.ice @@ -8,8 +8,8 @@ // // ********************************************************************** -vector<int> Vector1; -class Vector1; +sequence<int> Sequence1; +class Sequence1; -vector<int> Vector2; -class Vector2 { }; +sequence<int> Sequence2; +class Sequence2 { }; diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsDictionary.err b/cpp/test/Slice/errorDetection/RedefinitionAsDictionary.err new file mode 100644 index 00000000000..97576b0c140 --- /dev/null +++ b/cpp/test/Slice/errorDetection/RedefinitionAsDictionary.err @@ -0,0 +1 @@ +RedefinitionAsDictionary.ice:12: redefinition of `Class' as dictionary diff --git a/cpp/test/Slice/errorDetection/VectorRedefinition.ice b/cpp/test/Slice/errorDetection/RedefinitionAsDictionary.ice index 2248c565df3..a531d5248f2 100644 --- a/cpp/test/Slice/errorDetection/VectorRedefinition.ice +++ b/cpp/test/Slice/errorDetection/RedefinitionAsDictionary.ice @@ -8,5 +8,5 @@ // // ********************************************************************** -vector<int> Vector; -vector<int> Vector; +class Class { }; +dictionary<string, int> Class; diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsEnumerator.err b/cpp/test/Slice/errorDetection/RedefinitionAsEnumerator.err index 3f790dad41c..ee48a8f14a1 100644 --- a/cpp/test/Slice/errorDetection/RedefinitionAsEnumerator.err +++ b/cpp/test/Slice/errorDetection/RedefinitionAsEnumerator.err @@ -1,2 +1,2 @@ -RedefinitionAsEnumerator.ice:13: redefinition of `Vector' as enumerator +RedefinitionAsEnumerator.ice:13: redefinition of `Sequence' as enumerator RedefinitionAsEnumerator.ice:13: redefinition of `Class' as enumerator diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsEnumerator.ice b/cpp/test/Slice/errorDetection/RedefinitionAsEnumerator.ice index 97f3ff85dbe..f360a2e4cd7 100644 --- a/cpp/test/Slice/errorDetection/RedefinitionAsEnumerator.ice +++ b/cpp/test/Slice/errorDetection/RedefinitionAsEnumerator.ice @@ -9,5 +9,5 @@ // ********************************************************************** class Class { }; -vector<int> Vector; -enum Enum { Class, Vector }; +sequence<int> Sequence; +enum Enum { Class, Sequence }; diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsInterface.err b/cpp/test/Slice/errorDetection/RedefinitionAsInterface.err index 0f7ef12d1b8..719e8703e0d 100644 --- a/cpp/test/Slice/errorDetection/RedefinitionAsInterface.err +++ b/cpp/test/Slice/errorDetection/RedefinitionAsInterface.err @@ -1,2 +1,2 @@ -RedefinitionAsInterface.ice:12: declaration of already defined `Vector1' as interface -RedefinitionAsInterface.ice:15: redefinition of `Vector2' as interface +RedefinitionAsInterface.ice:12: declaration of already defined `Sequence1' as interface +RedefinitionAsInterface.ice:15: redefinition of `Sequence2' as interface diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsInterface.ice b/cpp/test/Slice/errorDetection/RedefinitionAsInterface.ice index b8041e946c1..a4664aa2030 100644 --- a/cpp/test/Slice/errorDetection/RedefinitionAsInterface.ice +++ b/cpp/test/Slice/errorDetection/RedefinitionAsInterface.ice @@ -8,8 +8,8 @@ // // ********************************************************************** -vector<int> Vector1; -interface Vector1; +sequence<int> Sequence1; +interface Sequence1; -vector<int> Vector2; -interface Vector2 { }; +sequence<int> Sequence2; +interface Sequence2 { }; diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsMap.err b/cpp/test/Slice/errorDetection/RedefinitionAsMap.err deleted file mode 100644 index 9f710a9a95c..00000000000 --- a/cpp/test/Slice/errorDetection/RedefinitionAsMap.err +++ /dev/null @@ -1 +0,0 @@ -RedefinitionAsMap.ice:12: redefinition of `Class' as map diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsModule.err b/cpp/test/Slice/errorDetection/RedefinitionAsModule.err index 52bddb9bd0b..bb7e6816ce4 100644 --- a/cpp/test/Slice/errorDetection/RedefinitionAsModule.err +++ b/cpp/test/Slice/errorDetection/RedefinitionAsModule.err @@ -1 +1 @@ -RedefinitionAsModule.ice:12: redefinition of `Vector' as module +RedefinitionAsModule.ice:12: redefinition of `Sequence' as module diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsModule.ice b/cpp/test/Slice/errorDetection/RedefinitionAsModule.ice index 9d9db1c412f..3a486e43666 100644 --- a/cpp/test/Slice/errorDetection/RedefinitionAsModule.ice +++ b/cpp/test/Slice/errorDetection/RedefinitionAsModule.ice @@ -8,7 +8,7 @@ // // ********************************************************************** -vector<int> Vector; -module Vector { }; +sequence<int> Sequence; +module Sequence { }; module Module { }; module Module { }; diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsSequence.err b/cpp/test/Slice/errorDetection/RedefinitionAsSequence.err new file mode 100644 index 00000000000..050f79286ea --- /dev/null +++ b/cpp/test/Slice/errorDetection/RedefinitionAsSequence.err @@ -0,0 +1 @@ +RedefinitionAsSequence.ice:12: redefinition of `Class' as sequence diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsMap.ice b/cpp/test/Slice/errorDetection/RedefinitionAsSequence.ice index 5c606ff86bc..fbe11516c06 100644 --- a/cpp/test/Slice/errorDetection/RedefinitionAsMap.ice +++ b/cpp/test/Slice/errorDetection/RedefinitionAsSequence.ice @@ -9,4 +9,4 @@ // ********************************************************************** class Class { }; -map<string, int> Class; +sequence<int> Class; diff --git a/cpp/test/Slice/errorDetection/RedefinitionAsVector.err b/cpp/test/Slice/errorDetection/RedefinitionAsVector.err deleted file mode 100644 index 7959fbf9476..00000000000 --- a/cpp/test/Slice/errorDetection/RedefinitionAsVector.err +++ /dev/null @@ -1 +0,0 @@ -RedefinitionAsVector.ice:12: redefinition of `Class' as vector diff --git a/cpp/test/Slice/errorDetection/SequenceRedefinition.err b/cpp/test/Slice/errorDetection/SequenceRedefinition.err new file mode 100644 index 00000000000..0b134378c73 --- /dev/null +++ b/cpp/test/Slice/errorDetection/SequenceRedefinition.err @@ -0,0 +1 @@ +SequenceRedefinition.ice:12: redefinition of sequence `Sequence' diff --git a/cpp/test/Slice/errorDetection/MapRedefinition.ice b/cpp/test/Slice/errorDetection/SequenceRedefinition.ice index 0adc579e796..fb7f4b96a2b 100644 --- a/cpp/test/Slice/errorDetection/MapRedefinition.ice +++ b/cpp/test/Slice/errorDetection/SequenceRedefinition.ice @@ -8,5 +8,5 @@ // // ********************************************************************** -map<int, long> Map; -map<int, long> Map; +sequence<int> Sequence; +sequence<int> Sequence; diff --git a/cpp/test/Slice/errorDetection/Undefined.ice b/cpp/test/Slice/errorDetection/Undefined.ice index 0f5a586ea66..6360eae7f0a 100644 --- a/cpp/test/Slice/errorDetection/Undefined.ice +++ b/cpp/test/Slice/errorDetection/Undefined.ice @@ -8,8 +8,8 @@ // // ********************************************************************** -vector<Foo> FooVector; -map<Foo, Bar> FooBarMap; +sequence<Foo> FooSequence; +dictionary<Foo, Bar> FooBarDictionary; interface BarIntf extends Foo { }; class BarClass1 extends Foo { }; class BarClass2 implements Foo1, Foo2, Foo3 { }; diff --git a/cpp/test/Slice/errorDetection/VectorRedefinition.err b/cpp/test/Slice/errorDetection/VectorRedefinition.err deleted file mode 100644 index d0d4f02327f..00000000000 --- a/cpp/test/Slice/errorDetection/VectorRedefinition.err +++ /dev/null @@ -1 +0,0 @@ -VectorRedefinition.ice:12: redefinition of vector `Vector' diff --git a/cpp/test/Slice/errorDetection/WrongProxyType.err b/cpp/test/Slice/errorDetection/WrongProxyType.err index 9fedb8c0acd..4bcbc3393ef 100644 --- a/cpp/test/Slice/errorDetection/WrongProxyType.err +++ b/cpp/test/Slice/errorDetection/WrongProxyType.err @@ -1,6 +1,6 @@ -WrongProxyType.ice:16: `Vector' must be class or interface -WrongProxyType.ice:17: `Vector' must be class or interface -WrongProxyType.ice:18: `Vector' must be class or interface -WrongProxyType.ice:20: `Map' must be class or interface -WrongProxyType.ice:21: `Map' must be class or interface -WrongProxyType.ice:22: `Map' must be class or interface +WrongProxyType.ice:16: `Sequence' must be class or interface +WrongProxyType.ice:17: `Sequence' must be class or interface +WrongProxyType.ice:18: `Sequence' must be class or interface +WrongProxyType.ice:20: `Dictionary' must be class or interface +WrongProxyType.ice:21: `Dictionary' must be class or interface +WrongProxyType.ice:22: `Dictionary' must be class or interface diff --git a/cpp/test/Slice/errorDetection/WrongProxyType.ice b/cpp/test/Slice/errorDetection/WrongProxyType.ice index 54604a4d4c0..574601a5668 100644 --- a/cpp/test/Slice/errorDetection/WrongProxyType.ice +++ b/cpp/test/Slice/errorDetection/WrongProxyType.ice @@ -8,16 +8,16 @@ // // ********************************************************************** -vector<int> Vector; -map<Vector, int> Map; +sequence<int> Sequence; +dictionary<Sequence, int> Dictionary; interface I { - Vector* f1(); - void f2(Vector*); - void f3(; Vector*); + Sequence* f1(); + void f2(Sequence*); + void f3(; Sequence*); - Map* f1(); - void f2(Map*); - void f3(; Map*); + Dictionary* f1(); + void f2(Dictionary*); + void f3(; Dictionary*); }; diff --git a/cpp/test/Slice/errorDetection/run.py b/cpp/test/Slice/errorDetection/run.py index 65d56b05688..47ef25143ab 100755 --- a/cpp/test/Slice/errorDetection/run.py +++ b/cpp/test/Slice/errorDetection/run.py @@ -26,6 +26,7 @@ for file in os.listdir(directory): if(regex1.search(file)): files.append(file) +files.sort() for file in files: print file + "...", |