Results 1 to 3 of 3

Thread: How to add index by slice2freeze?

  1. #1
    kingbo is offline Registered User
    Name: Tang Fan
    Organization: ShenZhen Yijin Platform Network Technology Co.,Ltd
    Project: Stock quotation server
    Join Date
    Jul 2005
    Posts
    16

    Unhappy How to add index by slice2freeze?

    HI,

    I defined two stuctures in TB.ice:
    Code:
    struct IHisDataKey
    {
    ..........................
    };
    struct IHisDataValue
    {
    ...........................
    };
    And then,I make two function class in STL_Compares.h:
    Code:
    class CstlKey  
    {
    public:
        bool operator()(const IHisDataKey& k1,const IHisDataKey& k2) const
        {
             ................................
        }
    };
    class CstlValue
    {
    public:
        bool operator()(const IHisDataValue& v1,const IHisDataValue& v2) const
        {
             ................................
        }
    };

    When I use slice2cpp.exe:
    slice2freeze.exe -I. -ID:\Ice-3.3.0-VC60\slice --add-header STL_Compares.h --dict IMapHisData,IHisDataKey,IHisDataValue,sort,CstlKey --dict-index IMapHisData,sort,CstlValue MapHisData TB.ice
    I always get "slice2freeze.exe: `IHisDataValue' is not a valid index type" error.
    What is the reason?
    Last edited by kingbo; 10-21-2008 at 02:27 PM.
    Tang Fan
    ShenZhen Yijin Platform Network Technology Co.,Ltd
    Project: Stock quotation server

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    Hi Tang Fan,

    It would be helpful to show the actual Slice types!

    If you want to index on the full value, then this value's type needs to be a valid Slice dictionary key.

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  3. #3
    kingbo is offline Registered User
    Name: Tang Fan
    Organization: ShenZhen Yijin Platform Network Technology Co.,Ltd
    Project: Stock quotation server
    Join Date
    Jul 2005
    Posts
    16
    Quote Originally Posted by bernard View Post
    Hi Tang Fan,

    It would be helpful to show the actual Slice types!

    If you want to index on the full value, then this value's type needs to be a valid Slice dictionary key.

    Best regards,
    Bernard
    The map's value is IHisDataValue, whick is a structure defined in TB.ice. IHisDataValue can not be indexed,so I implement a funtion class named CstlValue in STL_compares.h.
    --dict-index MAP[,MEMBER][,case-sensitive|case-insensitive][,sort,COMPARE]]
    I thought if I use sort and COMPARE option, slice2freeze will use my CstlValue funtion class to index it,but it seems that slice2freeze can not use the function class correctly.
    Last edited by kingbo; 10-21-2008 at 09:41 PM.
    Tang Fan
    ShenZhen Yijin Platform Network Technology Co.,Ltd
    Project: Stock quotation server

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. locker in using evcitor index
    By suds in forum Help Center
    Replies: 1
    Last Post: 12-30-2009, 03:33 AM
  2. ways to get the max&min value of a Freeze map index?
    By peterlspot in forum Help Center
    Replies: 1
    Last Post: 01-08-2008, 07:14 AM
  3. slice2freeze index problem!
    By ewiniar in forum Help Center
    Replies: 5
    Last Post: 04-03-2006, 12:14 AM
  4. index
    By nsns in forum Comments
    Replies: 0
    Last Post: 07-20-2004, 06:38 AM
  5. slice2freezej --index bug
    By aalberg in forum Bug Reports
    Replies: 1
    Last Post: 02-18-2004, 11:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •