00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifdef DOXYGEN
00024 #include <netlink/smart_buffer.h>
00025 NL_NAMESPACE_USE
00026 #endif
00027
00028
00035 inline const void* SmartBuffer::operator*() const {
00036
00037 return _buffer;
00038 }
00039
00040
00050 inline const char* SmartBuffer::operator[](size_t index) const {
00051
00052 if(index >= _usedSize)
00053 throw Exception(Exception::OUT_OF_RANGE, "SmartBuffer::operator[]: index out of range");
00054
00055 return (char*) _buffer + index;
00056 }
00057
00064 inline const void* SmartBuffer::buffer() const {
00065
00066 return _buffer;
00067 }
00068
00075 inline size_t SmartBuffer::size() const {
00076
00077 return _usedSize;
00078 }
00079
00086 inline void SmartBuffer::clear() {
00087
00088 _usedSize = 0;
00089 }
00090