本文整理汇总了C++中KstVectorPtr::writeUnlock方法的典型用法代码示例。如果您正苦于以下问题:C++ KstVectorPtr::writeUnlock方法的具体用法?C++ KstVectorPtr::writeUnlock怎么用?C++ KstVectorPtr::writeUnlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KstVectorPtr
的用法示例。
在下文中一共展示了KstVectorPtr::writeUnlock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setVector
void KstCSD::setVector(KstVectorPtr new_v) {
KstVectorPtr v = _inputVectors[INVECTOR];
if (v) {
if (v == new_v) {
return;
}
v->writeUnlock();
}
_inputVectors.erase(INVECTOR);
new_v->writeLock();
_inputVectors[INVECTOR] = new_v;
setDirty();
}
示例2: makeDuplicate
KstDataObjectPtr KstPlugin::makeDuplicate(KstDataObjectDataObjectMap& duplicatedMap) {
KstPluginPtr plugin = new KstPlugin;
// use same inputs
for (KstVectorMap::ConstIterator iter = _inputVectors.begin(); iter != _inputVectors.end(); ++iter) {
plugin->inputVectors().insert(iter.key(), iter.data());
}
for (KstScalarMap::ConstIterator iter = _inputScalars.begin(); iter != _inputScalars.end(); ++iter) {
plugin->inputScalars().insert(iter.key(), iter.data());
}
for (KstStringMap::ConstIterator iter = _inputStrings.begin(); iter != _inputStrings.end(); ++iter) {
plugin->inputStrings().insert(iter.key(), iter.data());
}
// create new outputs
for (KstVectorMap::ConstIterator iter = outputVectors().begin(); iter != outputVectors().end(); ++iter) {
KstVectorPtr v = new KstVector;
v->writeLock();
plugin->outputVectors().insert(iter.key(), v);
v->setTagName(iter.data()->tagName() + "'");
v->setProvider(plugin.data());
KST::addVectorToList(v);
v->writeUnlock();
}
for (KstScalarMap::ConstIterator iter = outputScalars().begin(); iter != outputScalars().end(); ++iter) {
KstScalarPtr s = new KstScalar;
s->writeLock();
plugin->outputScalars().insert(iter.key(), s);
s->setTagName(iter.data()->tagName() + "'");
s->setProvider(plugin.data());
s->writeUnlock();
}
for (KstStringMap::ConstIterator iter = outputStrings().begin(); iter != outputStrings().end(); ++iter) {
KstStringPtr s = new KstString;
s->writeLock();
plugin->outputStrings().insert(iter.key(), s);
s->setTagName(iter.data()->tagName() + "'");
s->setProvider(plugin.data());
s->writeUnlock();
}
// set the same plugin
plugin->setPlugin(_plugin);
plugin->setTagName(tagName() + "'");
duplicatedMap.insert(this, KstDataObjectPtr(plugin));
return KstDataObjectPtr(plugin);
}
示例3: setExistingXVector
void KstEquation::setExistingXVector(KstVectorPtr in_xv, bool do_interp) {
KstVectorPtr v = _inputVectors[XVECTOR];
if (v) {
if (v == in_xv) {
return;
}
v->writeUnlock();
}
setDirty();
_inputVectors.erase(XVECTOR);
in_xv->writeLock();
_xVector = _inputVectors.insert(XVECTOR, in_xv);
_ns = 2; // reset the updating
_doInterp = do_interp;
}