本文整理汇总了C++中KstStringPtr::setProvider方法的典型用法代码示例。如果您正苦于以下问题:C++ KstStringPtr::setProvider方法的具体用法?C++ KstStringPtr::setProvider怎么用?C++ KstStringPtr::setProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KstStringPtr
的用法示例。
在下文中一共展示了KstStringPtr::setProvider方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KstDataObject
KstPlugin::KstPlugin(const QDomElement& e)
: KstDataObject(e) {
QString pluginName;
_inStringCnt = 0;
_outStringCnt = 0;
commonConstructor();
QDomNode n = e.firstChild();
while (!n.isNull()) {
QDomElement e = n.toElement();
if (!e.isNull()) {
if (e.tagName() == "tag") {
setTagName(e.text());
} else if (e.tagName() == "name") {
pluginName = e.text();
} else if (e.tagName() == "ivector") {
_inputVectorLoadQueue.append(qMakePair(e.attribute("name"), e.text()));
} else if (e.tagName() == "iscalar") {
_inputScalarLoadQueue.append(qMakePair(e.attribute("name"), e.text()));
} else if (e.tagName() == "istring") {
_inputStringLoadQueue.append(qMakePair(e.attribute("name"), e.text()));
} else if (e.tagName() == "ovector") {
KstVectorPtr v;
if (e.attribute("scalarList", "0").toInt()) {
v = new KstVector(e.text(), 0, true);
} else {
v = new KstVector(e.text(), 0, false);
}
v->setProvider(this);
_outputVectors.insert(e.attribute("name"), v);
KST::addVectorToList(v);
} else if (e.tagName() == "oscalar") {
KstScalarPtr sp = new KstScalar(e.text());
sp->writeLock();
sp->setProvider(this);
sp->writeUnlock();
_outputScalars.insert(e.attribute("name"), sp);
} else if (e.tagName() == "ostring") {
KstStringPtr sp = new KstString(e.text());
sp->writeLock();
sp->setProvider(this);
sp->writeUnlock();
_outputStrings.insert(e.attribute("name"), sp);
}
}
n = n.nextSibling();
}
_plugin = PluginCollection::self()->plugin(pluginName);
if (!_plugin.data()) {
KstDebug::self()->log(i18n("Unable to load plugin %1 for \"%2\".").arg(pluginName).arg(tagName()), KstDebug::Warning);
} else {
Plugin::countScalarsVectorsAndStrings(_plugin->data()._inputs, _inScalarCnt, _inArrayCnt, _inStringCnt, _inPid);
const QValueList<Plugin::Data::IOValue>& otable = _plugin->data()._outputs;
for (QValueList<Plugin::Data::IOValue>::ConstIterator it = otable.begin();
it != otable.end();
++it) {
// FIXME: i18n?
if ((*it)._type == Plugin::Data::IOValue::TableType) {
_outArrayCnt++;
if (!_outputVectors.contains((*it)._name)) {
KstVectorPtr v;
if ((*it)._subType == Plugin::Data::IOValue::FloatNonVectorSubType) {
v = new KstVector(tagName() + " vector - " + (*it)._name, 0, true);
} else {
v = new KstVector(tagName() + " vector - " + (*it)._name, 0, false);
}
v->setProvider(this);
_outputVectors.insert((*it)._name, v);
KST::addVectorToList(v);
}
} else if ((*it)._type == Plugin::Data::IOValue::MatrixType) {
abort(); // FIXME:
#if 0
_outArrayCnt += 2;
if (!_outputMatrices.contains((*it)._name)) {
KstMatrixPtr m;
if ((*it)._subType == Plugin::Data::IOValue::FloatNonVectorSubType) {
m = new KstMatrix(tagName() + " matrix - " + (*it)._name, 0, true);
} else {
m = new KstMatrix(tagName() + " matrix - " + (*it)._name, 0, false);
}
m->setProvider(this);
_outputMatrices.insert((*it)._name, m);
KST::addVectorToList(v);
}
#endif
} else if ((*it)._type == Plugin::Data::IOValue::FloatType) {
_outScalarCnt++;
if (!_outputScalars.contains((*it)._name)) {
KstScalarPtr s = new KstScalar(tagName() + " scalar - " + (*it)._name);
s->writeLock();
s->setProvider(this);
s->writeUnlock();
//.........这里部分代码省略.........