Archived
This forum has been archived. Please start a new discussion on GitHub.
sequence to set mapping
peter
in Help Center
Is this possible?
// In file CCU.ice
"cpp:include:set"
module example {
["cpp:type:std::set<std::string>"] sequence<string> SET;
};
// end of file CCU.ice
Because if I compile with:
c++ -I. -I/usr/include -c server.cpp CCU.cpp CCUIS.cpp
I get the following error message:
CCU.cpp: In function ‘void CCU::__readSET(IceInternal::BasicStream*, CCU::SET&)’:
CCU.cpp:88: error: no matching function for call to ‘std::set<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::set(Ice::Int&)’
// In file CCU.ice
"cpp:include:set"
module example {
["cpp:type:std::set<std::string>"] sequence<string> SET;
};
// end of file CCU.ice
Because if I compile with:
c++ -I. -I/usr/include -c server.cpp CCU.cpp CCUIS.cpp
I get the following error message:
CCU.cpp: In function ‘void CCU::__readSET(IceInternal::BasicStream*, CCU::SET&)’:
CCU.cpp:88: error: no matching function for call to ‘std::set<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::set(Ice::Int&)’
0
Comments
-
Hi Blair,
You should be able to use any class that satisfies the requirements listed in the manual. (I don't think the un-marshaling code checks the size of the un-marshaled mapped sequence.)
However, it is also desirable for the mapped C++ (Java ...) type to match the semantics of the underlying Slice type.
A sequence is an ordered list, with possibly duplicate values, and not a set. A dictionary would be a better match for a set.
Best regards,
Bernard0
