DUDS
Distributed Update of Data from Something
duds::hardware::interface::DigitalPinBase Class Reference

A base class for classes that represent one or more pins on a single DigitalPort, but do not provide access. More...

#include <DigitalPinBase.hpp>

Inheritance diagram for duds::hardware::interface::DigitalPinBase:

Public Member Functions

const std::shared_ptr< DigitalPort > & port () const
 Returns the port that grants access to the pin(s) referenced by this object. More...
 
void reset ()
 Resets the shared pointer to the DigitalPort so that this object no longer represents a pin. More...
 

Protected Member Functions

 DigitalPinBase ()=default
 Cannot be constructed using this base class, but allows the construction of a useless object without a DigitalPort. More...
 
 DigitalPinBase (const std::shared_ptr< DigitalPort > &port)
 Initializes the port. More...
 
 ~DigitalPinBase ()=default
 Cannot be destructed using this base class to avoid the need for a virtual destructor. More...
 

Private Attributes

std::shared_ptr< DigitalPortdp
 The port object that can grant access to the pin(s). More...
 

Detailed Description

A base class for classes that represent one or more pins on a single DigitalPort, but do not provide access.

There will likely be no need or reason to keep objects of this type.

Author
Jeff Jackowski

Definition at line 25 of file DigitalPinBase.hpp.

Constructor & Destructor Documentation

◆ DigitalPinBase() [1/2]

duds::hardware::interface::DigitalPinBase::DigitalPinBase ( )
protecteddefault

Cannot be constructed using this base class, but allows the construction of a useless object without a DigitalPort.

◆ ~DigitalPinBase()

duds::hardware::interface::DigitalPinBase::~DigitalPinBase ( )
protecteddefault

Cannot be destructed using this base class to avoid the need for a virtual destructor.

There is no point to keeping objects of this base class.

◆ DigitalPinBase() [2/2]

duds::hardware::interface::DigitalPinBase::DigitalPinBase ( const std::shared_ptr< DigitalPort > &  port)
inlineprotected

Initializes the port.

Definition at line 45 of file DigitalPinBase.hpp.

Member Function Documentation

◆ port()

◆ reset()

void duds::hardware::interface::DigitalPinBase::reset ( )
inline

Resets the shared pointer to the DigitalPort so that this object no longer represents a pin.

Definition at line 58 of file DigitalPinBase.hpp.

Referenced by duds::hardware::interface::PinConfiguration::getPin().

Member Data Documentation

◆ dp

std::shared_ptr<DigitalPort> duds::hardware::interface::DigitalPinBase::dp
private

The port object that can grant access to the pin(s).

Definition at line 29 of file DigitalPinBase.hpp.

Referenced by port().


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