Re: list member containing sub classes

2009-08-04 Thread Kenton Varda
Can you just have the OParameter message contain optional fields of type
string and int64, where only one of the two is ever set?  Then don't have
specific types corresponding to OStringParameter and OLongParameter.

On Tue, Aug 4, 2009 at 5:07 PM, Tai  wrote:

>
> Hi,
>
> I have an (abstract) class:
> - OParameter with a member String key
>
> Now there are also two subclasses of OParameter:
> - OStringParameter with a member String value
> - OLongParameter with a member long value
>
> By using Protocol Buffers I define the proto files:
> - OParameterMessage.proto
> - OStringParameterMessage.proto
> - OLongParameterMessage.proto
>
> The files are independent from each other (no extension is used). As
> far as I understand this is how Protocol Buffers should be used. All
> classes (OParameter, OStringParameter and OLongParameter) then
> implements the writeObject() and readObject() and each class just uses
> their Protocol message and sets their members. Like:
> - Class OStringParameter.writeObject() builds a message and sets only
> its member (value)
> - The superclass OParameter.writeObject() builds a message and sets
> only its member (key)
>
> The same goes for the readObject().
>
> Okay. So far so good. But now I have a class called OListParameter and
> its member (value) is a list of OParameter containing instances of
> both types: OStringParameter and OLongParameter.
>
> How do I describe this in a proto file?
>
> Thanks Tai
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: java class name different from proto file name

2009-08-04 Thread Tai

That's not strange. That's a Windows feature :-)

On 5 Aug., 01:50, Kenton Varda  wrote:
> Yes, that's correct.  If the Win32 API strips trailing whitespace from file
> names when opening them, that would explain why there was no error -- but
> that's very strange behavior IMO.
>
> On Tue, Aug 4, 2009 at 4:26 PM, Tai  wrote:
>
> > This could be a windows problem where white spaces are accepted when
> > doing a file lookup. I further assume when protoc takes the argument
> > it uses the filename including the white space to generate the class
> > name. Maybe that was the reason why the class was called
> > "MyClassProto" and not "MyClass".
>
> > Tai
>
> > On 4 Aug., 23:19, Kenton Varda  wrote:
> > > In that case I'm surprised it compiled -- I would have expected protoc to
> > > report "file not found".  Weird.
>
> > > On Tue, Aug 4, 2009 at 2:16 PM, Tai  wrote:
>
> > > > Thanks. Your were pointing into the right direction. It wasn't the
> > > > filename but the compile argument when using ant:
>
> > > >  > > > basedir="../../../..">
> > > >        
> > > >                 > > > executable="D:/development/workspace/Platform/dev/jars/
> > > > protoc">
> > > >                         > value="-I=Platform/dev/config/protocolbuffers"
> > > > />
> > > >                        
> > > >                        
> > > >                        
> > > >                
> > > >        
> > > > 
>
> > > > The argument was:
> > > > value="Platform/dev/config/protocolbuffers/
> > > > ADMObjectHandleMessage.proto "
> > > > and not:
> > > > value="Platform/dev/config/protocolbuffers/
> > > > ADMObjectHandleMessage.proto"
>
> > > > Tai
>
> > > > On 4 Aug., 22:12, Kenton Varda  wrote:
> > > > > It looks like your problem is that your file name actually has a
> > space
> > > > > tacked on to the end of it.  That is, the name is "MyClass.proto " <-
> > > > note
> > > > > the last space.  You should get rid of that space.
>
> > > > > On Tue, Aug 4, 2009 at 9:54 AM, Tai  wrote:
>
> > > > > > I got a strange behaviour when compiling a protofile (e.g.
> > > > > > MyClass.proto). The generated java class is then called
> > MyClassProto.
> > > > > > All other proto files works fine. As a workaround I have added the
> > > > > > following line to the proto file:
>
> > > > > > option java_outer_classname = "MyClass";
>
> > > > > > Any idea what I am doing wrong?
>
> > > > > > Thanks Tai
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



