[protobuf] Re: Why does Protobuf generate outer classes for Java?

2021-07-26 Thread Matt Welke
Oh okay. So it sounds like many languages, including Java, originally 
generated code where every message's type was placed into a single 
generated file (a file per .proto file). For Java, you can only have one 
public class per file, so the outer class technique was used so that it 
could be the single public class in the generated file, with each message's 
class as an inner class within the outer class.

But then some users wanted the option of splitting up the generated code, 
which let to the Java option to use multiple files, in which case there's 
no need for the outer class technique.

So the outer class technique wasn't to enable any specific Protobuf 
feature, it was just to work around the limitations of Java to make the 
code look like the code generated when using other languages.

On Monday, July 26, 2021 at 1:05:50 PM UTC-4 deanna...@google.com wrote:

> Java protobufs originally only had the option to have the outer class, 
> which is consistent with some other languages' protocol buffers. We decided 
> to add the "multiple files" option for users to have the option. We 
> recommend using the multiple files option in most instances, but continue 
> providing both in case historic users are reliant on having the outer class 
> or if there are special cases in which a single file would be better.
>
> On Sunday, July 25, 2021 at 11:13:02 AM UTC-7 matt...@gmail.com wrote:
>
>> I googled this and found questions like "How to use Protobuf message as 
>> java class without a java outer class?" (
>> https://stackoverflow.com/questions/60312156/how-to-use-protobuf-message-as-java-class-without-a-java-outer-class)
>>  
>> which talk about how one might tweak their Protobuf Java code generation. 
>> For example, that person wants to avoid having outer classes. The answer 
>> tells them about the "multiple files" option.
>>
>> But I'd like to know why the Java generated code, by default, is split up 
>> this way. I didn't notice code split up like that when I used my same 
>> Protobuf files to generate Go code. I got just one struct per Protobuf 
>> message I defined. In Java, I get two classes per Protobuf message defined, 
>> and I can choose between them being nested or in separate files. Why?
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/9b2a6b80-4668-4a56-bca4-cf31a9afc257n%40googlegroups.com.


[protobuf] Why does Protobuf generate outer classes for Java?

2021-07-25 Thread Matt Welke


I googled this and found questions like "How to use Protobuf message as 
java class without a java outer class?" (
https://stackoverflow.com/questions/60312156/how-to-use-protobuf-message-as-java-class-without-a-java-outer-class)
 
which talk about how one might tweak their Protobuf Java code generation. 
For example, that person wants to avoid having outer classes. The answer 
tells them about the "multiple files" option.

But I'd like to know why the Java generated code, by default, is split up 
this way. I didn't notice code split up like that when I used my same 
Protobuf files to generate Go code. I got just one struct per Protobuf 
message I defined. In Java, I get two classes per Protobuf message defined, 
and I can choose between them being nested or in separate files. Why?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/8e10682a-ad04-48bc-933b-5f30691dd7b8n%40googlegroups.com.


[protobuf] Re: Protoc not recognized command

2020-10-12 Thread Matt Maloney
It looks like protoc needs to be added to your path environment variable.

On Thursday, October 1, 2020 at 7:17:14 AM UTC-4 saaban...@gmail.com wrote:

> Hello every one,
>
> I am trying to compile .proto file using python, 
> steps i followed
> 1.installed python,
> 2. installed protobuff
> 3.create myproto.proto
> 4. protoc --python3_out=gen smy proto.proto
> 5protoc --js_out=import_style=commonjs,binary:. myproto.proto
>
> after step 4, , error on console, protoc the following :
> * The term 'protoc' is not recognized as the name of a cmdlet, function, 
> script file, or operable program. Check the spelling of the name, or if a 
> path  *
> *was included, verify that the path is correct and try again.*
> *At line:1 char:1*
> *+ protoc --python3_out=gen station_heart_beat_msg.proto*
> *+ ~~*
> *+ CategoryInfo  : ObjectNotFound: (protoc:String) [], 
> CommandNotFoundException*
> *+ FullyQualifiedErrorId : CommandNotFoundException*
>
>
> Help would be more appreciated
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/156936c5-4cf9-4fd8-a2fe-a3d87517ecf5n%40googlegroups.com.


[protobuf] C++ Compilation issues propagating from google::protobuf::internal

2020-10-12 Thread Matt Maloney
Hi all,
I have been having difficulties trying to compile my project, when 
integrating protobuf.

[image: Capture.PNG]
I am using cmake to compile a project that uses the protobuf libraries. I 
am including protobuf_INCLUDE_DIR in my target include and libprotobuf and 
libprotobuf in my target link, in my cmakelists. The errors do not make me 
think any of this is the problem though. The errors do make me wonder if 
compiler flags are a problem, so I tried adding the '-std=c++11' flag. I 
thought this worked at first, but it turns out not to be the case.

Does anyone have an idea of what the problem might be?

Thank you all in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/80da6e6c-a4bb-45a9-a546-aa9055ef6bf5n%40googlegroups.com.


[protobuf] Re: first time using protobuf INTERESTING SCENARIO

2018-05-21 Thread matt egler
I am doing this in C++ by the way!

