#include <iostream>
#include "proto/message.pb.h"
using namespace std;
using namespace google::protobuf;
int main(int argc, char const *argv[])
{
message::Packet f;
const google::protobuf::Descriptor *d = f.GetDescriptor();
const google::protobuf::FieldDescriptor *a = d->FindFieldByName("header");
cout << " header : " << a->name() << " "<< a->type_name() << endl;
const google::protobuf::Reflection* r = f.GetReflection();
r->SetInt32(&f, a, 42);
cout << " header value : " << f.header() << endl;
//const OneofDescriptor* oneof2_ = d->FindOneofByName("payload");
//cout << " Payload : " << oneof2_->name() << " " << oneof2_->field_count() <<endl;
const google::protobuf::FieldDescriptor *a11 = d->FindFieldByName("home");
const google::protobuf::FieldDescriptor *a1 = a11->message_type()->FindFieldByName("id");
cout << " home : " << a1->name() << " " << a1->type_name() <<endl;
const google::protobuf::Reflection* rr = f.GetReflection();
rr->SetInt32(&f, a1, 24);
cout << " home id value : " << f.home().id() << endl;
}