Consider this simple ice definition:
["cpp:type:wstring"]
module syn
{
struct UserDataT
{
string username;
};
};
Genereting a Freeze Map with:
slice2freeze --dict UsersMap,int,syn::UserDataT --dict-index UsersMap,username UserMap syn.ice
This is the header generated:
#ifndef __UserMap_h__
#define __UserMap_h__
#include <Freeze/Map.h>
#include <syn.h>
#ifndef ICE_IGNORE_VERSION
# if ICE_INT_VERSION / 100 != 302
# error Ice version mismatch!
# endif
# if ICE_INT_VERSION % 100 > 50
# error Beta header file detected
# endif
# if ICE_INT_VERSION % 100 < 1
# error Ice patch level mismatch!
# endif
#endif
class UsersMapKeyCodec
{
public:
static void write(::Ice::Int, Freeze::Key&, const ::Ice::CommunicatorPtr&);
static void read(::Ice::Int&, const Freeze::Key&, const ::Ice::CommunicatorPtr&);
static const std::string& typeId();
};
class UsersMapValueCodec
{
public:
static void write(const ::syn::UserDataT&, Freeze::Value&, const ::Ice::CommunicatorPtr&);
static void read(::syn::UserDataT&, const Freeze::Value&, const ::Ice::CommunicatorPtr&);
static const std::string& typeId();
};
class UsersMap : public Freeze::Map< ::Ice::Int, ::syn::UserDataT, UsersMapKeyCodec, UsersMapValueCodec, Freeze::IceEncodingCompare >
{
public:
class UsernameIndex : public Freeze::MapIndex< ::std::string, UsernameIndex, Freeze::IceEncodingCompare >
{
public:
UsernameIndex(const std::string&, const Freeze::IceEncodingCompare& = Freeze::IceEncodingCompare());
static void write(const ::std::string&, Freeze::Key&, const Ice::CommunicatorPtr&);
static void read(::std::string&, const Freeze::Key&, const ::Ice::CommunicatorPtr&);
protected:
virtual void marshalKey(const Freeze::Value&, Freeze::Key&) const;
};
UsersMap(const Freeze::ConnectionPtr&, const std::string&, bool = true, const Freeze::IceEncodingCompare& = Freeze::IceEncodingCompare());
template <class _InputIterator>
UsersMap(const Freeze::ConnectionPtr& __connection, const std::string& __dbName, bool __createDb, _InputIterator __first, _InputIterator __last, const Freeze::IceEncodingCompare& __compare = Freeze::IceEncodingCompare())
: Freeze::Map< ::Ice::Int, ::syn::UserDataT, UsersMapKeyCodec, UsersMapValueCodec, Freeze::IceEncodingCompare >(__connection->getCommunicator())
{
Freeze::KeyCompareBasePtr __keyCompare = new Freeze::KeyCompare< ::Ice::Int, UsersMapKeyCodec, Freeze::IceEncodingCompare >(__compare, this->_communicator);
std::vector<Freeze::MapIndexBasePtr> __indices;
__indices.push_back(new UsernameIndex("username"));
this->_helper.reset(Freeze::MapHelper::create(__connect ion, __dbName, UsersMapKeyCodec::typeId(), UsersMapValueCodec::typeId(), __keyCompare, __indices, __createDb));
while(__first != __last)
{
put(*__first);
++__first;
}
}
iterator findByUsername(const ::std::string&, bool = true);
const_iterator findByUsername(const ::std::string&, bool = true) const;
iterator lowerBoundForUsername(const ::std::string&);
const_iterator lowerBoundForUsername(const ::std::string&) const;
iterator upperBoundForUsername(const ::std::string&);
const_iterator upperBoundForUsername(const ::std::string&) const;
std:air<iterator, iterator> equalRangeForUsername(const ::std::string&);
std:air<const_iterator, const_iterator> equalRangeForUsername(const ::std::string&) const;
int usernameCount(const ::std::string&) const;
};
As you can see for example findByUsername first parameter is mapped to std::string instead of std::wstring.
I think this is not correct, isn't it?

air<iterator, iterator> equalRangeForUsername(const ::std::string&);
Reply With Quote