DRef DataManager::Import(QDataStream& in) { qint32 type; qint32 version; in >> version; in >> type; if (type == BOI_STD_D(Invalid)) { return DRef(); } // TODO: If the type is a recognized StandardDataType then // the uuid read should be skipped to avoid any extra // unnecessary processing (see QDataStream::skipRawData // and the QString section in "Serializing Qt Data Types"). QString uuid; in >> uuid; QByteArray byteArray; in >> byteArray; if (version == BOI_STD_D_VERSION) { if (type >= StandardDataTypes::NumTypes) { type = ConvertUuid(uuid); } } else { /* * For unknown versions, see if the * uuid is supported by the system. */ type = ConvertUuid(uuid); } if (type != -1) { QBuffer buffer(&byteArray); buffer.open(QIODevice::ReadOnly); QDataStream tempIn(&buffer); Data* pData = GetDataInstance(type); pData->Import(tempIn); buffer.close(); return DRef(pData); } return DRef(); }
DRef DataManager::GetData(int type) { if (!m_typeManager.TypeRegistered(type)) { /* * The caller is requesting a type that is not registered * with the system. Return an invalid DRef. */ return DRef(); } Data* pData = (Data*)m_typeManager.GetInstance(type); pData->m_pDataManager = this; return DRef(pData); }
DRef TextInputComponent::SetActionArgs(int id, DRef& dref) { Q_UNUSED(id); Q_UNUSED(dref); // TODO: fill in this method return DRef(); }
void thirteenLHSRef(IloEnv & env, IloExpr & expr, Sparse_Matrix<IloInt>& vox, vector<unsigned int> & B, IloNum Ty, vector<unsigned int> & Y, IloNumVarArray & w) { for(unsigned int i=0;i<B.size();++i) { IloExpr temp_expr(env); DRef(B[i], vox, w, temp_expr); expr += Ty - temp_expr; temp_expr.end(); } }
void twelveLHSRef(IloEnv & env, IloExpr & expr, Sparse_Matrix<IloInt>& vox, vector<unsigned int> & A, IloNum Tx, vector<unsigned int> & X, IloNumVarArray & w) { for(unsigned int i=0;i<A.size();++i) { IloExpr temp_expr(env); DRef(A[i], vox, w, temp_expr); expr += temp_expr - Tx; temp_expr.end(); } }
DRef TextInputComponent::SetAction(int id, DRef& dref) { Q_UNUSED(id); if (dref.Type() == BOI_STD_D(Int)) { m_action = *dref.GetReadInstance<int>(); } return DRef(); }