Re: [protobuf] c++ singleton support

2016-12-09 Thread 梅骁
Thank you for your reply! I'll give it a try. 在 2016年12月10日星期六 UTC+8上午8:04:09,liujisi写道: > > Each message type has a default instance. You can specify the default > values for the fields in the message and use the default instance of that > message as the singleton. > > On Sat, Dec 3, 2016 at

Re: [protobuf] c++ singleton support

2016-12-09 Thread 'Jisi Liu' via Protocol Buffers
Each message type has a default instance. You can specify the default values for the fields in the message and use the default instance of that message as the singleton. On Sat, Dec 3, 2016 at 9:13 PM 梅骁 wrote: > Hi, > Does protobuf has singleton support? I want to use

[protobuf] c++ singleton support

2016-12-03 Thread 梅骁
Hi, Does protobuf has singleton support? I want to use it for global configurations of my program. For example, if I have a message type "GlobalSetting", then I want to use the class like: GlobalSetting::Instance().get_someVarible.