Libsockcanpp
A complete C++ wrapper around socketcan.
|
Represents a CAN ID in a simple and easy-to-use manner. More...
#include <CanId.hpp>
Public Member Functions | |
constexpr | CanId ()=default |
constexpr | CanId (const canid_t id) |
constexpr | CanId (const int32_t id) |
CanId (const char *id) | |
constexpr canid_t | operator* () const |
Returns the raw CAN ID value. | |
constexpr | operator int16_t () const |
constexpr | operator uint16_t () const |
constexpr | operator int32_t () const |
constexpr | operator canid_t () const |
template<typename T > | |
constexpr CanId | operator& (const T x) const |
Performs a bitwise AND operation on this ID and another. | |
constexpr CanId | operator& (const CanId &x) const |
Performs a bitwise AND operation on this ID and another. | |
template<typename T > | |
constexpr CanId | operator| (const T x) const |
Performs a bitwise OR operation on this ID and a 16-bit integer. | |
constexpr CanId | operator| (const CanId &x) const |
Performs a bitwise OR operation on this ID and another. | |
template<typename T > | |
constexpr CanId | operator^ (const T x) const |
Performs a bitwise XOR operation on this ID and a 16-bit integer. | |
constexpr CanId | operator^ (const CanId &x) const |
Performs a bitwise XOR operation on this ID and another. | |
constexpr CanId | operator~ () const |
Performs a bitwise NOT operation on this ID. | |
template<typename T > | |
constexpr CanId | operator<< (const T x) const |
Shifts this ID to the left by a 16-bit integer. | |
constexpr CanId | operator<< (const CanId &x) const |
Shifts this ID to the left by another. | |
template<typename T > | |
constexpr CanId | operator>> (const T x) const |
Shifts this ID to the right by a 16-bit integer. | |
constexpr CanId | operator>> (const CanId &x) const |
Shifts this ID to the right by another. | |
template<typename T > | |
CanId | operator<<= (const T x) |
Shifts this ID to the left by a 16-bit integer. | |
CanId | operator<<= (const CanId &x) |
Shifts this ID to the left by another. | |
template<typename T > | |
CanId | operator>>= (const T x) |
Shifts this ID to the right by a 16-bit integer. | |
CanId | operator>>= (const CanId &x) |
Shifts this ID to the right by another. | |
constexpr bool | operator== (const CanId &x) const |
Compares this ID to another. | |
template<typename T > | |
constexpr bool | operator== (const T x) const |
Compares this ID to another. | |
constexpr bool | operator!= (const CanId &x) const |
Compares this ID to another. | |
template<typename T > | |
constexpr bool | operator!= (const T x) const |
Compares this ID to another. | |
template<typename T > | |
constexpr bool | operator< (T x) const |
Compares this ID to another. | |
template<typename T > | |
constexpr bool | operator> (T x) const |
Compares this ID to a 32-bit integer. | |
template<typename T > | |
constexpr bool | operator<= (const T x) const |
Compares this ID to another. | |
template<typename T > | |
constexpr bool | operator>= (const T x) const |
Compares this ID to another. | |
template<typename T > | |
constexpr CanId | operator= (const T val) |
Assigns a new integer to this CanID. | |
constexpr CanId | operator= (const int64_t val) |
Assigns a 64-bit integer to this ID. | |
template<typename T > | |
constexpr CanId | operator|= (const T x) |
Performs a bitwise OR operation on this ID and another. | |
template<typename T > | |
constexpr CanId | operator&= (const T x) |
Performs a bitwise AND operation on this ID and another. | |
template<typename T > | |
constexpr CanId | operator^= (const T x) |
Performs a bitwise XOR operation on this ID and another. | |
template<typename T > | |
constexpr CanId | operator+ (const T x) const |
template<typename T > | |
constexpr CanId | operator+= (const T x) |
template<typename T > | |
constexpr CanId | operator-= (const T x) |
template<typename T > | |
constexpr CanId | operator- (const T x) const |
template<typename T > | |
constexpr CanId | operator* (const T x) const |
template<typename T > | |
constexpr CanId | operator*= (const T x) |
template<typename T > | |
constexpr CanId | operator/ (const T x) const |
template<typename T > | |
constexpr CanId | operator/= (const T x) |
template<typename T > | |
constexpr CanId | operator% (const T x) const |
template<typename T > | |
constexpr CanId | operator%= (const T x) |
constexpr bool | hasErrorFrameFlag () const |
Indicates whether or not this ID is an error frame. | |
constexpr bool | hasRtrFrameFlag () const |
Indicates whether or not this ID is a remote transmission request. | |
constexpr bool | isStandardFrameId () const |
Indicates whether or not this ID is a standard frame ID. | |
constexpr bool | isExtendedFrameId () const |
Indicates whether or not this ID is an extended frame ID. | |
constexpr bool | equals (const CanId &otherId) const |
Compares this ID to another. | |
Static Public Member Functions | |
template<typename T > | |
static constexpr bool | isValidIdentifier (T value) |
Indicates whether or not a given integer is a valid CAN identifier. | |
template<typename T > | |
static constexpr bool | isErrorFrame (T value) |
Indicates whether or not a given integer contains the error frame flag or not. | |
template<typename T > | |
static constexpr bool | isRemoteTransmissionRequest (T value) |
Indicates whether the received frame is a remote transmission request. | |
template<typename T > | |
static constexpr bool | isExtendedFrame (T value) |
Indicates whether or not a given integer is an extended frame ID. | |
Private Attributes | |
uint32_t | m_identifier = 0 |
|
constexprdefault |
|
inlineconstexpr |
Definition at line 64 of file CanId.hpp.
References m_identifier.
Referenced by sockcanpp::CanMessage::CanMessage().
|
inlineconstexpr |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
Indicates whether or not this ID is an error frame.
Definition at line 250 of file CanId.hpp.
References isErrorFrame(), and m_identifier.
|
inlineconstexpr |
Indicates whether or not this ID is a remote transmission request.
Definition at line 251 of file CanId.hpp.
References isRemoteTransmissionRequest(), and m_identifier.
|
inlinestaticconstexpr |
Indicates whether or not a given integer contains the error frame flag or not.
value | The integer to check. |
Definition at line 219 of file CanId.hpp.
Referenced by hasErrorFrameFlag().
|
inlinestaticconstexpr |
Indicates whether or not a given integer is an extended frame ID.
value | The integer to check. |
Definition at line 245 of file CanId.hpp.
Referenced by isExtendedFrameId(), and isStandardFrameId().
|
inlineconstexpr |
Indicates whether or not this ID is an extended frame ID.
Definition at line 253 of file CanId.hpp.
References isExtendedFrame(), and m_identifier.
|
inlinestaticconstexpr |
Indicates whether the received frame is a remote transmission request.
value | The integer to check. |
Definition at line 232 of file CanId.hpp.
Referenced by hasRtrFrameFlag().
|
inlineconstexpr |
Indicates whether or not this ID is a standard frame ID.
Definition at line 252 of file CanId.hpp.
References isExtendedFrame(), and m_identifier.
|
inlinestaticconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Performs a bitwise AND operation on this ID and another.
Definition at line 87 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
Performs a bitwise AND operation on this ID and another.
Definition at line 86 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
Performs a bitwise AND operation on this ID and another.
Definition at line 158 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
Returns the raw CAN ID value.
Definition at line 75 of file CanId.hpp.
References m_identifier.
Referenced by sockcanpp::CanIdHasher::operator()(), and sockcanpp::CanDriver::setCanFilters().
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Shifts this ID to the left by another.
Definition at line 101 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
Shifts this ID to the left by a 16-bit integer.
Definition at line 100 of file CanId.hpp.
References m_identifier.
Shifts this ID to the left by another.
Definition at line 109 of file CanId.hpp.
References m_identifier.
|
inline |
Shifts this ID to the left by a 16-bit integer.
Definition at line 108 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
|
inlineconstexpr |
Assigns a 64-bit integer to this ID.
Definition at line 152 of file CanId.hpp.
References operator=().
|
inlineconstexpr |
Assigns a new integer to this CanID.
Definition at line 143 of file CanId.hpp.
Referenced by operator=().
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Compares this ID to a 32-bit integer.
Definition at line 132 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
Shifts this ID to the right by another.
Definition at line 105 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
Shifts this ID to the right by a 16-bit integer.
Definition at line 104 of file CanId.hpp.
References m_identifier.
Shifts this ID to the right by another.
Definition at line 113 of file CanId.hpp.
References m_identifier.
|
inline |
Shifts this ID to the right by a 16-bit integer.
Definition at line 112 of file CanId.hpp.
References m_identifier.
Performs a bitwise XOR operation on this ID and another.
Definition at line 95 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
Performs a bitwise XOR operation on this ID and a 16-bit integer.
Definition at line 94 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
Performs a bitwise XOR operation on this ID and another.
Definition at line 161 of file CanId.hpp.
References m_identifier.
Performs a bitwise OR operation on this ID and another.
Definition at line 91 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
Performs a bitwise OR operation on this ID and a 16-bit integer.
Definition at line 90 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
Performs a bitwise OR operation on this ID and another.
Definition at line 155 of file CanId.hpp.
References m_identifier.
|
inlineconstexpr |
Performs a bitwise NOT operation on this ID.
Definition at line 97 of file CanId.hpp.
References m_identifier.
|
private |
Definition at line 259 of file CanId.hpp.
Referenced by CanId(), CanId(), CanId(), equals(), hasErrorFrameFlag(), hasRtrFrameFlag(), isExtendedFrameId(), isStandardFrameId(), operator canid_t(), operator int16_t(), operator int32_t(), operator uint16_t(), operator!=(), operator!=(), operator%(), operator%=(), operator&(), operator&(), operator&=(), operator*(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<<(), operator<<(), operator<<=(), operator<<=(), operator<=(), operator==(), operator==(), operator>(), operator>=(), operator>>(), operator>>(), operator>>=(), operator>>=(), operator^(), operator^(), operator^=(), operator|(), operator|(), operator|=(), and operator~().