Horizon
Public Types | Public Member Functions | Public Attributes | List of all members
horizon::Component Class Reference

A Component is an instanced Entity in a Block. More...

#include <component.hpp>

Public Types

enum class  NopopulateFromInstance { SET , CLEAR , UNSET }
 

Public Member Functions

 Component (const UUID &uu, const json &j, class IPool &pool, class Block *block=nullptr)
 
 Component (const UUID &uu)
 
UUID get_uuid () const
 
bool get_nopopulate () const
 
const std::string & get_prefix () const
 
std::string replace_text (const std::string &t, bool *replaced=nullptr) const
 
json serialize () const
 

Public Attributes

UUID uuid
 
const class Entityentity = nullptr
 
const class Partpart = nullptr
 
std::string refdes
 
std::string value
 
UUID group
 
UUID tag
 
bool nopopulate = false
 
UUIDVec href
 
NopopulateFromInstance nopopulate_from_instance = NopopulateFromInstance::UNSET
 
std::map< UUIDPath< 2 >, Connectionconnections
 which Nins are connected to which Net the UUIDPath consists of Gate and Pin UUID
 
std::map< UUIDPath< 2 >, std::set< int > > pin_names
 used to select alternate pin names
 
std::map< UUIDPath< 2 >, std::string > custom_pin_names
 

Detailed Description

A Component is an instanced Entity in a Block.

Like in other places around horizon, a Component is identified by its UUID, not by its reference designator. Ensuring unique refdes is up to other parts of the application.

Usually, a Component will be assigned a Part to map it to a real-world thing one can order and put on a PCB. The Part must have the same Entity as the Component. The assignment can be changed at any time. This simplifies exchanging parts for logically identical parts of the same kind. When a part Pis assigned, the value of the Component gets overriden by the Part.


The documentation for this class was generated from the following files: