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 梅骁 <[email protected]> wrote: > 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. > > Thank you. > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/protobuf. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/protobuf. For more options, visit https://groups.google.com/d/optout.
