1 #ifndef _OCRABASE_BUFFER_H_ 2 #define _OCRABASE_BUFFER_H_ 33 Buffer(
size_t size): buf_(new value_type[size]), size_(size), index_(0) {}
47 size_t nsize = size_ + 1;
52 buf_ =
new value_type[nsize];
70 if((index_ + n) > size_)
71 throw std::runtime_error(
"[ocra::Buffer::allocate] Insufficient memory, please resize before allocation");
72 ptr_type result = buf_ + index_;
86 return size_ - index_;
96 #endif //_OCRABASE_BUFFER_H_
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
ptr_type allocate(size_t n)