OdbDesignLib
OdbDesign ODB++ Parsing Library
PropertyRecord.cpp
1 #include "PropertyRecord.h"
2 
3 namespace Odb::Lib::FileModel::Design
4 {
5  // Inherited via IProtoBuffable
6  std::unique_ptr<Odb::Lib::Protobuf::PropertyRecord>
7  PropertyRecord::to_protobuf() const
8  {
9  std::unique_ptr<Odb::Lib::Protobuf::PropertyRecord> pPropertyRecordMessage(new Odb::Lib::Protobuf::PropertyRecord);
10  pPropertyRecordMessage->set_name(name);
11  pPropertyRecordMessage->set_value(value);
12  for (const auto& f : floatValues)
13  {
14  pPropertyRecordMessage->add_floatvalues(f);
15  }
16  return pPropertyRecordMessage;
17  }
18 
19  void PropertyRecord::from_protobuf(const Odb::Lib::Protobuf::PropertyRecord& message)
20  {
21  name = message.name();
22  value = message.value();
23  for (int i = 0; i < message.floatvalues_size(); ++i)
24  {
25  floatValues.push_back(message.floatvalues(i));
26  }
27  }
28 }