HAL
hal::BasePin< T > Class Template Reference

#include <base_pin.h>

Collaboration diagram for hal::BasePin< T >:
Collaboration graph

Public Member Functions

virtual ~BasePin ()=default
 
bool operator== (const BasePin &other) const
 
bool operator!= (const BasePin &other) const
 
ssize_t get_hash () const
 
u32 get_id () const
 
void set_name (const std::string &name)
 
const std::string & get_name () const
 
void set_direction (PinDirection direction)
 
PinDirection get_direction () const
 
void set_type (PinType type)
 
PinType get_type () const
 
const std::pair< PinGroup< T > *, i32 > & get_group () const
 

Protected Member Functions

 BasePin (const u32 id, const std::string &name, PinDirection direction, PinType type=PinType::none)
 

Protected Attributes

u32 m_id
 
std::string m_name
 
PinDirection m_direction
 
PinType m_type
 
std::pair< PinGroup< T > *, i32m_group = {nullptr, 0}
 

Detailed Description

template<class T>
class hal::BasePin< T >

Base class for gate and module pins.

Definition at line 44 of file base_pin.h.

Constructor & Destructor Documentation

◆ ~BasePin()

template<class T >
virtual hal::BasePin< T >::~BasePin ( )
virtualdefault

◆ BasePin()

template<class T >
hal::BasePin< T >::BasePin ( const u32  id,
const std::string &  name,
PinDirection  direction,
PinType  type = PinType::none 
)
inlineprotected

Construct a new pin from its name, direction, and type.

Parameters
[in]id- The ID of the pin.
[in]name- The pin name.
[in]direction- The direction of the pin.
[in]type- The type of the pin.

Definition at line 186 of file base_pin.h.

Member Function Documentation

◆ get_direction()

◆ get_group()

template<class T >
const std::pair<PinGroup<T>*, i32>& hal::BasePin< T >::get_group ( ) const
inline

◆ get_hash()

template<class T >
ssize_t hal::BasePin< T >::get_hash ( ) const
inline

Hash function for python binding.

Returns
Pybind11 compatible hash.

Definition at line 77 of file base_pin.h.

◆ get_id()

template<class T >
u32 hal::BasePin< T >::get_id ( ) const
inline

◆ get_name()

◆ get_type()

◆ operator!=()

template<class T >
bool hal::BasePin< T >::operator!= ( const BasePin< T > &  other) const
inline

Check whether two pins are unequal.

Parameters
[in]other- The pin to compare against.
Returns
True if both pins are unequal, false otherwise.

Definition at line 67 of file base_pin.h.

References hal::BasePin< T >::operator==().

◆ operator==()

template<class T >
bool hal::BasePin< T >::operator== ( const BasePin< T > &  other) const
inline

◆ set_direction()

template<class T >
void hal::BasePin< T >::set_direction ( PinDirection  direction)
inline

Set the direction of the pin.

Parameters
[in]direction- The pin direction.

Definition at line 118 of file base_pin.h.

References direction, and hal::BasePin< T >::m_direction.

◆ set_name()

template<class T >
void hal::BasePin< T >::set_name ( const std::string &  name)
inline

Set the name of the pin.

Parameters
[in]name- The name of the pin.

Definition at line 98 of file base_pin.h.

References hal::BasePin< T >::m_name, and name.

Referenced by hal::Module::set_pin_name().

◆ set_type()

template<class T >
void hal::BasePin< T >::set_type ( PinType  type)
inline

Set the type of the pin.

Parameters
[in]type- The pin type.

Definition at line 138 of file base_pin.h.

References hal::BasePin< T >::m_type, and type.

Referenced by hal::Module::set_pin_type().

Member Data Documentation

◆ m_direction

template<class T >
PinDirection hal::BasePin< T >::m_direction
protected

◆ m_group

template<class T >
std::pair<PinGroup<T>*, i32> hal::BasePin< T >::m_group = {nullptr, 0}
protected

Definition at line 176 of file base_pin.h.

Referenced by hal::BasePin< T >::get_group(), and hal::BasePin< T >::operator==().

◆ m_id

template<class T >
u32 hal::BasePin< T >::m_id
protected

Definition at line 172 of file base_pin.h.

Referenced by hal::BasePin< T >::get_id(), and hal::BasePin< T >::operator==().

◆ m_name

template<class T >
std::string hal::BasePin< T >::m_name
protected

◆ m_type

template<class T >
PinType hal::BasePin< T >::m_type
protected

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