OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
Loading...
Searching...
No Matches
Pin.cpp
Go to the documentation of this file.
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
Pin::Pin
(
const
std::string& name,
unsigned
int
index)
10
: m_name(name)
11
, m_index(index)
12
{
13
}
14
15
std::string
Pin::GetName
()
const
16
{
17
return
m_name;
18
}
19
20
unsigned
int
Pin::GetIndex
()
const
21
{
22
return
m_index;
23
}
24
25
std::unique_ptr<Odb::Lib::Protobuf::ProductModel::Pin>
Odb::Lib::ProductModel::Pin::to_protobuf
()
const
26
{
27
auto
pPinMessage = std::make_unique<Odb::Lib::Protobuf::ProductModel::Pin>();
28
pPinMessage->set_name(
Odb::Lib::Text::ToUtf8
(m_name));
29
pPinMessage->set_index(m_index);
30
return
pPinMessage;
31
}
32
33
void
Pin::from_protobuf
(
const
Odb::Lib::Protobuf::ProductModel::Pin& message)
34
{
35
m_name = message.name();
36
m_index = message.index();
37
}
38
}
Pin.h
Odb::Lib::ProductModel::Pin::GetIndex
unsigned int GetIndex() const
Definition
Pin.cpp:20
Odb::Lib::ProductModel::Pin::GetName
std::string GetName() const
Definition
Pin.cpp:15
Odb::Lib::ProductModel::Pin::Pin
Pin(const std::string &name, unsigned int index)
Definition
Pin.cpp:9
Odb::Lib::ProductModel::Pin::to_protobuf
std::unique_ptr< Odb::Lib::Protobuf::ProductModel::Pin > to_protobuf() const override
Definition
Pin.cpp:25
Odb::Lib::ProductModel::Pin::from_protobuf
void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Pin &message) override
Definition
Pin.cpp:33
Odb::Lib::ProductModel
Definition
Component.cpp:13
Odb::Lib::Text::ToUtf8
std::string ToUtf8(std::string_view input)
Converts input to valid UTF-8.
Definition
Utf8Sanitizer.cpp:354
OdbDesignLib
ProductModel
Pin.cpp
Generated by
1.9.8