Home Help Center

problems of sequence?

mrliuhuamrliuhua Member liu huaOrganization: chinastockProject: fund evaluation
my ice file is defined as below, but when compiling, there are errors, why?
thks!

// **********************************************************************
//
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

#ifndef COMMON_M
#define COMMON_M

module Common
{
class CFuncMenu
{
string funcID;
string levelID;
string levelName;
string parentID;
string instanceName;
sequence<CFuncMenu> funcChildren;
};
};

#endif

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    You need to define the sequence first, for example:
    // Slice
    module Common
    {
    
    sequence<CFuncMenu> CFuncMenuSeq;
    
    class CFuncMenu
    {
        string funcID;
        string levelID;
        string levelName;
        string parentID;
        string instanceName;
        CFuncMenuSeq funcChildren;
    };
    
    }
    

    Cheers,
    Benoit.
  • mrliuhuamrliuhua Member liu huaOrganization: chinastockProject: fund evaluation
    there are still errors as blow:
    :/work/Projects/qta/Interface/Common.ice:15: `CFuncMenu' is not defined
    :/work/Projects/qta/Interface/Common.ice:24: `CFuncMenuSeq' is not defined
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Sorry, you need to forward declare the CFuncMenu class for this to work. The following should work instead:
    // Slice
    module Common
    {
    
    class CFuncMenu;
    sequence<CFuncMenu> CFuncMenuSeq;
    
    class CFuncMenu
    {
        string funcID;
        string levelID;
        string levelName;
        string parentID;
        string instanceName;
        CFuncMenuSeq funcChildren;
    };
    
    };
    
  • mrliuhuamrliuhua Member liu huaOrganization: chinastockProject: fund evaluation
    thks very much, from this point of this, slice is very similar to c etc.

    thks again.
Sign In or Register to comment.