namespace canary
{
template <class Protocol>
class basic_endpoint;
}
template <class Protocol>
class basic_endpoint
{
public:
using protocol_type = Protocol;
using data_type = ::sockaddr;
basic_endpoint();
basic_endpoint(unsigned int interface_index);
protocol_type protocol() const noexcept;
unsigned int interface_index() const noexcept;
data_type* data() noexcept;
data_type* data() const noexcept;
std::size_t size() const noexcept;
std::size_t capacity() const noexcept;
void resize(std::size_t n);
};
Describes an endpoint for a CAN bus interface that can be bound to a CAN socket.
using protocol_type = Protocol;
The protocol type associated with the endpoint.
using data_type = ::sockaddr;
Underlying type used to store the endpoint information.
basic_endpoint();
Default constructor
basic_endpoint(unsigned int interface_index);
Construct an endpoint that represents a particular CAN interface index.
protocol_type protocol() const noexcept;
Constructs an object of the protocol type associated with this endpoint.
unsigned int interface_index() const noexcept;
Returns the interface index that this endpoint represents.
data_type* data() noexcept;
Get the underlying endpoint in the native type.
data_type* data() const noexcept;
Get the underlying endpoint in the native type.
std::size_t size() const noexcept;
Get the underlying size of the endpoint in the native type.
std::size_t capacity() const noexcept;
Get the underlying capacity of the endpoint in the native type.
void resize(std::size_t n);
Set the underlying size of the endpoint in the native type.