Line data Source code
1 : #include "Pin.h"
2 : #include <string>
3 : #include <memory>
4 : #include "pin.pb.h"
5 : #include "../Text/Utf8Sanitizer.h"
6 :
7 : namespace Odb::Lib::ProductModel
8 : {
9 1895500 : Pin::Pin(const std::string& name, unsigned int index)
10 1895500 : : m_name(name)
11 1895500 : , m_index(index)
12 : {
13 1895500 : }
14 :
15 558890 : std::string Pin::GetName() const
16 : {
17 558890 : return m_name;
18 : }
19 :
20 805044 : unsigned int Pin::GetIndex() const
21 : {
22 805044 : return m_index;
23 : }
24 :
25 5582214 : std::unique_ptr<Odb::Lib::Protobuf::ProductModel::Pin> Odb::Lib::ProductModel::Pin::to_protobuf() const
26 : {
27 5582214 : auto pPinMessage = std::make_unique<Odb::Lib::Protobuf::ProductModel::Pin>();
28 11164428 : pPinMessage->set_name(Odb::Lib::Text::ToUtf8(m_name));
29 5582214 : pPinMessage->set_index(m_index);
30 5582214 : return pPinMessage;
31 0 : }
32 :
33 1828710 : void Pin::from_protobuf(const Odb::Lib::Protobuf::ProductModel::Pin& message)
34 : {
35 1828710 : m_name = message.name();
36 1828710 : m_index = message.index();
37 1828710 : }
38 : }
|