Files
Last update 7 years 1 month
by
ivanfeofanov
Filesrobotutils | |
---|---|
.. | |
tree_menu | |
correlation_filter.cpp | |
correlation_filter.h | |
map.cpp | |
map.h | |
pid.cpp | |
pid.h | |
stack.h |
stack.h#ifndef STACK_H #define STACK_H template < typename T, size_t MAX_SIZE > class Stack { public: Stack() { count_ = 0; } void push(T value) { if(count_ != MAX_SIZE){ buffer_[count_] = value; count_++; } } T top() const { return buffer_[count_ - 1]; } void pop() { if(count_ != 0){ count_--; } } size_t size() const { return count_; } bool isEmpty() const { return count_ == 0; } private: T buffer_[MAX_SIZE]; uint16_t count_; }; #endif