Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 12-30-2006
zhi zhi is offline
Registered User
 
Name: Zhi Quan Lee
Organization: University of Auckland
Project: Dynamic Reconfiguration with Correctness Assurance
 
Join Date: Nov 2006
Location: Auckland
Posts: 32
Helper Classes not Generated

Hi, I'm trying to follow the streaming example to use streaming in my application. However, the helper class needed to perform this operation - KodkodModelHelper.write(out, c)) is not generated.

Code:
#ifndef INVOKE_ICE
#define INVOKE_ICE

module OpenRec2 {
	exception PrintFailure	{
	    string reason;
	};
	class KodkodModel {
		void solve();
	};

#endif
The generated classes are:
KodkodModel, KodkodModelHolder, KodkodModelPrx, KodkodModelPrxHelper and KodkodModelPrxHolder but there is no KodkodModelHelper.

Is there something I missed in the SLICE descriptor?

Here is the code for KodkodModel.java:
Code:
// **********************************************************************
//
// Copyright (c) 2003-2006 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.
//
// **********************************************************************

// Ice version 3.1.1

package OpenRec2;

public abstract class KodkodModel extends Ice.ObjectImpl
				  implements _KodkodModelOperations,
					     _KodkodModelOperationsNC
{
    public static final String[] __ids =
    {
	"::Ice::Object",
	"::OpenRec2::KodkodModel"
    };

    public boolean
    ice_isA(String s)
    {
	return java.util.Arrays.binarySearch(__ids, s) >= 0;
    }

    public boolean
    ice_isA(String s, Ice.Current __current)
    {
	return java.util.Arrays.binarySearch(__ids, s) >= 0;
    }

    public String[]
    ice_ids()
    {
	return __ids;
    }

    public String[]
    ice_ids(Ice.Current __current)
    {
	return __ids;
    }

    public String
    ice_id()
    {
	return __ids[1];
    }

    public String
    ice_id(Ice.Current __current)
    {
	return __ids[1];
    }

    public static String
    ice_staticId()
    {
	return __ids[1];
    }

    public final void
    solve()
    {
	solve(null);
    }

    public static IceInternal.DispatchStatus
    ___solve(KodkodModel __obj, IceInternal.Incoming __inS, Ice.Current __current)
    {
	__checkMode(Ice.OperationMode.Normal, __current.mode);
	__obj.solve(__current);
	return IceInternal.DispatchStatus.DispatchOK;
    }

    private final static String[] __all =
    {
	"ice_id",
	"ice_ids",
	"ice_isA",
	"ice_ping",
	"solve"
    };

    public IceInternal.DispatchStatus
    __dispatch(IceInternal.Incoming in, Ice.Current __current)
    {
	int pos = java.util.Arrays.binarySearch(__all, __current.operation);
	if(pos < 0)
	{
	    return IceInternal.DispatchStatus.DispatchOperationNotExist;
	}

	switch(pos)
	{
	    case 0:
	    {
		return ___ice_id(this, in, __current);
	    }
	    case 1:
	    {
		return ___ice_ids(this, in, __current);
	    }
	    case 2:
	    {
		return ___ice_isA(this, in, __current);
	    }
	    case 3:
	    {
		return ___ice_ping(this, in, __current);
	    }
	    case 4:
	    {
		return ___solve(this, in, __current);
	    }
	}

	assert(false);
	return IceInternal.DispatchStatus.DispatchOperationNotExist;
    }

    public void
    __write(IceInternal.BasicStream __os)
    {
	__os.writeTypeId(ice_staticId());
	__os.startWriteSlice();
	__os.endWriteSlice();
	super.__write(__os);
    }

    public void
    __read(IceInternal.BasicStream __is, boolean __rid)
    {
	if(__rid)
	{
	    __is.readTypeId();
	}
	__is.startReadSlice();
	__is.endReadSlice();
	super.__read(__is, true);
    }

    public void
    __write(Ice.OutputStream __outS)
    {
	Ice.MarshalException ex = new Ice.MarshalException();
	ex.reason = "type OpenRec2::KodkodModel was not generated with stream support";
	throw ex;
    }

    public void
    __read(Ice.InputStream __inS, boolean __rid)
    {
	Ice.MarshalException ex = new Ice.MarshalException();
	ex.reason = "type OpenRec2::KodkodModel was not generated with stream support";
	throw ex;
    }
}
__________________
Zhi Quan Lee
University of Auckland
Department of Electrical and Computer Engineering
http://se.auckland.ac.nz

Project: An Integrated Automated Framework for Managing Dynamic Reconfiguration

Supervised by Dr. Ian Warren and Dr. Jing Sun.

With respect to their paper: http://csdl2.computer.org/persagen/D...09/ASE.2006.12

Homepage:
http://zhi-lee.com
Reply With Quote
  #2 (permalink)  
Old 12-30-2006
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Hi,

An instance of a Slice class is marshaled using OutputStream.writeObject.

Take care,
- Mark
Reply With Quote
  #3 (permalink)  
Old 01-03-2007
zhi zhi is offline
Registered User
 
Name: Zhi Quan Lee
Organization: University of Auckland
Project: Dynamic Reconfiguration with Correctness Assurance
 
Join Date: Nov 2006
Location: Auckland
Posts: 32
How do I demarshall it from the stream if I don't want to use in.readObject() as I prefer not to use callback objects. It's just a simple object that needs to be passed across the stream.
__________________
Zhi Quan Lee
University of Auckland
Department of Electrical and Computer Engineering
http://se.auckland.ac.nz

Project: An Integrated Automated Framework for Managing Dynamic Reconfiguration

Supervised by Dr. Ian Warren and Dr. Jing Sun.

With respect to their paper: http://csdl2.computer.org/persagen/D...09/ASE.2006.12

Homepage:
http://zhi-lee.com
Reply With Quote
  #4 (permalink)  
Old 01-04-2007
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 912
There is no other way to unmarshal class instances. The reason is the way classes are marshaled. (See the Ice Protocol chapter in the doc for details.)

Cheers,

Michi.
Reply With Quote
  #5 (permalink)  
Old 01-04-2007
zhi zhi is offline
Registered User
 
Name: Zhi Quan Lee
Organization: University of Auckland
Project: Dynamic Reconfiguration with Correctness Assurance
 
Join Date: Nov 2006
Location: Auckland
Posts: 32
Thanks. Perhaps you can tell me how the following CHelper class was generated as with the bundled Printer example?

From PrinterI.java:
Code:
 Demo.CHolder c = new Demo.CHolder();
            Demo.CHelper.read(in, c);
            in.readPendingObjects();
            in.destroy();
            System.out.println("Printing class: s.name=" + c.value.s.name + ", s.value=" + c.value.s.value);
This is exactly what I want to do.
__________________
Zhi Quan Lee
University of Auckland
Department of Electrical and Computer Engineering
http://se.auckland.ac.nz

Project: An Integrated Automated Framework for Managing Dynamic Reconfiguration

Supervised by Dr. Ian Warren and Dr. Jing Sun.

With respect to their paper: http://csdl2.computer.org/persagen/D...09/ASE.2006.12

Homepage:
http://zhi-lee.com
Reply With Quote
  #6 (permalink)  
Old 01-04-2007
matthew's Avatar
matthew matthew is offline
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,061
Pass --stream to the slice2java compiler. See 35.2.2 in the Ice manual.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stream helper functions and C++ templates copton Help Center 7 01-20-2006 03:37 PM
generated C# classes don't have constructors with arguments for fields kovacm Bug Reports 1 08-07-2005 08:00 PM
C#: Attributes with Ice generated classes and structs DeepDiver Help Center 2 07-23-2005 03:16 AM
Generated Java Helper class has errors ygarbourg Help Center 2 05-06-2005 03:13 PM
c# implicit type coversion for Ice generated classes/structs DeepDiver Help Center 1 01-25-2005 08:30 AM


All times are GMT -4. The time now is 12:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.