Ejemplo n.º 1
0
bool NFCRecord::SetVector3(const int nRow, const int nCol, const NFVector3& value)
{
	if (!ValidPos(nRow, nCol))
	{
		return false;
	}

	if (TDATA_VECTOR3 != GetColType(nCol))
	{
		return false;
	}

	if (!IsUsed(nRow))
	{
		return false;
	}

	NFData var;
	var.SetVector3(value);

	NF_SHARE_PTR<NFData>& pVar = mtRecordVec.at(GetPos(nRow, nCol));

	//must have memory
	if (nullptr == pVar)
	{
		return false;
	}

	if (var == *pVar)
	{
		return false;
	}

	if (mtRecordCallback.size() == 0)
	{
		pVar->SetVector3(value);
	}
	else
	{
		NFData oldValue;
		oldValue.SetVector3(pVar->GetVector3());

		pVar->SetVector3(value);

		RECORD_EVENT_DATA xEventData;
		xEventData.nOpType = RECORD_EVENT_DATA::Update;
		xEventData.nRow = nRow;
		xEventData.nCol = nCol;
		xEventData.strRecordName = mstrRecordName;

		OnEventHandler(mSelf, xEventData, oldValue, *pVar);
	}

	return true;
}
Ejemplo n.º 2
0
bool NFCRecord::SetObject(const int nRow, const int nCol, const NFGUID& value)
{
    if (!ValidPos(nRow, nCol))
    {
        return false;
    }

    if (TDATA_OBJECT != GetColType(nCol))
    {
        return false;
    }

    if (!IsUsed(nRow))
    {
        return false;
    }

    NFIDataList::TData var;
    var.SetObject(value);

    NF_SHARE_PTR<NFIDataList::TData>& pVar = mtRecordVec.at(GetPos(nRow, nCol));

	//must have memory
	if (nullptr == pVar)
	{
		return false;
	}

	if (var == *pVar)
	{
		return false;
	}

    NFCDataList::TData oldValue;
    oldValue.SetObject(pVar->GetObject());

    pVar->variantData = value;

    RECORD_EVENT_DATA xEventData;
    xEventData.nOpType = Update;
    xEventData.nRow = nRow;
    xEventData.nCol = nCol;
    xEventData.strRecordName = mstrRecordName;

    OnEventHandler(mSelf, xEventData, oldValue, *pVar);

    return true;
}
Ejemplo n.º 3
0
const NFVector3& NFCRecord::GetVector3(const int nRow, const int nCol) const
{
	if (!ValidPos(nRow, nCol))
	{
		return NULL_VECTOR3;
	}

	if (!IsUsed(nRow))
	{
		return NULL_VECTOR3;
	}

	const  NF_SHARE_PTR<NFData>& pVar = mtRecordVec.at(GetPos(nRow, nCol));
	if (!pVar)
	{
		return NULL_VECTOR3;
	}

	return pVar->GetVector3();
}
Ejemplo n.º 4
0
const NFGUID& NFCRecord::GetObject(const int nRow, const int nCol) const
{
    if (!ValidPos(nRow, nCol))
    {
        return NULL_OBJECT;
    }

    if (!IsUsed(nRow))
    {
        return NULL_OBJECT;
    }

    const  NF_SHARE_PTR<NFData>& pVar = mtRecordVec.at(GetPos(nRow, nCol));
    if (!pVar)
    {
        return NULL_OBJECT;
    }

    return pVar->GetObject();
}
Ejemplo n.º 5
0
const std::string& NFCRecord::GetString(const int nRow, const int nCol) const
{
    if (!ValidPos(nRow, nCol))
    {
        return NULL_STR;
    }

    if (!IsUsed(nRow))
    {
        return NULL_STR;
    }

    const NF_SHARE_PTR<NFData>& pVar = mtRecordVec.at(GetPos(nRow, nCol));
    if (!pVar)
    {
        return NULL_STR;
    }

    return pVar->GetString();
}
Ejemplo n.º 6
0
double NFCRecord::GetFloat(const int nRow, const int nCol) const
{
    if (!ValidPos(nRow, nCol))
    {
        return 0.0f;
    }

    if (!IsUsed(nRow))
    {
        return 0.0f;
    }

    const NF_SHARE_PTR<NFData>& pVar = mtRecordVec.at(GetPos(nRow, nCol));
    if (!pVar)
    {
        return 0.0f;
    }

    return pVar->GetFloat();
}
Ejemplo n.º 7
0
NFINT64 NFCRecord::GetInt(const int nRow, const int nCol) const
{
    if (!ValidPos(nRow, nCol))
    {
        return 0;
    }

    if (!IsUsed(nRow))
    {
        return 0;
    }

    const NF_SHARE_PTR<NFIDataList::TData>& pVar = mtRecordVec.at(GetPos(nRow, nCol));
    if (!pVar.get())
    {
        return 0;
    }

    return pVar->GetInt();
}