OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
 
Loading...
Searching...
No Matches
Net.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 "PinConnection.h"
9#include "Component.h"
10#include "Pin.h"
11#include "net.pb.h"
12#include "../IProtoBuffable.h"
13
14
16{
17 class ODBDESIGN_EXPORT Net : public IProtoBuffable<Odb::Lib::Protobuf::ProductModel::Net>
18 {
19 public:
20 Net(const std::string& name, unsigned int index);
21 ~Net();
22
23 std::string GetName() const;
24 PinConnection::Vector& GetPinConnections();
25 // Const view for serialization-side consumers (the Connectivity derive
26 // runs inside Design::to_protobuf() const).
27 const PinConnection::Vector& GetPinConnections() const;
28 unsigned int GetIndex() const;
29 bool AddPinConnection(std::shared_ptr<Component> pComponent, std::shared_ptr<Pin> pPin, unsigned int subnetNumber = 0);
30
31 // Inherited via IProtoBuffable
32 std::unique_ptr<Odb::Lib::Protobuf::ProductModel::Net> to_protobuf() const override;
33 void from_protobuf(const Odb::Lib::Protobuf::ProductModel::Net& message) override;
34
35 typedef std::vector<std::shared_ptr<Net>> Vector;
36 typedef std::map<std::string, std::shared_ptr<Net>> StringMap;
37
38 private:
39 std::string m_name;
40 PinConnection::Vector m_pinConnections;
41 unsigned int m_index;
42
43 };
44}
std::vector< std::shared_ptr< Net > > Vector
Definition Net.h:35
std::map< std::string, std::shared_ptr< Net > > StringMap
Definition Net.h:36
std::vector< std::shared_ptr< PinConnection > > Vector
#define ODBDESIGN_EXPORT