list member containing sub classes

2009-08-04 Thread Tai

Hi,

I have an (abstract) class:
- OParameter with a member String key

Now there are also two subclasses of OParameter:
- OStringParameter with a member String value
- OLongParameter with a member long value

By using Protocol Buffers I define the proto files:
- OParameterMessage.proto
- OStringParameterMessage.proto
- OLongParameterMessage.proto

The files are independent from each other (no extension is used). As
far as I understand this is how Protocol Buffers should be used. All
classes (OParameter, OStringParameter and OLongParameter) then
implements the writeObject() and readObject() and each class just uses
their Protocol message and sets their members. Like:
- Class OStringParameter.writeObject() builds a message and sets only
its member (value)
- The superclass OParameter.writeObject() builds a message and sets
only its member (key)

The same goes for the readObject().

Okay. So far so good. But now I have a class called OListParameter and
its member (value) is a list of OParameter containing instances of
both types: OStringParameter and OLongParameter.

How do I describe this in a proto file?

Thanks Tai
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: 'Search this group' isn't very helpful

2009-08-04 Thread Kenton Varda
Interesting.  I'll file a bug against google groups.

On Tue, Aug 4, 2009 at 3:25 PM, Adam  wrote:

>
> On Aug 4, 5:16 pm, Kenton Varda  wrote:
> > What were you searching for?  Are you sure there should be results?
>
> I originally searched for 'rpc' which I'm pretty sure in the past
> brought up over 3 pages of results.
>
> I've been archiving the emails locally from the group for over a year.
> To test the search I went back and found some keywords in subjects
> that I would think it should easily locate. For example:
>
> ECMAScript (2008-07-11)
> MacPorts (2008-07-13)
>
> Each time I get zero results.
>
> -Adam
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: java class name different from proto file name

2009-08-04 Thread Kenton Varda
Yes, that's correct.  If the Win32 API strips trailing whitespace from file
names when opening them, that would explain why there was no error -- but
that's very strange behavior IMO.

On Tue, Aug 4, 2009 at 4:26 PM, Tai  wrote:

>
> This could be a windows problem where white spaces are accepted when
> doing a file lookup. I further assume when protoc takes the argument
> it uses the filename including the white space to generate the class
> name. Maybe that was the reason why the class was called
> "MyClassProto" and not "MyClass".
>
> Tai
>
> On 4 Aug., 23:19, Kenton Varda  wrote:
> > In that case I'm surprised it compiled -- I would have expected protoc to
> > report "file not found".  Weird.
> >
> > On Tue, Aug 4, 2009 at 2:16 PM, Tai  wrote:
> >
> > > Thanks. Your were pointing into the right direction. It wasn't the
> > > filename but the compile argument when using ant:
> >
> > >  > > basedir="../../../..">
> > >
> > > > > executable="D:/development/workspace/Platform/dev/jars/
> > > protoc">
> > > value="-I=Platform/dev/config/protocolbuffers"
> > > />
> > >
> > >
> > >
> > >
> > >
> > > 
> >
> > > The argument was:
> > > value="Platform/dev/config/protocolbuffers/
> > > ADMObjectHandleMessage.proto "
> > > and not:
> > > value="Platform/dev/config/protocolbuffers/
> > > ADMObjectHandleMessage.proto"
> >
> > > Tai
> >
> > > On 4 Aug., 22:12, Kenton Varda  wrote:
> > > > It looks like your problem is that your file name actually has a
> space
> > > > tacked on to the end of it.  That is, the name is "MyClass.proto " <-
> > > note
> > > > the last space.  You should get rid of that space.
> >
> > > > On Tue, Aug 4, 2009 at 9:54 AM, Tai  wrote:
> >
> > > > > I got a strange behaviour when compiling a protofile (e.g.
> > > > > MyClass.proto). The generated java class is then called
> MyClassProto.
> > > > > All other proto files works fine. As a workaround I have added the
> > > > > following line to the proto file:
> >
> > > > > option java_outer_classname = "MyClass";
> >
> > > > > Any idea what I am doing wrong?
> >
> > > > > Thanks Tai
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: java class name different from proto file name

