diff --git a/src/modules/uORB/Publication.hpp b/src/modules/uORB/Publication.hpp index 90f98603ba..0f2256af0a 100644 --- a/src/modules/uORB/Publication.hpp +++ b/src/modules/uORB/Publication.hpp @@ -48,6 +48,24 @@ namespace uORB { +template class DefaultQueueSize +{ +private: + template + static constexpr uint8_t get_queue_size(decltype(T::ORB_QUEUE_LENGTH) *) + { + return T::ORB_QUEUE_LENGTH; + } + + template static constexpr uint8_t get_queue_size(...) + { + return 1; + } + +public: + static constexpr unsigned value = get_queue_size(nullptr); +}; + class PublicationBase { public: @@ -79,7 +97,7 @@ protected: /** * uORB publication wrapper class */ -template +template::value> class Publication : public PublicationBase { public: diff --git a/src/modules/uORB/PublicationMulti.hpp b/src/modules/uORB/PublicationMulti.hpp index e54afd7365..b4aafe4e9a 100644 --- a/src/modules/uORB/PublicationMulti.hpp +++ b/src/modules/uORB/PublicationMulti.hpp @@ -50,7 +50,7 @@ namespace uORB /** * Base publication multi wrapper class */ -template +template::value> class PublicationMulti : public PublicationBase { public: