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

  • SEARCH
  • Home
  • 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 486821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:32:33+00:00 2026-05-13T01:32:33+00:00

I have just come accross Google’s Protocol buffers. It seems to be the solution

  • 0

I have just come accross Google’s Protocol buffers. It seems to be the solution for a C++ backend application I am writing. Problem is I cant seem to find anything regarding vector types. The documentation mentions repeated_types, but I cant seem to find anything.

Supposing I have these set of classes:

class UnifiedBinaryHeader
{
public:
    UnifiedBinaryHeader();

    void Serialize(std::ostream& output) const;
    void Deserialize(std::istream& input);

private:
    wxString m_name;
    wxDateTime m_time;
};

struct UnifiedBinaryRow
{
    wxDateTime date;
    float value;

    UnifiedBinaryRow()
    {
        value= 0;
    }

    void Serialize(std::ostream& output) const;
    void Deserialize(std::istream& input);
};

class UnifiedBinaryRowCollection
{
private:
    typedef std::vector<UnifiedBinaryRow> UnifiedBinaryRowVector;

public:
    typedef UnifiedBinaryRowVector::iterator iterator;
    typedef UnifiedBinaryRowVector::const_iterator const_iterator;

    UnifiedBinaryRowCollection();

    iterator begin();
    const_iterator begin() const;
    iterator end();
    const_iterator end() const;

    UnifiedBinaryRowCollection& AddRow(const UnifiedBinaryRow& row);

    size_t NumRows() const;

private:
    UnifiedBinaryRowVector m_rows;
};


class UnifiedBinaryFormat
{
public:
    UnifiedBinaryFormat();

    UnifiedBinaryHeader& Header();
    const UnifiedBinaryHeader& Header() const;
    UnifiedBinaryFormat& Header(UnifiedBinaryHeader& header);

    UnifiedBinaryRowCollection& Rows();
    const UnifiedBinaryRowCollection& Rows() const;
    UnifiedBinaryFormat& Rows(const UnifiedBinaryRowCollection& rows);

    void Serialize(std::ostream& output) const;
    void Deserialize(std::istream& input);

private:
    UnifiedBinaryHeader m_header;
    UnifiedBinaryRowCollection m_rows;
};

How may I write a .proto file for these classes, seeing as I am using a lot of members that are vectors. Any help in “porting” these classes to a .proto file I can use will be much appreciated.

  • 1 1 Answer
  • 1 View
  • 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-05-13T01:32:33+00:00Added an answer on May 13, 2026 at 1:32 am

    I think you misunderstood the philosophy.

    IMHO Google’s Protocol Buffers is meant to produce ‘messages’ class that are distinct from your application classes. Note that Protobuf is NOT a serialization library (though it may be used as such). It is a messaging library, which allows to exchange messages between different subsystems / languages.

    So, proto will generate messages class, and then for your serialization/deserialization it will convert the stream to an object of its own class and your job is to convert the proto object to your actual object, or group of objects.

    It’s a nice way to decouple the actual implementation of the class from the serialization / deserialization mechanism imo.

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

Sidebar

Related Questions

I am writing an application in WPF and have come accross a problem. As
Have just come across a problem where I believe this is the solution. At
I have encountered a problem that I have not come accross yet when setting
I have searched google but it seems no one has come across this issue.
I have just come across a Visual C++ option that allows you to force
I have just come across this code: function test(){ //... if ( $profilerule ==
I have just come across something that is quite strange and yet I haven't
I've just come across a database where all the character based columns have their
I am just starting off Windows OEM development and have come across these two
Have just started converting an existing job tracking system into an ASP.NET MVC application.

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.