OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
Loading...
Searching...
No Matches
Via.cpp
Go to the documentation of this file.
1
#include "
Via.h
"
2
#include <memory>
3
#include "via.pb.h"
4
#include "enums.pb.h"
5
#include "../enums.h"
6
#include <string>
7
#include "../Text/Utf8Sanitizer.h"
8
9
10
namespace
Odb::Lib::ProductModel
11
{
12
Via::Via
()
13
: m_name(
""
)
14
, m_side(
BoardSide
::
Top
)
15
{
16
}
17
18
std::string
Via::GetName
()
const
19
{
20
return
m_name;
21
}
22
23
BoardSide
Via::GetSide
()
const
24
{
25
return
m_side;
26
}
27
28
std::unique_ptr<Odb::Lib::Protobuf::ProductModel::Via>
Via::to_protobuf
()
const
29
{
30
auto
pViaMsg = std::make_unique<Odb::Lib::Protobuf::ProductModel::Via>();
31
pViaMsg->set_name(
Odb::Lib::Text::ToUtf8
(m_name));
32
pViaMsg->set_boardside(
static_cast<
Odb::Lib::Protobuf::BoardSide
>
(m_side));
33
return
pViaMsg;
34
}
35
36
void
Via::from_protobuf
(
const
Odb::Lib::Protobuf::ProductModel::Via& message)
37
{
38
m_name = message.name();
39
m_side =
static_cast<
BoardSide
>
(message.boardside());
40
}
41
42
}
// namespace Odb::Lib::ProductModel
Via.h
Odb::Lib::ProductModel::Via::Via
Via()
Definition
Via.cpp:12
Odb::Lib::ProductModel::Via::to_protobuf
std::unique_ptr< Odb::Lib::Protobuf::ProductModel::Via > to_protobuf() const override
Definition
Via.cpp:28
Odb::Lib::ProductModel::Via::from_protobuf
void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Via &message) override
Definition
Via.cpp:36
Odb::Lib::ProductModel::Via::GetSide
BoardSide GetSide() const
Definition
Via.cpp:23
Odb::Lib::ProductModel::Via::GetName
std::string GetName() const
Definition
Via.cpp:18
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
Odb::Lib::BoardSide
BoardSide
Definition
enums.h:6
Odb::Lib::BoardSide::Top
@ Top
OdbDesignLib
ProductModel
Via.cpp
Generated by
1.9.8