📄 idb_streamraw.i
字号:
#line 49 "D:/Progra~1/Micros~2/VC98/Include\\new.h"
typedef void (__cdecl * new_handler) ();
new_handler __cdecl set_new_handler(new_handler);
#line 72 "D:/Progra~1/Micros~2/VC98/Include\\new.h"
inline void *__cdecl operator new(size_t, void *_P)
{return (_P); }
inline void __cdecl operator delete(void *, void *)
{return; }
#line 81 "D:/Progra~1/Micros~2/VC98/Include\\new.h"
#line 82 "D:/Progra~1/Micros~2/VC98/Include\\new.h"
int __cdecl _query_new_mode( void );
int __cdecl _set_new_mode( int );
typedef int (__cdecl * _PNH)( size_t );
#line 95 "D:/Progra~1/Micros~2/VC98/Include\\new.h"
_PNH __cdecl _query_new_handler( void );
_PNH __cdecl _set_new_handler( _PNH );
#line 110 "D:/Progra~1/Micros~2/VC98/Include\\new.h"
#line 112 "D:/Progra~1/Micros~2/VC98/Include\\new.h"
#line 114 "D:/Progra~1/Micros~2/VC98/Include\\new.h"
#line 7 "D:/working/tools/isim\\vector.cpp"
template<class T>
VPtr<T>::VPtr(const VPtr& p)
{
idx = p.idx;
v = p.v;
}
template<class T>
VPtr<T>& VPtr<T>::operator=(const VPtr& p)
{
idx = p.idx;
v = p.v;
return *this;
}
template<class T>
VPtr<T>& VPtr<T>::operator++()
{
if (v)
{
((void)0);
idx++;
if (idx >= (int)v->used)
{
idx = -1;
v = 0;
}
}
return *this;
}
template<class T>
VPtr<T>& VPtr<T>::operator--()
{
if (v)
{
((void)0);
idx--;
if (idx < 0)
{
idx = -1;
v = 0;
}
}
return *this;
}
template<class T>
T& VPtr<T>::operator*()
{
if (v)
{
((void)0);
return v->data[idx];
}
((void)0);
return v->data[0];
}
template<class T>
T *VPtr<T>::operator->()
{
if (v)
{
((void)0);
return &(v->data[idx]);
}
((void)0);
return &(v->data[0]);
}
template<class T>
bool VPtr<T>::valid()
{
if (v)
{
((void)0);
if ((idx < 0) || (idx >= (int)v->used))
{
idx = -1;
v = 0;
return false;
}
return true;
}
return false;
}
template<class T>
bool VPtr<T>::operator==(const VPtr& p)
{
if (valid() && p.valid())
{
if (idx == p.idx)
return true;
else
return false;
}
return false;
}
template<class T>
bool VPtr<T>::operator!=(const VPtr& p)
{
return !(*this == p);
}
template<class T>
bool VPtr<T>::operator<(const VPtr& p)
{
valid();
p.valid();
((void)0);
return idx < p.idx;
}
template<class T>
bool VPtr<T>::operator>(const VPtr& p)
{
valid();
p.valid();
((void)0);
return idx > p.idx;
}
template<class T>
T *vector<T>::allocate(unsigned int n)
{
T *ptr = 0;
if (n > 0)
{
ptr = ((T *) operator new(n * sizeof(T)));
}
return ptr;
}
template<class T>
void vector<T>::destroy()
{
clear();
}
template<class T>
void vector<T>::copy(const vector& v)
{
sz = v.used;
used = v.used;
data = 0;
data = allocate(sz);
delop = &operator delete;
T *ptr = data;
for(unsigned int i=0; i<used; i++, ptr++)
ptr = new ((void *) ptr) T(v.data[i]);
}
template<class T>
vector<T>::vector()
{
sz = 0;
used = 0;
data = 0;
}
template<class T>
vector<T>::vector(const unsigned int n, const T& el)
{
sz = n;
used = n;
data = 0;
data = allocate(sz);
delop = &operator delete;
T *ptr = data;
for (unsigned int i=0; i<n; i++, ptr++)
ptr = new ((void *) ptr) T(el);
}
template<class T>
vector<T>::vector(const vector& v): data(0), sz(0), used(0)
{
copy(v);
}
template<class T>
vector<T>::vector(const portable_vector& pv)
{
((void)0);
sz = pv.len;
used = pv.len;
data = 0;
data = allocate(sz);
delop = &operator delete;
T *ptr = data;
T *el = (T *) pv.data;
for (unsigned int i=0; i<sz; i++, ptr++, el++)
ptr = new ((void *) ptr) T(*el);
}
template<class T>
vector<T>::~vector()
{
destroy();
sz = 0;
used = 0;
}
template<class T>
void vector<T>::clear_portable_vector(portable_vector& pv)
{
if (pv.data)
{
((void)0);
T *ptr = (T *)pv.data;
for (unsigned int i=0; i<pv.len; i++, ptr++)
ptr->~T();
pv.delop(pv.data);
pv.delop = 0;
}
pv.data = 0;
pv.datasz = 0;
pv.len = 0;
}
template<class T>
vector<T>& vector<T>::operator=(const vector& v)
{
destroy();
sz = 0;
used = 0;
copy(v);
return *this;
}
template<class T>
void vector<T>::clear()
{
T *ptr = data;
for (unsigned int i=0; i<used; i++, ptr++)
ptr->~T();
used = 0;
if (data) {
delop(data);
delop = &operator delete;
}
data = 0;
sz = 0;
}
template<class T>
T& vector<T>::back()
{
((void)0);
return data[used-1];
}
template<class T>
T& vector<T>::front()
{
((void)0);
return data[0];
}
template<class T>
void vector<T>::push_back(const T& el)
{
T *ptr;
if (used == sz)
{
sz = sz ? (sz*2) : 4;
T *newdata = allocate(sz);
ptr = newdata;
for (unsigned int i=0; i<used; i++, ptr++)
ptr = new ((void *) ptr) T(data[i]);
int newsize = sz;
int newused = used;
destroy();
delop = &operator delete;
sz = newsize;
used = newused;
data = newdata;
}
ptr = &data[used++];
ptr = new ((void *) ptr) T(el);
}
template<class T>
void vector<T>::push_back(const vector<T>& v)
{
for (int i = 0; i < v.size(); i++) {
push_back(v[i]);
}
}
template<class T>
T vector<T>::pop_back()
{
((void)0);
T *ptr = &data[--used];
T val = *ptr;
ptr->~T();
if ((used < (sz/4)) && (sz > 4))
{
sz /= 2;
T *newdata = allocate(sz);
ptr = newdata;
for (unsigned int i=0; i<used; i++, ptr++)
ptr = new ((void *) ptr) T(data[i]);
int newsize = sz;
int newused = used;
destroy();
delop = &operator delete;
sz = newsize;
used = newused;
data = newdata;
}
return val;
}
template<class T>
T& vector<T>::operator[](const unsigned int i)
{
((void)0);
return data[i];
}
template<class T>
const T& vector<T>::operator[](const unsigned int i) const
{
((void)0);
return data[i];
}
template<class T>
VPtr<T> vector<T>::begin()
{
VPtr<T> p;
if (used)
{
p.idx = 0;
p.v = this;
}
return p;
}
template<class T>
VPtr<T> vector<T>::end()
{
VPtr<T> p;
if (used)
{
p.idx = used-1;
p.v = this;
}
return p;
}
template<class T>
VPtr<T> vector<T>::getPtr(const unsigned int i)
{
VPtr<T> p;
if (i < used)
{
p.idx = i;
p.v = this;
}
return p;
}
template<class T>
vector<T>::operator portable_vector() const
{
portable_vector pv;
pv.datasz = sizeof(T);
pv.len = used;
pv.data = operator new(used * sizeof(T));
pv.delop = &operator delete;
T *ptr = data;
T *el = (T *) pv.data;
for (unsigned int i=0; i<sz; i++, ptr++, el++)
el = new ((void *) el) T(*ptr);
return pv;
}
template<class T>
char* vector<T>::writeBin(const unsigned int bin_size)
{
destroy();
unsigned int T_size = bin_size / sizeof(T) + (bin_size % sizeof(T) == 0 ? 0 : 1);
sz = T_size + 4;
used = T_size;
data = allocate(sz);
delop = &operator delete;
return((char*)data);
}
template<class T>
char* vector<T>::readBin(unsigned int& bin_size)
{
bin_size = used * sizeof(T);
return((char*)data);
}
#line 145 "D:/working/tools/isim\\vector.hpp"
#line 147 "D:/working/tools/isim\\vector.hpp"
#line 39 "D:/working/tools/isim\\misc.hpp"
int __declspec(dllexport) divRoundUp(int a, int b);
int __declspec(dllexport) exactLog2(int a);
int __declspec(dllexport) ceilLog2(int a);
int __declspec(dllexport) bitReverse(int numBits, int a);
void __declspec(dllexport) test_error(bool condition, char* error_msg, ...);
void __declspec(dllexport) test_warning(bool condition, char* error_msg, ...);
void __declspec(dllexport) swap(int& a, int& b);
int __declspec(dllexport) roundUpToNearest(int a, int b);
String __declspec(dllexport) cutTo(String& main, const String& sub);
void __declspec(dllexport) printIndent(ostream& out, int indent);
void __declspec(dllexport) expandFSpec(String fspec, vector<String>& fnames);
template<class T>
void deleteVectObjPtr(vector<T*>& vect)
{
int vectSize = vect.size();
if (true) for (int i = 0; i < vectSize; ++i) {
T* obj = vect[i];
delete obj;
vect[i] = 0;
}
vect.clear();
}
template <class T>
void streamIOBasic(T& t, istream* i, ostream* o, unsigned int indent)
{
if (i) {
*i >> t;
} else {
*o << t << " ";
}
}
#pragma warning (disable: 4800)
template <class T>
void streamIOEnum(T& t, istream* i, ostream* o, unsigned int indent)
{
if (i) {
unsigned int dummy;
*i >> dummy;
t = (T)dummy;
} else {
unsigned int dummy = (unsigned int)t;
*o << dummy << " ";
}
}
#line 122 "D:/working/tools/isim\\misc.hpp"
#line 14 "D:/working/tools/isim/isimhostdll2/sc_streamraw.hpp"
typedef unsigned int uint;
typedef unsigned __int32 uint32;
enum IOTypeEnum
{
ioIn,
ioOut,
ioBoth,
ioInvalid
};
enum StreamFlagsEnum
{
im_countup = 1,
im_align = 8,
im_incr = 16,
im_cacheable = 1024,
im_countup_align = im_countup | im_align,
im_countup_incr = im_countup | im_incr,
im_align_incr = im_align | im_incr,
im_countup_align_incr = im_countup | im_align | im_incr,
im_countup_align_cacheable = im_countup | im_align | im_cacheable,
im_countup_incr_cacheable = im_countup | im_incr | im_cacheable,
im_align_incr_cacheable = im_align | im_incr | im_cacheable,
im_countup_align_incr_cacheable = im_countup | im_align | im_incr | im_cacheable,
};
enum StreamPrivateFlagsEnum
{
im_pvt_fixed = 0,
im_pvt_var_size = 2,
im_pvt_var_pos = 4,
im_pvt_strip_none = 64,
im_pvt_strip_extra = 128,
im_pvt_strip_ignore = 256
};
enum StreamAccessEnum
{
im_acc_stride = 0,
im_acc_index = 1,
im_acc_bit_reverse = 2
};
enum OpAndStoreEnum { memop_none, memop_int32_add, memop_uint32_add, memop_fp32_add };
const int DefaultStride = (1 << 30);
class __declspec(dllexport) StreamRaw
{
public:
bool valid;
unsigned int start;
unsigned int end;
unsigned int size;
StreamAccessEnum accessType;
int stride;
StreamRaw* index;
unsigned int recLength;
unsigned int flags;
bool countup;
bool varSize;
bool varPos;
bool varAlign;
bool varIncr;
bool cacheable;
String debugName;
StreamRaw();
StreamRaw(const StreamRaw& s);
virtual ~StreamRaw();
StreamRaw& operator=(const StreamRaw& s);
void initNew(unsigned int _size, unsigned int _flags,
unsigned int _recLength);
void initCopy(const StreamRaw* s);
virtual StreamRaw* allocCopy();
void initDerived(const StreamRaw* s,
unsigned int _start, unsigned int _end, unsigned int _flags,
StreamAccessEnum _accessType, int _stride, StreamRaw* _index,
unsigned int _recLength, bool coordWords);
void updateSize();
virtual void destroy();
unsigned int getSize(bool coordWords = false);
String& getName() { return debugName; }
};
int streamDist(int p0, int p1, StreamRaw& s, int blockSize, int numClusters);
int streamSize(int p0, int p1, StreamRaw& s, int blockSize);
#line 157 "D:/working/tools/isim/isimhostdll2/sc_streamraw.hpp"
#line 16 "D:/working/tools/isim/isimhostdll2/idb_streamraw.hpp"
class IDebugScheduler;
class IdbStreamData;
class __declspec(dllexport) IdbStreamRaw : public StreamRaw
{
public:
IdbStreamData* streamData;
int streamDataImIdx;
int streamDataSize;
bool derived;
#line 50 "D:/working/tools/isim/isimhostdll2/idb_streamraw.hpp"
unsigned int length;
AsynchConsumer consumer;
IdbStreamRaw();
IdbStreamRaw(IdbStreamRaw& s);
~IdbStreamRaw();
IdbStreamRaw& operator=(IdbStreamRaw& s);
void initNew(unsigned int _size, unsigned int _flags,
unsigned int _recLength);
void initCopy(IdbStreamRaw* s);
StreamRaw* allocCopy();
void initDerived(const IdbStreamRaw* s,
unsigned int _start, unsigned int _end, unsigned int _flags,
StreamAccessEnum _accessType, int _stride, IdbStreamRaw* _index,
unsigned int _recLength, bool coordWords);
void destroy();
unsigned int const getLength(bool coordWords = false);
int const getLengthDebugOnly(bool coordWords = false);
int resolvePos(int pos, unsigned int numClusters,
unsigned int clusterRecLength);
inline unsigned int const __getLength() { return length; }
inline void __setLength(unsigned int _length) { length = _length; }
};
#line 122 "D:/working/tools/isim/isimhostdll2/idb_streamraw.hpp"
#line 6 "D:/working/tools/isim/isimhostdll2/idb_streamraw.cpp"
#line 1 "D:/working/tools/isim\\misc.hpp"
#line 7 "D:/working/tools/isim/isimhostdll2/idb_streamraw.cpp"
#line 1 "D:/working/tools/isim/isimhostdll2/idb_types.hpp"
#line 16 "D:/working/tools/isim/isimhostdll2/idb_types.hpp"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -