Seeed Grove ++  v0.0.1-2019
Linux C++ Library For Seeed Grove Devices
SG::GroveBase Class Referenceabstract

#include <sg_GroveBase.hpp>

Inheritance diagram for SG::GroveBase:
Collaboration diagram for SG::GroveBase:

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...
 
GroveBaseoperator= (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...
 

Constructor & Destructor Documentation

SG::GroveBase::~GroveBase ( void  )
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.

Member Function Documentation

virtual std::string SG::GroveBase::get_name ( void  ) const
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==().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual uint32_t SG::GroveBase::get_sku ( void  ) const
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().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual EGroveType SG::GroveBase::get_type ( void  ) const
inlinevirtual

Return the grove type.

References grove_type.

Referenced by SG::GroveI2CDigital::get_address_from_type(), operator=(), and operator==().

Here is the caller graph for this function:

virtual std::string SG::GroveBase::get_type_name ( void  ) const
inlinevirtual

Return a short text string representing the grove type.

References grove_type, and SG::to_string().

Referenced by get_description().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool SG::GroveBase::is_grove_gpio ( void  ) const
pure virtual

Determine if this is a Grove GPIO device.

See also
SG::GroveGPIO

Implemented in SG::GroveGPIO, SG::GroveUART, and SG::GroveI2C.

Referenced by get_description(), and get_name().

Here is the caller graph for this function:

virtual bool SG::GroveBase::is_grove_i2c ( void  ) const
pure virtual

Determine if this is a Grove I2C device.

See also
SG::GroveI2C

Implemented in SG::GroveGPIO, SG::GroveUART, and SG::GroveI2C.

Referenced by get_description(), and get_name().

Here is the caller graph for this function:

virtual bool SG::GroveBase::is_grove_uart ( void  ) const
pure virtual

Determine if this is a Grove UART device.

See also
SG::GroveUART

Implemented in SG::GroveGPIO, SG::GroveUART, and SG::GroveI2C.

Referenced by get_description(), and get_name().

Here is the caller graph for this function:

bool SG::GroveBase::operator!= ( const GroveBase rhs) const
inline

Test object equality.

References operator==().

Here is the call graph for this function:

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=().

Here is the call graph for this function:

Here is the caller graph for this function:

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==().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

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=().


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