RKEditorDataFrame::RKEditorDataFrame (RContainerObject* object, QWidget *parent) : TwinTable (parent) { RK_TRACE (EDITOR); commonInit (); RK_ASSERT (!object->isPending ()); RKEditor::object = object; RK_ASSERT (object->isDataFrame ()); setGlobalContextProperty ("current_object", object->getFullName()); RKVarEditDataFrameModel* model = new RKVarEditDataFrameModel (object, this); initTable (model, object); connect (model, SIGNAL (modelObjectDestroyed()), this, SLOT (detachModel())); waitForLoad (); }
void PandaChunk::loadData(const bool async) { data = reinterpret_cast<char * >(cudacpp::Runtime::mallocHost(elemSize * numElems)); reader = new oscpp::AsyncFileReader; oscpp::AsyncIORequest * openReq; openReq = reader->open(fileName.c_str()); openReq->sync(); if (openReq->hasError()) { fprintf(stderr, "Error opening file '%s'.\n", fileName.c_str()); fflush(stderr); } delete openReq; int soFar = 0; while (soFar < numElems) { int elemsToRead = std::min(numElems - soFar, maxReadSize / elemSize); readReqs.push_back(reader->read(data + soFar * elemSize, elemsToRead * elemSize)); soFar += elemsToRead; } if (!async) waitForLoad(); }
void PandaChunk::finishLoading() { if (loaded) return; if (reader == NULL) loadData(false); waitForLoad(); }
PandaChunk::~PandaChunk() { waitForLoad(); if (data != NULL) cudacpp::Runtime::freeHost(data); }//PandaChunk
CleanlyLoadingComponent(QQmlEngine *engine, const QString &fileName) : QQmlComponent(engine, fileName, QQmlComponent::Asynchronous) { waitForLoad(); }
CleanlyLoadingComponent(QQmlEngine *engine, const QUrl &url) : QQmlComponent(engine, url, QQmlComponent::Asynchronous) { waitForLoad(); }
FixedSizeChunk::~FixedSizeChunk() { waitForLoad(); if (data != NULL) cudacpp::Runtime::freeHost(data); }