2009-08-04 Thread Tai

This could be a windows problem where white spaces are accepted when
doing a file lookup. I further assume when protoc takes the argument
it uses the filename including the white space to generate the class
name. Maybe that was the reason why the class was called
"MyClassProto" and not "MyClass".

Tai

On 4 Aug., 23:19, Kenton Varda  wrote:
> In that case I'm surprised it compiled -- I would have expected protoc to
> report "file not found".  Weird.
>
> On Tue, Aug 4, 2009 at 2:16 PM, Tai  wrote:
>
> > Thanks. Your were pointing into the right direction. It wasn't the
> > filename but the compile argument when using ant:
>
> >  > basedir="../../../..">
> >        
> >                 > executable="D:/development/workspace/Platform/dev/jars/
> > protoc">
> >                         > />
> >                        
> >                        
> >                        
> >                
> >        
> > 
>
> > The argument was:
> > value="Platform/dev/config/protocolbuffers/
> > ADMObjectHandleMessage.proto "
> > and not:
> > value="Platform/dev/config/protocolbuffers/
> > ADMObjectHandleMessage.proto"
>
> > Tai
>
> > On 4 Aug., 22:12, Kenton Varda  wrote:
> > > It looks like your problem is that your file name actually has a space
> > > tacked on to the end of it.  That is, the name is "MyClass.proto " <-
> > note
> > > the last space.  You should get rid of that space.
>
> > > On Tue, Aug 4, 2009 at 9:54 AM, Tai  wrote:
>
> > > > I got a strange behaviour when compiling a protofile (e.g.
> > > > MyClass.proto). The generated java class is then called MyClassProto.
> > > > All other proto files works fine. As a workaround I have added the
> > > > following line to the proto file:
>
> > > > option java_outer_classname = "MyClass";
>
> > > > Any idea what I am doing wrong?
>
> > > > Thanks Tai
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: 'Search this group' isn't very helpful

2009-08-04 Thread Adam

On Aug 4, 5:16 pm, Kenton Varda  wrote:
> What were you searching for?  Are you sure there should be results?

I originally searched for 'rpc' which I'm pretty sure in the past
brought up over 3 pages of results.

I've been archiving the emails locally from the group for over a year.
To test the search I went back and found some keywords in subjects
that I would think it should easily locate. For example:

ECMAScript (2008-07-11)
MacPorts (2008-07-13)

Each time I get zero results.

-Adam
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: 'Search this group' isn't very helpful

2009-08-04 Thread Kenton Varda
What were you searching for?  Are you sure there should be results?

On Tue, Aug 4, 2009 at 3:07 PM, yellen  wrote:

>
> I'm finding that the search function provided by the group is
> returning much less than I expect. Is anyone else having similar
> trouble?
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



'Search this group' isn't very helpful

2009-08-04 Thread yellen

I'm finding that the search function provided by the group is
returning much less than I expect. Is anyone else having similar
trouble?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Changing {parse,merge}DelimitedFrom()

2009-08-04 Thread Kenton Varda
In Java I introduced methods called writeDelimitedTo(),
parseDelimitedFrom(), and mergeDelimitedFrom() in version 2.1.0.  These read
and write messages which are prefixed with the message size, thus allowing
multiple messages to be written to one stream without any external
delimiter.  As one or two people have pointed out, these aren't quite useful
in their current form because the parse/merge methods do not give any way to
detect EOF.
So, I want to change the interface.  I think the ideal interface would have
mergeDelimitedFrom() returning a boolean which is false on EOF (currently it
returns a Builder -- itself -- to allow chaining), and praseDelimitedFrom()
should probably return NULL on EOF.

