Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8922145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:45:32+00:00 2026-06-15T06:45:32+00:00

i am using the following .proto file: message Header { enum MessageType { UNKNOWN

  • 0

i am using the following .proto file:

message Header
{
    enum MessageType
    {
        UNKNOWN = 0;
        CONNECT = 1;
        DISCONNECT = 2;
        UPDATE = 3;
        REQUEST = 4;
        SUBSCRIBE = 5;
        UNSUBSCRIBE = 6;
    }
    required MessageType msgType = 1;
}

message DataSet
{
    optional string id = 1;
    optional string value = 2;
}

message StdMessage
{
    required Header header = 1;
    repeated DataSet dataSet = 2;
}

Here is the compiled StdMessage class:

class StdMessage : public ::google::protobuf::Message {
 public:
  StdMessage();
  virtual ~StdMessage();

  StdMessage(const StdMessage& from);

  inline StdMessage& operator=(const StdMessage& from) {
    CopyFrom(from);
    return *this;
  }

  inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
    return _unknown_fields_;
  }

  inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
    return &_unknown_fields_;
  }

  static const ::google::protobuf::Descriptor* descriptor();
  static const StdMessage& default_instance();

  void Swap(StdMessage* other);

  // implements Message ----------------------------------------------

  StdMessage* New() const;
  void CopyFrom(const ::google::protobuf::Message& from);
  void MergeFrom(const ::google::protobuf::Message& from);
  void CopyFrom(const StdMessage& from);
  void MergeFrom(const StdMessage& from);
  void Clear();
  bool IsInitialized() const;

  int ByteSize() const;
  bool MergePartialFromCodedStream(
      ::google::protobuf::io::CodedInputStream* input);
  void SerializeWithCachedSizes(
      ::google::protobuf::io::CodedOutputStream* output) const;
  ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
  int GetCachedSize() const { return _cached_size_; }
  private:
  void SharedCtor();
  void SharedDtor();
  void SetCachedSize(int size) const;
  public:

  ::google::protobuf::Metadata GetMetadata() const;

  // nested types ----------------------------------------------------

  // accessors -------------------------------------------------------

  // required .Header header = 1;
  inline bool has_header() const;
  inline void clear_header();
  static const int kHeaderFieldNumber = 1;
  inline const ::Header& header() const;
  inline ::Header* mutable_header();
  inline ::Header* release_header();

  // repeated .DataSet dataSet = 2;
  inline int dataset_size() const;
  inline void clear_dataset();
  static const int kDataSetFieldNumber = 2;
  inline const ::DataSet& dataset(int index) const;
  inline ::DataSet* mutable_dataset(int index);
  inline ::DataSet* add_dataset();
  inline const ::google::protobuf::RepeatedPtrField< ::DataSet >&
      dataset() const;
  inline ::google::protobuf::RepeatedPtrField< ::DataSet >*
      mutable_dataset();

  // @@protoc_insertion_point(class_scope:StdMessage)
 private:
  inline void set_has_header();
  inline void clear_has_header();

  ::google::protobuf::UnknownFieldSet _unknown_fields_;

  ::Header* header_;
  ::google::protobuf::RepeatedPtrField< ::DataSet > dataset_;

  mutable int _cached_size_;
  ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];

  friend void  protobuf_AddDesc_xplane_2eproto();
  friend void protobuf_AssignDesc_xplane_2eproto();
  friend void protobuf_ShutdownFile_xplane_2eproto();

  void InitAsDefaultInstance();
  static StdMessage* default_instance_;
};
// -------------------------------------------------------------------

in the compiled/generated cpp file, there is no set_header or similar function in the StdMessage class. my question is, how can i set the header of the StdMessage??
Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:45:33+00:00Added an answer on June 15, 2026 at 6:45 am

    Use the mutable_header() method to get a pointer to the already created Header instance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Protogen included in protobuf-net r580 to compile the following .proto file: message
I'm trying to build s-expression objects using boost::proto with the following terminals: typedef proto::terminal<
I am trying to mmap a binary file (~ 8Gb) using the following code
I have the following protoc file: message DataChunk{ required bool isHash=1; required int64 hash=2;
I am using the following in my application DatePicker from jQuery UI Pretty Photo.
Using following code I try to get updated list of checkbuttons' corresponding text values,
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>
I am creating date using following code try { newdatetime = new DateTime(2012, 2,
I am using following configuration to properly fit image inside a scrollview. <?xml version=1.0
I am using following code for showing a MessageBox with ok and cancel button.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.