OdbDesignLib
OdbDesign ODB++ Parsing Library
 
Loading...
Searching...
No Matches
Component.h
1#pragma once
2
3#include "../odbdesign_export.h"
4#include <string>
5#include <vector>
6#include <map>
7#include <memory>
8#include "Package.h"
9#include "../enums.h"
10#include "Part.h"
11#include "component.pb.h"
12#include "../IProtoBuffable.h"
13
14
15namespace Odb::Lib::ProductModel
16{
17 class ODBDESIGN_EXPORT Component : public IProtoBuffable<Odb::Lib::Protobuf::ProductModel::Component>
18 {
19 public:
20 Component();
21 Component(const std::string& refDes, const std::string& partName, std::shared_ptr<Package> pPackage, unsigned int index, BoardSide side, std::shared_ptr<Part> pPart);
22 ~Component();
23
24 std::string GetRefDes() const;
25 std::string GetPartName() const;
26 std::shared_ptr<Package> GetPackage() const;
27 unsigned int GetIndex() const;
28 BoardSide GetSide() const;
29 std::shared_ptr<Part> GetPart() const;
30
31 // Inherited via IProtoBuffable
32 std::unique_ptr<Odb::Lib::Protobuf::ProductModel::Component> to_protobuf() const override;
33 void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Component& message) override;
34
35 //static Component* MakeEmpty();
36
37 typedef std::vector<std::shared_ptr<Component>> Vector;
38 typedef std::map<std::string, std::shared_ptr<Component>> StringMap;
39
40 private:
41 std::string m_refDes;
42 std::string m_partName;
43 std::shared_ptr<Package> m_pPackage;
44 unsigned int m_index;
45 BoardSide m_side;
46 std::shared_ptr<Part> m_pPart;
47 };
48}