The question is, should I just change these methods in-place or should I
introduce new methods with the new behavior?  If I change them in-place,
there's a chance it will break someone.  However, since the current methods
aren't actually very useful without this change, I'm not sure if I need to
worry about breaking anyone -- why would anyone be using a non-useful method
anyway?

Any opinions?  Is anyone using these methods currently?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: java class name different from proto file name

2009-08-04 Thread Kenton Varda
In that case I'm surprised it compiled -- I would have expected protoc to
report "file not found".  Weird.

On Tue, Aug 4, 2009 at 2:16 PM, Tai  wrote:

>
> Thanks. Your were pointing into the right direction. It wasn't the
> filename but the compile argument when using ant:
>
>  basedir="../../../..">
>
> executable="D:/development/workspace/Platform/dev/jars/
> protoc">
> />
>
>
>
>
>
> 
>
> The argument was:
> value="Platform/dev/config/protocolbuffers/
> ADMObjectHandleMessage.proto "
> and not:
> value="Platform/dev/config/protocolbuffers/
> ADMObjectHandleMessage.proto"
>
> Tai
>
> On 4 Aug., 22:12, Kenton Varda  wrote:
> > It looks like your problem is that your file name actually has a space
> > tacked on to the end of it.  That is, the name is "MyClass.proto " <-
> note
> > the last space.  You should get rid of that space.
> >
> > On Tue, Aug 4, 2009 at 9:54 AM, Tai  wrote:
> >
> > > I got a strange behaviour when compiling a protofile (e.g.
> > > MyClass.proto). The generated java class is then called MyClassProto.
> > > All other proto files works fine. As a workaround I have added the
> > > following line to the proto file:
> >
> > > option java_outer_classname = "MyClass";
> >
> > > Any idea what I am doing wrong?
> >
> > > Thanks Tai
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: java class name different from proto file name

2009-08-04 Thread Tai

Thanks. Your were pointing into the right direction. It wasn't the
filename but the compile argument when using ant:












The argument was:
value="Platform/dev/config/protocolbuffers/
ADMObjectHandleMessage.proto "
and not:
value="Platform/dev/config/protocolbuffers/
ADMObjectHandleMessage.proto"

Tai

On 4 Aug., 22:12, Kenton Varda  wrote:
> It looks like your problem is that your file name actually has a space
> tacked on to the end of it.  That is, the name is "MyClass.proto " <- note
> the last space.  You should get rid of that space.
>
> On Tue, Aug 4, 2009 at 9:54 AM, Tai  wrote:
>
> > I got a strange behaviour when compiling a protofile (e.g.
> > MyClass.proto). The generated java class is then called MyClassProto.
> > All other proto files works fine. As a workaround I have added the
> > following line to the proto file:
>
> > option java_outer_classname = "MyClass";
>
> > Any idea what I am doing wrong?
>
> > Thanks Tai
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: java class name different from proto file name

2009-08-04 Thread Kenton Varda
It looks like your problem is that your file name actually has a space
tacked on to the end of it.  That is, the name is "MyClass.proto " <- note
the last space.  You should get rid of that space.

On Tue, Aug 4, 2009 at 9:54 AM, Tai  wrote:

>
> I got a strange behaviour when compiling a protofile (e.g.
> MyClass.proto). The generated java class is then called MyClassProto.
> All other proto files works fine. As a workaround I have added the
> following line to the proto file:
>
> option java_outer_classname = "MyClass";
>
> Any idea what I am doing wrong?
>
> Thanks Tai
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: java class name different from proto file name

2009-08-04 Thread Tai

What it is also funny is that my file ADMObjectHandleMessage.proto
looks like this:

package com.qnamic.base.agent;
option java_outer_classname = "ADMObjectHandleMessage";
message ADMObjectHandle {
optional string host = 1;
optional string agent = 2;
optional string path = 3;
optional int64 admTopCreationTime = 4;
}

