OdbDesignLib
OdbDesign ODB++ Parsing Library
 
Loading...
Searching...
No Matches
PinConnection.h
1#pragma once
2
3#include "../odbdesign_export.h"
4#include <string>
5#include <vector>
6#include <map>
7#include <memory>
8#include "Component.h"
9#include "Pin.h"
10#include "pinconnection.pb.h"
11#include "../IProtoBuffable.h"
12
13
14namespace Odb::Lib::ProductModel
15{
16 class ODBDESIGN_EXPORT PinConnection : public IProtoBuffable<Odb::Lib::Protobuf::ProductModel::PinConnection>
17 {
18 public:
19 PinConnection(std::shared_ptr<Component> pComponent, std::shared_ptr<Pin> pPin);
20 PinConnection(std::shared_ptr<Component> pComponent, std::shared_ptr<Pin> pPin, const std::string& name);
21 //~PinConnection();
22
23 std::shared_ptr<Pin> GetPin() const;
24 std::shared_ptr<Component> GetComponent() const;
25
26 static std::string MakeName(const Component& component, const Pin& pin);
27
28 // Inherited via IProtoBuffable
29 std::unique_ptr<Odb::Lib::Protobuf::ProductModel::PinConnection> to_protobuf() const override;
30 void from_protobuf(const Odb::Lib::Protobuf::ProductModel::PinConnection& message) override;
31
32 typedef std::vector<std::shared_ptr<PinConnection>> Vector;
33 typedef std::map<std::string, std::shared_ptr<PinConnection>> StringMap;
34
35 private:
36 std::string m_name;
37 std::shared_ptr<Component> m_pComponent;
38 std::shared_ptr<Pin> m_pPin;
39
40 };
41}