template <class T> Cyberfett::Numerics::Native::Vector<T>::Vector(T* data, int* refCount, const int from, const int length) : AbstractVector(length) { CheckIdx(from); CheckIdx(from + length - 1); this->data = data + from; this->refCount = refCount; *refCount += 1; }
const CVariant& CResultSet::GetVariant(const CDBParamVariant& param) { int index = 0; if (param.IsPositional()) { index = param.GetPosition(); } else { index = GetColNum(param.GetName()); } CheckIdx(index); --index; if (index < m_LastVariantNum) { x_CacheItems(index); } else { switch (m_RowReadType) { case eReadRaw: // Here we will be also when IsDisableBind() == true m_data[index].SetNull(); break; case eReadUnknown: m_RowReadType = eReadVariant; m_column = -1; // fall through //case eReadVariant: default: x_CacheItems(index); break; } } return m_data[index]; }
template <class T> void Cyberfett::Numerics::Native::Vector<T>::setValue(const int idx, void* value) { lazyCopy(); CheckIdx(idx); T* cast = (T*)value; data[idx] = *cast; }
/** Return pointer to the index-th data item - const version */ FORCEINLINE const T *Data(size_t index) const { CheckIdx(index); return (Data() + index); }
/** Return pointer to the index-th data item - non-const version */ FORCEINLINE T *Data(size_t index) { CheckIdx(index); return (Data() + index); }
/** return item by index (const version) */ FORCEINLINE const Titem& operator [] (int idx) const { CheckIdx(idx); return m_items[idx]; }
/** return item by index (non-const version) */ FORCEINLINE Titem& operator [] (int idx) { CheckIdx(idx); return m_items[idx]; }
/** Return pointer to the index-th data item - const version */ inline const T *Data(size_t index) const { CheckIdx(index); return (Data() + index); }
/** Return pointer to the index-th data item - non-const version */ inline T *Data(size_t index) { CheckIdx(index); return (Data() + index); }
template <class T> void Cyberfett::Numerics::Native::Vector<T>::getValue(const int idx, void* value) { CheckIdx(idx); T* cast = (T*)value; *cast = data[idx]; }