OdbDesignLib
OdbDesign ODB++ Parsing Library
 
Loading...
Searching...
No Matches
Part.cpp
1#include "Part.h"
2#include <string>
3#include "part.pb.h"
4#include <memory>
5
6namespace Odb::Lib::ProductModel
7{
8 Part::Part(const std::string& name)
9 : m_name(name)
10 {
11 }
12
13 std::string Part::GetName() const
14 {
15 return m_name;
16 }
17
18 std::unique_ptr<Odb::Lib::Protobuf::ProductModel::Part> Odb::Lib::ProductModel::Part::to_protobuf() const
19 {
20 auto pPartMsg = std::make_unique<Odb::Lib::Protobuf::ProductModel::Part>();
21 pPartMsg->set_name(m_name);
22 return pPartMsg;
23 }
24
25 void Odb::Lib::ProductModel::Part::from_protobuf(const Odb::Lib::Protobuf::ProductModel::Part& message)
26 {
27 m_name = message.name();
28 }
29}