[omniORB] about STL used in omniORB (sorry for last same subject email)

zhang ji zsfunl@yahoo.com
Fri Aug 23 05:53:01 2002


Hi,

This question may be not suitble here(sorry for
that),but I am confused on the results.

I use std::map in one omniORB servlet: below is its
definition in .h file:
"
  struct eqstr
    {
        bool operator()(const char* s1, const char* 
s2) const
        {
                return strcmp(s1, s2) == 0;
        }
    };

    //Rule is one struct defined in IDL file
    typedef map<const char*, Rule, eqstr > Rules_Map;
    Rules_Map rule_map;

" 

The adding/removing entity to/from the Rules_Map is
very simple:
"
        mu.lock();
        pair<Rules_Map::iterator, bool> result =
rule_map.insert(pair<const
char*,Rule>(ru.rulename,ru));
        mu.unlock();
"

"
        mu.lock();
        result = rule_map.erase((const
char*)ru.rulename);
        mu.unlock();
"

But the results are not right: I insert one Rule with
key "SPI"(the rule_map only contains the one Rule) and

when I remove one Rule with key "Updated SPI", it can
just remove the Rule with key "SPI". So I think it is
the problem on the key comparation, but I can not find
where is the wrong.

Thanks,
Shifeng

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com