#include <DCFbytepack.h>
Collaboration diagram for bytepack:

Public Member Functions | |
| bytepack (const bytepack &rhs) | |
| bytepack (const int sizemax=BYTEPACK_DEFAULT_SIZEMAX) | |
| bytepack (const int sizemax=16) | |
| char * | c_str () |
| char * | c_str () |
| operator char () | |
| operator char () | |
| operator double () | |
| operator double () | |
| operator float () | |
| operator float () | |
| operator int () | |
| operator int () | |
| bytepack & | operator() (const double data=0, const int size=sizeof(double)) |
| bytepack & | operator() (const float data=0, const int size=sizeof(float)) |
| bytepack & | operator() (const int data=0, const int size=sizeof(int)) |
| bytepack & | operator() (const char data=0, const int size=sizeof(char)) |
| bytepack & | operator() (const double data=0, const int size=0) |
| bytepack & | operator() (const float data=0, const int size=0) |
| bytepack & | operator() (const int data=0, const int size=0) |
| bytepack & | operator() (const char data=0, const int size=0) |
| bytepack & | operator= (const bytepack) |
| char & | operator[] (const int i) |
| char & | operator[] (const int i) |
| void | read (istream &) |
| int | size () |
| int | size () |
| void | write (ostream &) |
| ~bytepack () | |
| ~bytepack () | |
Private Attributes | |
| char * | _data |
| char * | _pt |
| int | _size |
| int | _sizemax |
Friends | |
| ostream & | operator<< (ostream &, bytepack &) |
| ostream & | operator<< (ostream &, bytepack &) |
| istream & | operator>> (istream &, bytepack &) |
| istream & | operator>> (istream &, bytepack &) |
|
|
Definition at line 42 of file DCFbytepack.h.
|
|
|
Definition at line 50 of file DCFbytepack.h. References _pt.
|
|
|
|
|
|
Definition at line 52 of file utility.cpp. References _data, and _sizemax.
|
|
|
|
|
|
Definition at line 36 of file utility.h.
00036 { return _data; }
|
|
|
Definition at line 30 of file DCFbytepack.h. References _pt.
00030 { return _pt; }
|
|
|
|
|
|
Definition at line 118 of file DCFbytepack.cpp. References _pt.
00118 { return char(_pt[0]); }
|
|
|
|
|
|
Definition at line 168 of file DCFbytepack.cpp.
00168 {
00169 double data=0;
00170 char* ptdata = (char*)(&data);
00171 #ifdef STORM_RS6000_AIX
00172 for( int i = 0; i < min( _size, int(sizeof(double)) ); i++ ) {
00173 ptdata[i] = _pt[i];
00174 }
00175 #endif
00176 #ifdef STORM_x86_LINUX
00177 for( int i = 0; i < min( _size, int(sizeof(double)) ); i++ ) {
00178 ptdata[ sizeof(double) - 1 - i ] = _pt[i];
00179 }
00180 #endif
00181 #ifdef STORM_SGI_IRIX
00182 for( int i = 0; i < min( _size, int(sizeof(double)) ); i++ ) {
00183 ptdata[i] = _pt[i];
00184 }
00185 #endif
00186 return data;
00187 };
|
|
|
|
|
|
Definition at line 147 of file DCFbytepack.cpp.
00147 {
00148 float data = 0;
00149 char* ptdata = (char*)(&data);
00150 #ifdef STORM_RS6000_AIX
00151 for( int i = 0; i < min( _size, int(sizeof(float)) ); i++ ) {
00152 ptdata[i] = _pt[i];
00153 }
00154 #endif
00155 #ifdef STORM_x86_LINUX
00156 for( int i = 0; i < min( _size, int(sizeof(float)) ); i++ ) {
00157 ptdata[ sizeof(float) - 1 - i ] = _pt[i];
00158 }
00159 #endif
00160 #ifdef STORM_SGI_IRIX
00161 for( int i = 0; i < min( _size, int(sizeof(float)) ); i++ ) {
00162 ptdata[i] = _pt[i];
00163 }
00164 #endif
00165 return data;
00166 };
|
|
|
|
|
|
Definition at line 120 of file DCFbytepack.cpp.
00120 {
00121 int data;
00122 char* ptdata = (char*)(&data);
00123 if ((_pt[_size-1]&0x80)) {
00124 for( int i = 0; i < sizeof(int); i++ ) ptdata[i] = 0xFF;
00125 }
00126 else {
00127 for( int i = 0; i < sizeof(int); i++ ) ptdata[i] = 0x00;
00128 }
00129 #ifdef STORM_RS6000_AIX
00130 for( int i = 0; i < min( _size, int(sizeof(int)) ); i++ ) {
00131 ptdata[ sizeof(int) - 1 - i ] = _pt[i];
00132 }
00133 #endif
00134 #ifdef STORM_x86_LINUX
00135 for( int i = 0; i < min( _size, int(sizeof(int)) ); i++ ) {
00136 ptdata[i] = _pt[i];
00137 }
00138 #endif
00139 #ifdef STORM_SGI_IRIX
00140 for( int i = 0; i < min( _size, int(sizeof(int)) ); i++ ) {
00141 ptdata[ sizeof(int) - 1 - i ] = _pt[i];
00142 }
00143 #endif
00144 return data;
00145 };
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
Definition at line 93 of file DCFbytepack.cpp.
00093 {
00094 double data = data0;
00095 char* ptdata = (char*)(&data);
00096 for( int i = 0; i <= size; i++ ) _pt[i] = 0;
00097 #ifdef STORM_RS6000_AIX
00098 for( int i = 0; i < min( size, int(sizeof(double)) ); i++ ) {
00099 _pt[i] = ptdata[i];
00100 }
00101 _size = size;
00102 #endif
00103 #ifdef STORM_x86_LINUX
00104 for( int i = 0; i < min( size, int(sizeof(double)) ); i++ ) {
00105 _pt[i] = ptdata[ sizeof(double) - 1 - i ];
00106 }
00107 _size = size;
00108 #endif
00109 #ifdef STORM_SGI_IRIX
00110 for( int i = 0; i < min( size, int(sizeof(double)) ); i++ ) {
00111 _pt[i] = ptdata[i];
00112 }
00113 _size = size;
00114 #endif
00115 return *this;
00116 };
|
|
||||||||||||
|
Definition at line 62 of file DCFbytepack.cpp.
00062 {
00063 float data = data0;
00064 char* ptdata = (char*)(&data);
00065 for( int i = 0; i <= size; i++ ) _pt[i] = 0;
00066 #ifdef STORM_RS6000_AIX
00067 for( int i = 0; i < min( size, int(sizeof(float)) ); i++ ) {
00068 _pt[i] = ptdata[i];
00069 }
00070 _size = size;
00071 #endif
00072 #ifdef STORM_x86_LINUX
00073 for( int i = 0 ; i < min( size, int(sizeof(float)) ); i++ ) {
00074 _pt[i] = ptdata[ sizeof(float) - 1 - i ];
00075 }
00076 _size = size;
00077 #endif
00078 #ifdef STORM_SGI_IRIX
00079 for( i = 0; i < min( size, int(sizeof(float)) ); i++ ) {
00080 _pt[i] = ptdata[i];
00081 }
00082 _size = size;
00083 #endif
00084 //#ifdef STORM_DEBUG
00085 // cout << "bytepack::operator(): float : data0 _size _pt[] "
00086 // << data0 << ' ' << _size << ' ';
00087 // for(i=0;i<_size;i++) { cout << int( (unsigned char)(_pt[i]) ) << ' '; }
00088 // cout << '\n';
00089 //#endif
00090 return *this;
00091 };
|
|
||||||||||||
|
Definition at line 37 of file DCFbytepack.cpp.
00037 {
00038 int data = data0;
00039 char* ptdata = (char*)(&data);
00040 for(int i=0;i<=size;i++) _pt[i] = 0;
00041 #ifdef STORM_RS6000_AIX
00042 for(int i = 0; i < min( size, int(sizeof(int)) ); i++ ) {
00043 _pt[i] = ptdata[ sizeof(int) - 1 - i ];
00044 }
00045 _size = size;
00046 #endif
00047 #ifdef STORM_x86_LINUX
00048 for( int i = 0; i < min( size, int(sizeof(int)) ); i++ ) {
00049 _pt[i] = ptdata[i];
00050 }
00051 _size = size;
00052 #endif
00053 #ifdef STORM_SGI_IRIX
00054 for( int i = 0; i < min( size, int(sizeof(int)) ); i++ ) {
00055 _pt[i] = ptdata[ sizeof(int) - 1 - i ];
00056 }
00057 _size = size;
00058 #endif
00059 return *this;
00060 };
|
|
||||||||||||
|
Definition at line 29 of file DCFbytepack.cpp.
|
|
|
Definition at line 144 of file utility.cpp. References _data, _size, and _sizemax.
|
|
|
Definition at line 35 of file utility.h.
00035 { return _data[i]; }
|
|
|
Definition at line 29 of file DCFbytepack.h. References _pt.
00029 { return _pt[i]; }
|
|
|
Definition at line 230 of file utility.cpp. References _size. Referenced by operator>>().
|
|
|
Definition at line 43 of file utility.h. References _size.
00043 { return _size; }
|
|
|
|
Definition at line 225 of file utility.cpp. References _size. Referenced by operator<<().
00226 {
00227 for( int i = 0; i < _size; i++ ) os.put( _data[i] );
00228 }
|
|
||||||||||||
|
Definition at line 189 of file DCFbytepack.cpp.
|
|
||||||||||||
|
Definition at line 189 of file DCFbytepack.cpp.
|
|
||||||||||||
|
Definition at line 199 of file DCFbytepack.cpp.
|
|
||||||||||||
|
Definition at line 199 of file DCFbytepack.cpp.
|
|
|
Definition at line 49 of file utility.h. Referenced by bytepack(), and operator=(). |
|
|
Definition at line 36 of file DCFbytepack.h. Referenced by bytepack(), c_str(), operator char(), operator double(), operator float(), operator int(), operator()(), operator<<(), operator>>(), operator[](), and ~bytepack(). |
|
|
Definition at line 51 of file utility.h. Referenced by operator double(), operator float(), operator int(), operator()(), operator<<(), operator=(), operator>>(), read(), size(), and write(). |
|
|
Definition at line 50 of file utility.h. Referenced by bytepack(), and operator=(). |
1.3.6