On Monday, May 21, 2018 at 2:20:42 AM UTC-4, matt egler wrote:
>
> Greetings! I am new to google proto buf and I have over a million 
> phonenumbers and I am designing a phone system for my company that requires 
> the use of protobuf in order to complete. I am having trouble compiling a 
> .proto file in a qubes linux evnvironment but I am using Eclipse IDE in a 
> fedora 26 qube virtual machine... any help on how to compile a .proto file 
> in terminal on essentialy fedora -26 linux would be greatly appreciated!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] first time using protobuf INTERESTING SCENARIO

2018-05-21 Thread matt egler
Greetings! I am new to google proto buf and I have over a million 
phonenumbers and I am designing a phone system for my company that requires 
the use of protobuf in order to complete. I am having trouble compiling a 
.proto file in a qubes linux evnvironment but I am using Eclipse IDE in a 
fedora 26 qube virtual machine... any help on how to compile a .proto file 
in terminal on essentialy fedora -26 linux would be greatly appreciated!

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Protocol Buffer + AIDL

2018-03-09 Thread Matt W
Is it possible to have the generated code implement Parcelable? My System 
Service is receiving Events that were serialized with Google Protocol 
Buffers, and I would like to deserialize inside the service rather than the 
manager. Any non primitive sent across AIDL needs to implement Parcelable.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Third Party Add-on: dproto (D programming language)

2016-03-14 Thread Matt Soucy
At the request of some of its users, I would like to request that dproto 
(https://github.com/msoucy/dproto) be added to the list 
at https://github.com/google/protobuf/wiki/Third-Party-Add-ons under the D 
programming language. The major reason for the implementation is that the 
other two implementations listed are no longer under active development and 
unidiomatic D code, while dproto takes advantage of the language's 
compile-time computation and reflection capabilities.
Thank you,
Matt Soucy (primary developer, dproto)

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Why do I see “cannot import name descriptor_pb2” error?

2013-05-24 Thread Matt O'Connor
I'm seeing the same issue.  It's self referential.  Any idea of the 
solution?

On Wednesday, January 30, 2013 2:47:24 PM UTC-5, Roger Michoud wrote:

 Hi Kenton,

 I did the c++ install, it is clean and it works.

 I follow the README in python folder for installing python. When I run 
 python setup.py test I got this following output:
 file google/protobuf/descriptor_pb2.py (for module 
 google.protobuf.descriptor_pb2) not found
 error: package directory 'google/protobuf/compiler' does not exist

 That leads me to no choice than generating the descriptor_pb2.py manually 
 with protoc and python compiler.

 When I try to import I have the same problem than Nick. Descriptor_pb2.py 
 import itself, and it generates this error :
 file 
 path/protobuf-2.5.0rc1/python/google/protobuf/descriptor_pb2.py, line 7, 
 in module
 from google.protobuf import descriptor_pb2
 ImportError: cannot import name descriptor_pb2

 CentOS 6.3 32 bit




 On Tuesday, December 1, 2009 1:37:44 PM UTC-8, Kenton Varda wrote:

 As I posed there, you have to actually install the protobuf library as 
 directed in the readme.  Part of the installation process is building 
 descriptor_pb2.py.

 On Tue, Dec 1, 2009 at 11:39 AM, Nick Bolton nick.bolton.uk@
 googlemail.com wrote:

 Hi all,

 I'm having some trouble using our generated Python class... I posted
 my question on SO:


 http://stackoverflow.com/questions/1828379/why-do-i-see-cannot-import-name-descriptorpb2-error-when-using-google-protocol

 Nick

 --

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





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




[protobuf] Fix misdefining {non-,}NaCL Atomic64

2012-07-20 Thread Matt Tierney
Index: src/google/protobuf/stubs/atomicops.h
===
--- src/google/protobuf/stubs/atomicops.h   (revision 423)
+++ src/google/protobuf/stubs/atomicops.h   (working copy)
@@ -69,9 +69,9 @@
 #if defined(GOOGLE_PROTOBUF_OS_NACL)
 // NaCl's intptr_t is not actually 64-bits on 64-bit!
 // http://code.google.com/p/nativeclient/issues/detail?id=1162
+typedef intptr_t Atomic64;
+#else
 typedef int64 Atomic64;
-#else
-typedef intptr_t Atomic64;
 #endif
 #endif

-- 
You received this message because you are subscribed to the Google Groups 
Protocol Buffers group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/protobuf/-/2mk8pVR9_nUJ.
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.



protobuf-2.2.0 java compilation errors

2009-09-25 Thread matt

I have compiled C++ protobuf successfully but am having enormous
difficulty compiling the java code.  I initially tried manually and
after two days relinquished and installed Maven as recommended in the
README.  Building under Maven produced the same errors.

ie:

1. ERROR in /home/matth/pkgs/protobuf-2.2.0/java/src/main/java/com/
google/protobuf/TextFormat.java (at line 463)
while (pos  matcher.regionStart()) {
 ^^^
The method regionStart() is undefined for the type Matcher
--
2. ERROR in /home/matth/pkgs/protobuf-2.2.0/java/src/main/java/com/
google/protobuf/TextFormat.java (at line 474)
if (matcher.regionStart() == matcher.regionEnd()) {
^^^
The method regionStart() is undefined for the type Matcher
--
3. ERROR in /home/matth/pkgs/protobuf-2.2.0/java/src/main/java/com/
google/protobuf/TextFormat.java (at line 474)
if (matcher.regionStart() == matcher.regionEnd()) {
 ^
The method regionEnd() is undefined for the type Matcher

And it goes on.

Can anyone please suggest how I might overcome these issues.

Thanking you in advance.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---