OdbDesignLib
OdbDesign ODB++ Parsing Library
Net.h
1 #pragma once
2 
3 #include "../odbdesign_export.h"
4 #include <string>
5 #include <vector>
6 #include <map>
7 #include <memory>
8 #include "PinConnection.h"
9 #include "Component.h"
10 #include "Pin.h"
11 #include "../ProtoBuf/net.pb.h"
12 #include "../IProtoBuffable.h"
13 
14 
15 namespace Odb::Lib::ProductModel
16 {
17  class ODBDESIGN_EXPORT Net : public IProtoBuffable<Odb::Lib::Protobuf::ProductModel::Net>
18  {
19  public:
20  Net(std::string name, unsigned int index);
21  ~Net();
22 
23  std::string GetName() const;
24  PinConnection::Vector& GetPinConnections();
25  unsigned int GetIndex() const;
26  bool AddPinConnection(std::shared_ptr<Component> pComponent, std::shared_ptr<Pin> pPin);
27 
28  // Inherited via IProtoBuffable
29  std::unique_ptr<Odb::Lib::Protobuf::ProductModel::Net> to_protobuf() const override;
30  void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Net& message) override;
31 
32  typedef std::vector<std::shared_ptr<Net>> Vector;
33  typedef std::map<std::string, std::shared_ptr<Net>> StringMap;
34 
35  private:
36  std::string m_name;
37  PinConnection::Vector m_pinConnections;
38  unsigned int m_index;
39 
40  };
41 }