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;
}
示例#2
0
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;
}
示例#4
0
	/** Return pointer to the index-th data item - const version */
	FORCEINLINE const T *Data(size_t index) const
	{
		CheckIdx(index);
		return (Data() + index);
	}
示例#5
0
	/** Return pointer to the index-th data item - non-const version */
	FORCEINLINE T *Data(size_t index)
	{
		CheckIdx(index);
		return (Data() + index);
	}
示例#6
0
	/** return item by index (const version) */
	FORCEINLINE const Titem& operator [] (int idx) const { CheckIdx(idx); return m_items[idx]; }
示例#7
0
	/** return item by index (non-const version) */
	FORCEINLINE Titem& operator [] (int idx) { CheckIdx(idx); return m_items[idx]; }
示例#8
0
 /** Return pointer to the index-th data item - const version */
 inline const T *Data(size_t index) const
 {
     CheckIdx(index);
     return (Data() + index);
 }
示例#9
0
 /** 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];
}