StaticBuffer.h
Go to the documentation of this file.00001 00017 #ifndef __StaticBuffer_H__ 00018 #define __StaticBuffer_H__ 00019 00020 // Includes 00021 #include "DynamicBuffer.h" 00022 00023 // Forward declares 00024 00025 // StaticBuffer 00026 class StaticBuffer 00027 { 00028 public: 00032 StaticBuffer( 00033 const DynamicBuffer& buffer 00034 ); 00035 00039 StaticBuffer( 00040 const void* buffer, 00041 int size 00042 ); 00043 00047 ~StaticBuffer(); 00048 00049 00055 int GetSize() const; 00056 00063 int GetPosition() const; 00064 00069 void SetPosition( 00070 int position 00071 ) const; 00072 00080 int Read( 00081 char* value, 00082 int count = 1 00083 ) const; 00084 00092 int Read( 00093 short* value, 00094 int count = 1 00095 ) const; 00096 00104 int Read( 00105 int* value, 00106 int count = 1 00107 ) const; 00108 00116 int Read( 00117 long* value, 00118 int count = 1 00119 ) const; 00120 00128 int Read( 00129 unsigned char* value, 00130 int count = 1 00131 ) const; 00132 00140 int Read( 00141 unsigned short* value, 00142 int count = 1 00143 ) const; 00144 00152 int Read( 00153 unsigned int* value, 00154 int count = 1 00155 ) const; 00156 00164 int Read( 00165 unsigned long* value, 00166 int count = 1 00167 ) const; 00168 00176 int Read( 00177 float* value, 00178 int count = 1 00179 ) const; 00180 00188 int Read( 00189 double* value, 00190 int count = 1 00191 ) const; 00192 00200 int Read( 00201 bool* value, 00202 int count = 1 00203 ) const; 00204 00210 const void* GetPointer() const; 00211 00212 private: 00213 int size_; 00214 mutable int position_; 00215 const unsigned char* buffer_; 00216 }; 00217 00218 00219 #endif /* __StaticBuffer_H__ */
Reproduction/republishing of any material on this site without permission is strictly prohibited.
