std::list<Tag> TagManager::toTags(std::list< Ogre::String > tags) { std::list<Tag> output; for(auto const & tag : tags) output.push_back(toTag(tag)); return output; }
int LmcTag::getNext(int& tag, char* value, unsigned short max, int track) { int status; char name[100+TB]; if ((status = getNext(name, value, max)) != success) return status; tag = toTag(name, track); return tag != tUnknown ? success : (int)wrnUnknownTag; }
void Posture::toProfile(const QString &name) { CloseCurrentWindow(); modelList.clear(); m_pwProfileWin = new ProfileWindow(this,name); m_wtCurrentWin = PROFILE; connect(m_pwProfileWin, SIGNAL(toHome()), this, SLOT(toHomeWin())); connect(m_pwProfileWin, SIGNAL(toProfileMode(const QString&)), this, SLOT(toProfileMode(const QString&))); connect(m_pwProfileWin, SIGNAL(toUpload()), this, SLOT(toUploadMode())); connect(m_pwProfileWin, SIGNAL(edit()), this, SLOT(toProfileEdit())); connect(m_pwProfileWin, SIGNAL(logout()), this, SLOT(logout())); connect(m_pwProfileWin, SIGNAL(addTag()), this, SLOT(toTag())); this->setCentralWidget(m_pwProfileWin); }
void MethProfile::reportMethHelper(const Class* cls, const Func* meth) { auto val = methValue(); if (!val) { assertx(cls); m_curClass = cls; setMeth(meth, Tag::UniqueClass); return; } auto curMeth = rawMeth(); switch (toTag(val)) { case Tag::Invalid: return; case Tag::UniqueClass: if (rawClass() == cls) { assertx(curMeth == meth); return; } setMeth(curMeth, Tag::UniqueMeth); // fall through case Tag::UniqueMeth: if (curMeth == meth) return; curMeth = curMeth->baseCls()->getMethod(curMeth->methodSlot()); setMeth(curMeth, Tag::BaseMeth); // fall through case Tag::BaseMeth: { assertx(curMeth->baseCls() == curMeth->cls()); if (curMeth->baseCls() == meth->baseCls()) return; for (auto iface : curMeth->baseCls()->allInterfaces().range()) { if (auto imeth = iface->lookupMethod(curMeth->name())) { if (meth->cls()->classof(iface)) { setMeth(imeth, Tag::InterfaceMeth); return; } } } break; } case Tag::InterfaceMeth: assertx(curMeth->cls()->attrs() & AttrInterface); if (meth->cls()->classof(curMeth->cls())) return; break; } setMeth(nullptr, Tag::Invalid); }
void MethProfile::reduce(MethProfile& a, const MethProfile& b) { if (a.curTag() == Tag::Invalid) return; uintptr_t bMethVal; // this part is racy, and could slice if we're not careful while (true) { auto cls = b.m_curClass.get(); bMethVal = b.methValue(); if (!bMethVal) return; if (toTag(bMethVal) != Tag::UniqueClass) break; if (UNLIKELY(cls != b.m_curClass.get())) { continue; } assertx(cls); a.reportMethHelper(cls, fromValue(bMethVal)); return; } // Now we know the entire representation is in bMethVal, // so no more danger of a race if (toTag(bMethVal) == Tag::Invalid) { a.setMeth(nullptr, Tag::Invalid); return; } assertx(toTag(bMethVal) == Tag::UniqueMeth || toTag(bMethVal) == Tag::BaseMeth || toTag(bMethVal) == Tag::InterfaceMeth); auto const meth = fromValue(bMethVal); if (!a.methValue()) { a.setMeth(meth, toTag(bMethVal)); return; } a.reportMethHelper(nullptr, meth); if (a.curTag() == Tag::UniqueMeth && toTag(bMethVal) == Tag::BaseMeth) { a.setMeth(meth, Tag::BaseMeth); } }