PIDUINO
Loading...
Searching...
No Matches
Piduino::Pin::Descriptor

Describes a pin's type, numbering, and associated names. More...

#include <gpiopin.h>

Collaboration diagram for Piduino::Pin::Descriptor:

Public Member Functions

 Descriptor (long long pinId=-1, int pinRow=-1, int pinColumn=-1)
 Constructs a Descriptor with optional parameters.
 
bool insert ()
 Inserts the descriptor into the system.
 
bool hasModeName (Mode m, long long nameId) const
 Checks if a mode name exists for a given mode and name ID.
 
long long findId () const
 Finds the unique identifier for the pin.
 
long long findName (const std::string &name) const
 Finds the identifier for a given name.
 

Public Attributes

Type type
 Pin type.
 
Number num
 Pin numbering information.
 
long long id
 Unique identifier for the pin.
 
std::map< Mode, std::string > name
 Map of mode to pin name.
 

Private Member Functions

void insertModeName (Mode m, const std::string &n)
 Inserts a mode-name pair into the descriptor.
 

Detailed Description

Describes a pin's type, numbering, and associated names.

Definition at line 170 of file gpiopin.h.

Constructor & Destructor Documentation

◆ Descriptor()

Piduino::Pin::Descriptor::Descriptor ( long long  pinId = -1,
int  pinRow = -1,
int  pinColumn = -1 
)

Constructs a Descriptor with optional parameters.

Member Function Documentation

◆ findId()

long long Piduino::Pin::Descriptor::findId ( ) const

Finds the unique identifier for the pin.

Returns
The pin's unique identifier.

◆ findName()

long long Piduino::Pin::Descriptor::findName ( const std::string &  name) const

Finds the identifier for a given name.

Parameters
nameThe name to search for.
Returns
The identifier associated with the name.

◆ hasModeName()

bool Piduino::Pin::Descriptor::hasModeName ( Mode  m,
long long  nameId 
) const

Checks if a mode name exists for a given mode and name ID.

Parameters
mThe mode to check.
nameIdThe name identifier.
Returns
True if the mode name exists, false otherwise.

◆ insert()

bool Piduino::Pin::Descriptor::insert ( )

Inserts the descriptor into the system.

Returns
True on success, false otherwise.

◆ insertModeName()

void Piduino::Pin::Descriptor::insertModeName ( Mode  m,
const std::string &  n 
)
private

Inserts a mode-name pair into the descriptor.

Parameters
mThe mode.
nThe name.

Member Data Documentation

◆ id

long long Piduino::Pin::Descriptor::id

Unique identifier for the pin.

Definition at line 174 of file gpiopin.h.

◆ name

std::map<Mode, std::string> Piduino::Pin::Descriptor::name

Map of mode to pin name.

Definition at line 175 of file gpiopin.h.

◆ num

Number Piduino::Pin::Descriptor::num

Pin numbering information.

Definition at line 173 of file gpiopin.h.

◆ type

Type Piduino::Pin::Descriptor::type

Pin type.

Definition at line 172 of file gpiopin.h.