mirror of
https://github.com/westonrobot/ugv_sdk
synced 2023-04-08 06:32:14 +08:00
added type check for parser in AgilexBase
This commit is contained in:
@@ -24,12 +24,21 @@
|
|||||||
|
|
||||||
#include "ugv_sdk/details/async_port/async_can.hpp"
|
#include "ugv_sdk/details/async_port/async_can.hpp"
|
||||||
#include "ugv_sdk/details/interface/robot_common_interface.hpp"
|
#include "ugv_sdk/details/interface/robot_common_interface.hpp"
|
||||||
|
#include "ugv_sdk/details/interface/parser_interface.hpp"
|
||||||
|
|
||||||
namespace westonrobot {
|
namespace westonrobot {
|
||||||
template <typename ParserType>
|
template <typename ParserType>
|
||||||
class AgilexBase : public RobotCommonInterface {
|
class AgilexBase : public RobotCommonInterface {
|
||||||
public:
|
public:
|
||||||
AgilexBase() = default;
|
AgilexBase() {
|
||||||
|
static_assert(
|
||||||
|
std::is_base_of<ParserInterface<ProtocolVersion::AGX_V1>,
|
||||||
|
ParserType>::value ||
|
||||||
|
std::is_base_of<ParserInterface<ProtocolVersion::AGX_V2>,
|
||||||
|
ParserType>::value,
|
||||||
|
"Incompatible parser for the AgilexBase class, expecting one derived "
|
||||||
|
"from ParserInterface!");
|
||||||
|
};
|
||||||
virtual ~AgilexBase() { DisconnectPort(); }
|
virtual ~AgilexBase() { DisconnectPort(); }
|
||||||
|
|
||||||
// do not allow copy or assignment
|
// do not allow copy or assignment
|
||||||
|
|||||||
Reference in New Issue
Block a user