#include <sg_GroveBase.hpp>
Public Member Functions | |
virtual | ~GroveBase (void) |
Destructor. More... | |
GroveBase (const SG::EGroveType t=SG::EGroveType::kUnknown, const std::string &n="") | |
Constructor. More... | |
GroveBase (const GroveBase &rhs) | |
Copy constructor. More... | |
GroveBase & | operator= (const GroveBase &rhs) |
Assignment. More... | |
virtual uint32_t | get_sku (void) const |
Return a guess as to the Seeed SKU number based on the grove type. More... | |
virtual std::string | get_type_name (void) const |
Return a short text string representing the grove type. More... | |
virtual EGroveType | get_type (void) const |
Return the grove type. More... | |
virtual std::string | get_name (void) const |
Return the user-supplied name. More... | |
virtual std::string | get_description (void) const |
Return a multi-word 1-line description of this object. More... | |
virtual bool | is_grove_uart (void) const =0 |
Determine if this is a Grove UART device. More... | |
virtual bool | is_grove_i2c (void) const =0 |
Determine if this is a Grove I2C device. More... | |
virtual bool | is_grove_gpio (void) const =0 |
Determine if this is a Grove GPIO device. More... | |
bool | operator== (const GroveBase &rhs) const |
Test object equality. More... | |
bool | operator!= (const GroveBase &rhs) const |
Test object equality. More... | |
Public Attributes | |
EGroveType | grove_type |
Grove type. More... | |
std::string | grove_name |
User-supplied name. More... | |
|
virtual |
Destructor.
SG::GroveBase::GroveBase | ( | const SG::EGroveType | t = SG::EGroveType::kUnknown , |
const std::string & | n = "" |
||
) |
Constructor.
SG::GroveBase::GroveBase | ( | const GroveBase & | rhs | ) |
Copy constructor.
|
virtual |
Return a multi-word 1-line description of this object.
References SG::demangle(), get_name(), get_sku(), get_type_name(), is_grove_gpio(), is_grove_i2c(), is_grove_uart(), and SG::BeagleBone::Detect::to_string().
Referenced by buzzer(), chainable_rgb_led(), common_oled(), get_name(), SG::GroveI2CDigital::GroveI2CDigital(), SG::CommonOLED::set_display_bitmap(), SG::CommonOLED::set_orientation(), temperature(), variable_led(), and SG::GroveI2CDigital::write_block().
|
inlinevirtual |
Return the user-supplied name.
References get_description(), grove_name, is_grove_gpio(), is_grove_i2c(), and is_grove_uart().
Referenced by get_description(), operator=(), and operator==().
|
inlinevirtual |
Return a guess as to the Seeed SKU number based on the grove type.
References SG::get_sku_from_grove_type(), and grove_type.
Referenced by get_description().
|
inlinevirtual |
Return the grove type.
References grove_type.
Referenced by SG::GroveI2CDigital::get_address_from_type(), operator=(), and operator==().
|
inlinevirtual |
Return a short text string representing the grove type.
References grove_type, and SG::to_string().
Referenced by get_description().
|
pure virtual |
Determine if this is a Grove GPIO device.
Implemented in SG::GroveGPIO, SG::GroveUART, and SG::GroveI2C.
Referenced by get_description(), and get_name().
|
pure virtual |
Determine if this is a Grove I2C device.
Implemented in SG::GroveGPIO, SG::GroveUART, and SG::GroveI2C.
Referenced by get_description(), and get_name().
|
pure virtual |
Determine if this is a Grove UART device.
Implemented in SG::GroveGPIO, SG::GroveUART, and SG::GroveI2C.
Referenced by get_description(), and get_name().
|
inline |
SG::GroveBase & SG::GroveBase::operator= | ( | const GroveBase & | rhs | ) |
Assignment.
References get_name(), get_type(), grove_name, and grove_type.
Referenced by SG::TemperatureAndHumiditySensor::operator=(), SG::Buzzer::operator=(), and SG::TemperatureSensor::operator=().
bool SG::GroveBase::operator== | ( | const GroveBase & | rhs | ) | const |
Test object equality.
References get_name(), and get_type().
Referenced by operator!=(), SG::Buzzer::operator==(), SG::TemperatureAndHumiditySensor::operator==(), SG::TemperatureSensor::operator==(), and SG::I2CADC::operator==().
std::string SG::GroveBase::grove_name |
User-supplied name.
Referenced by get_name(), and operator=().
EGroveType SG::GroveBase::grove_type |
Grove type.
Referenced by get_sku(), get_type(), get_type_name(), and operator=().