Buffer.cpp
Go to the documentation of this file.
00001 
00024 #include "Buffer.h"
00025 
00026 template <class T>
00027 Buffer<T>::Buffer(uint32_t size)
00028 {
00029     _buf = new T [size];
00030     _size = size;
00031     clear();
00032     
00033     return;
00034 }
00035 
00036 template <class T>
00037 Buffer<T>::~Buffer()
00038 {
00039     delete [] _buf;
00040     
00041     return;
00042 }
00043 
00044 template <class T>
00045 uint32_t Buffer<T>::getSize() 
00046 { 
00047     return this->_size; 
00048 }
00049 
00050 template <class T>
00051 void Buffer<T>::clear(void)
00052 {
00053     _wloc = 0;
00054     _rloc = 0;
00055     memset(_buf, 0, _size);
00056     
00057     return;
00058 }
00059 
00060 template <class T>
00061 uint32_t Buffer<T>::peek(char c)
00062 {
00063     return 1;
00064 }
00065 
00066 // make the linker aware of some possible types
00067 template class Buffer<uint8_t>;
00068 template class Buffer<int8_t>;
00069 template class Buffer<uint16_t>;
00070 template class Buffer<int16_t>;
00071 template class Buffer<uint32_t>;
00072 template class Buffer<int32_t>;
00073 template class Buffer<uint64_t>;
00074 template class Buffer<int64_t>;
00075 template class Buffer<char>;
00076 template class Buffer<wchar_t>;


rosserial_mbed
Author(s): Gary Servin
autogenerated on Sat Oct 7 2017 03:08:46