OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
 
Loading...
Searching...
No Matches
PinConnection.h
Go to the documentation of this file.
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
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, unsigned int subnetNumber = 0);
20 PinConnection(std::shared_ptr<Component> pComponent, std::shared_ptr<Pin> pPin, const std::string& name, unsigned int subnetNumber = 0);
21 //~PinConnection();
22
23 std::shared_ptr<Pin> GetPin() const;
24 std::shared_ptr<Component> GetComponent() const;
25
26 // Subnet ordinal within the connection's NET record (eda/data, spec
27 // p.153). In-memory only — deliberately not serialized into the
28 // normalized pinconnection.proto; the Connectivity derive (M2.1) is
29 // its sole consumer.
30 unsigned int GetSubnetNumber() const;
31
32 static std::string MakeName(const Component& component, const Pin& pin);
33
34 // Inherited via IProtoBuffable
35 std::unique_ptr<Odb::Lib::Protobuf::ProductModel::PinConnection> to_protobuf() const override;
36 void from_protobuf(const Odb::Lib::Protobuf::ProductModel::PinConnection& message) override;
37
38 typedef std::vector<std::shared_ptr<PinConnection>> Vector;
39 typedef std::map<std::string, std::shared_ptr<PinConnection>> StringMap;
40
41 private:
42 std::string m_name;
43 std::shared_ptr<Component> m_pComponent;
44 std::shared_ptr<Pin> m_pPin;
45 unsigned int m_subnetNumber = 0;
46
47 };
48}
std::map< std::string, std::shared_ptr< PinConnection > > StringMap
std::vector< std::shared_ptr< PinConnection > > Vector
#define ODBDESIGN_EXPORT