And the in descriptor has a whitespace in my ADMObjectHandleMessage
class:

  private static com.google.protobuf.Descriptors.FileDescriptor
  descriptor;
  static {
java.lang.String descriptorData =
  "\n\035ADMObjectHandleMessage.proto \022\025com.qna" +
  "mic.base.agent\"X\n\017ADMObjectHandle\022\014\n\004hos" +
  "t\030\001 \001(\t\022\r\n\005agent\030\002 \001(\t\022\014\n
\004path\030\003 \001(\t\022\032\n\022" +
  "admTopCreationTime\030\004 \001(\003B\030B\026ADMObjectHan" +
  "dleMessage";

So what you see here is "ADMObjectHandleMessage.proto " and not
"ADMObjectHandleMessage.proto". My other classes looks fine. The
problem is that I have AbstractADMAdapterMessage.proto using this:
package com.qnamic.planopt.base.query.adapter;
import "ADMObjectHandleMessage.proto";

message AbstractADMAdapter {
required com.qnamic.base.agent.ADMObjectHandle objectHandle = 1;
required bool adaptAll = 2;
required bool fillObjectHandle = 3;
}

The problem is that when the descriptor of the second class gets
initialized I get an Exception in Descriptors.FileDescriptor.buildFrom
() saying:
Dependencies passed to FileDescriptor.buildFrom() don't match those
listed in the FileDescriptorProto.

because the name does not match with each other:
"ADMObjectHandleMessage.proto ".equals("ADMObjectHandleMessage.proto")

What am I doing wrong?

Tai

On 4 Aug., 19:49, Stefan  wrote:
> Are you using Windows by any chance?
>
> On Aug 4, 11:54 am, Tai  wrote:
>
> > I got a strange behaviour when compiling a protofile (e.g.
> > MyClass.proto). The generated java class is then called MyClassProto.
> > All other proto files works fine. As a workaround I have added the
> > following line to the proto file:
>
> > option java_outer_classname = "MyClass";
>
> > Any idea what I am doing wrong?
>
> > Thanks Tai
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: java class name different from proto file name

2009-08-04 Thread Tai

Yes, I am using Windows XP and Eclipse 3.5

On 4 Aug., 19:49, Stefan  wrote:
> Are you using Windows by any chance?
>
> On Aug 4, 11:54 am, Tai  wrote:
>
> > I got a strange behaviour when compiling a protofile (e.g.
> > MyClass.proto). The generated java class is then called MyClassProto.
> > All other proto files works fine. As a workaround I have added the
> > following line to the proto file:
>
> > option java_outer_classname = "MyClass";
>
> > Any idea what I am doing wrong?
>
> > Thanks Tai
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: java class name different from proto file name

2009-08-04 Thread Stefan

Are you using Windows by any chance?

On Aug 4, 11:54 am, Tai  wrote:
> I got a strange behaviour when compiling a protofile (e.g.
> MyClass.proto). The generated java class is then called MyClassProto.
> All other proto files works fine. As a workaround I have added the
> following line to the proto file:
>
> option java_outer_classname = "MyClass";
>
> Any idea what I am doing wrong?
>
> Thanks Tai
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



java class name different from proto file name

2009-08-04 Thread Tai

I got a strange behaviour when compiling a protofile (e.g.
MyClass.proto). The generated java class is then called MyClassProto.
All other proto files works fine. As a workaround I have added the
following line to the proto file:

option java_outer_classname = "MyClass";

Any idea what I am doing wrong?

Thanks Tai
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: Using Other Message Types using import - "message" is not defined

2009-08-04 Thread Kenton Varda
BTW, the proto package name is meant to correspond to C++ namespaces, not
Java packages.  I recommend using the java_package option to specify the
Java package, then set the proto package to something shorter, like:
  package qnamic.base.agent;
  option java_package = "com.qnamic.base.agent";

But I suppose if you only use Java it won't make a big difference.

On Tue, Aug 4, 2009 at 7:31 AM, Tai  wrote:

>
> Ok. I forgot to the type the full qualified name including package:
>required com.qnamic.base.agent.ADMObjectHandle objectHandle = 1;
>
> Tai
>
>
> On 4 Aug., 12:14, Tai  wrote:
> > Hi,
> >
> > I have to proto files ADMObjectHandleMessage.proto and
> > AbstractADMAdapterMessage.proto:
> >
> > ADMObjectHandleMessage.proto
> > ==
> > package com.qnamic.base.agent;
> >
> > message ADMObjectHandle {
> > optional string host = 1;
> > optional string agent = 2;
> > optional string path = 3;
> > required int64 admTopCreationTime = 4;
> >
> > }
> >
> > AbstractADMAdapterMessage.proto
> > ==
> > package com.qnamic.planopt.base.query.adapter;
> > import "ADMObjectHandleMessage.proto";
> >
> > message AbstractADMAdapter {
> > repeated ADMObjectHandle objectHandle = 1;
> > required bool adaptAll = 2;
> > required bool fillObjectHandle = 3;
> >
> > }
> >
> > But when trying to compile the last file I get this:
> > Buildfile: D:\development\workspace\Platform\dev\config\protocolbuffers
> > \build.xml
> > generate:
> >  [exec] AbstractADMAdapterMessage.proto:5:14: "ADMObjectHandle" is
> > not defined.
> >  [exec] Result: 1
> > BUILD SUCCESSFUL
> > Total time: 172 milliseconds
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Re: Using Other Message Types using import - "message" is not defined

2009-08-04 Thread Tai

Ok. I forgot to the type the full qualified name including package:
required com.qnamic.base.agent.ADMObjectHandle objectHandle = 1;

Tai


On 4 Aug., 12:14, Tai  wrote:
> Hi,
>
> I have to proto files ADMObjectHandleMessage.proto and
> AbstractADMAdapterMessage.proto:
>
> ADMObjectHandleMessage.proto
> ==
> package com.qnamic.base.agent;
>
> message ADMObjectHandle {
>     optional string host = 1;
>     optional string agent = 2;
>     optional string path = 3;
>     required int64 admTopCreationTime = 4;
>
> }
>
> AbstractADMAdapterMessage.proto
> ==
> package com.qnamic.planopt.base.query.adapter;
> import "ADMObjectHandleMessage.proto";
>
> message AbstractADMAdapter {
>     repeated ADMObjectHandle objectHandle = 1;
>     required bool adaptAll = 2;
>     required bool fillObjectHandle = 3;
>
> }
>
> But when trying to compile the last file I get this:
> Buildfile: D:\development\workspace\Platform\dev\config\protocolbuffers
> \build.xml
> generate:
>      [exec] AbstractADMAdapterMessage.proto:5:14: "ADMObjectHandle" is
> not defined.
>      [exec] Result: 1
> BUILD SUCCESSFUL
> Total time: 172 milliseconds
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---



Using Other Message Types using import - "message" is not defined

2009-08-04 Thread Tai

Hi,

I have to proto files ADMObjectHandleMessage.proto and
AbstractADMAdapterMessage.proto:

ADMObjectHandleMessage.proto
==
package com.qnamic.base.agent;

message ADMObjectHandle {
optional string host = 1;
optional string agent = 2;
optional string path = 3;
required int64 admTopCreationTime = 4;
}

AbstractADMAdapterMessage.proto
==
package com.qnamic.planopt.base.query.adapter;
import "ADMObjectHandleMessage.proto";

message AbstractADMAdapter {
repeated ADMObjectHandle objectHandle = 1;
required bool adaptAll = 2;
required bool fillObjectHandle = 3;
}

But when trying to compile the last file I get this:
Buildfile: D:\development\workspace\Platform\dev\config\protocolbuffers
\build.xml
generate:
 [exec] AbstractADMAdapterMessage.proto:5:14: "ADMObjectHandle" is
not defined.
 [exec] Result: 1
BUILD SUCCESSFUL
Total time: 172 milliseconds
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---