本文整理汇总了C++中GeneratorCustomizer类的典型用法代码示例。如果您正苦于以下问题:C++ GeneratorCustomizer类的具体用法?C++ GeneratorCustomizer怎么用?C++ GeneratorCustomizer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GeneratorCustomizer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toStringImpl
QString SwitchNode::toStringImpl(GeneratorCustomizer &customizer, int indent, QString const &indentString) const
{
QString result;
bool isHead = true;
for (ZoneNode * const zone : mBranches.values().toSet()) {
if (zone == mDefaultBranch) {
// Branches merged with default on the diagram will be merged with it in code too
continue;
}
result += generatePart(customizer, indent, indentString, zone, isHead
? customizer.factory()->switchHeadGenerator(mId, customizer, mBranches.keys(zone))
: customizer.factory()->switchMiddleGenerator(mId, customizer, mBranches.keys(zone)));
isHead = false;
}
if (result.isEmpty()) {
// Then all branches lead to one block, we may ignore switch construction.
return mDefaultBranch->toString(customizer, indent, indentString);
}
result += generatePart(customizer, indent, indentString, mDefaultBranch
, customizer.factory()->switchDefaultGenerator(mId, customizer));
return result;
}
示例2: BindingGenerator
WaitForTouchSensorBlockGenerator::WaitForTouchSensorBlockGenerator(qrRepo::RepoApi const &repo
, GeneratorCustomizer &customizer
, Id const &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "wait/touch.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Port", customizer.factory()->inputPortConverter())
<< Binding::createConverting("@@[email protected]@", "Sign", customizer.factory()->inequalitySignConverter())
, parent)
{
}
示例3: BindingGenerator
WaitForColorBlockGenerator::WaitForColorBlockGenerator(qrRepo::RepoApi const &repo
, GeneratorCustomizer &customizer
, Id const &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "wait/color.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Port", customizer.factory()->inputPortConverter())
<< Binding::createConverting("@@[email protected]@", "Color", customizer.factory()->colorConverter())
, parent)
{
}
示例4: BindingGenerator
WaitForLightBlockGenerator::WaitForLightBlockGenerator(qrRepo::RepoApi const &repo
, GeneratorCustomizer &customizer
, Id const &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "wait/light.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Port", customizer.factory()->inputPortConverter())
<< Binding::createConverting("@@[email protected]@", "Percents", customizer.factory()->intPropertyConverter())
<< Binding::createConverting("@@[email protected]@", "Sign", customizer.factory()->inequalitySignConverter())
, parent)
{
}
示例5: BindingGenerator
SubprogramsSimpleGenerator::SubprogramsSimpleGenerator(const qrRepo::RepoApi &repo
, GeneratorCustomizer &customizer
, const Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "subprograms/subprogramCall.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "name", customizer.factory()->nameNormalizerConverter())
<< Binding::createConverting("@@[email protected]@", "dynamicProperties"
, customizer.factory()->dynamicPropertiesConverter(id))
, parent)
{
}
示例6: BindingGenerator
WaitForSoundBlockGenerator::WaitForSoundBlockGenerator(qrRepo::RepoApi const &repo
, GeneratorCustomizer &customizer
, Id const &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "wait/sound.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Port", customizer.factory()->inputPortConverter())
<< Binding::createConverting("@@[email protected]@", "Volume", customizer.factory()->intPropertyConverter())
<< Binding::createConverting("@@[email protected]@", "Sign", customizer.factory()->inequalitySignConverter())
, parent)
{
}
示例7: BindingGenerator
PrintTextBlockGenerator::PrintTextBlockGenerator(qrRepo::RepoApi const &repo
, GeneratorCustomizer &customizer
, Id const &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "drawing/printText.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "XCoordinateText", customizer.factory()->intPropertyConverter())
<< Binding::createConverting("@@[email protected]@", "YCoordinateText", customizer.factory()->intPropertyConverter())
<< Binding::createConverting("@@[email protected]@", "PrintText", customizer.factory()->stringPropertyConverter())
, parent)
{
}
示例8: BindingGenerator
WaitForGyroscopeBlockGenerator::WaitForGyroscopeBlockGenerator(qrRepo::RepoApi const &repo
, GeneratorCustomizer &customizer
, Id const &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "wait/gyroscope.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Port", customizer.factory()->inputPortConverter())
<< Binding::createConverting("@@[email protected]@", "Degrees", customizer.factory()->intPropertyConverter())
<< Binding::createConverting("@@[email protected]@", "Sign", customizer.factory()->inequalitySignConverter())
, parent)
{
}
示例9: BindingGenerator
WaitForMotionGenerator::WaitForMotionGenerator(const qrRepo::RepoApi &repo
, GeneratorCustomizer &customizer
, const Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "wait/motion.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Port", customizer.factory()->portNameConverter())
<< Binding::createConverting("@@[email protected]@", "Distance"
, customizer.factory()->intPropertyConverter(id, "Distance"))
<< Binding::createConverting("@@[email protected]@", "Sign", customizer.factory()->inequalitySignConverter())
, parent)
{
}
示例10: BindingGenerator
PlayToneGenerator::PlayToneGenerator(const qrRepo::RepoApi &repo
, GeneratorCustomizer &customizer
, const Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "playTone.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "Frequency"
, customizer.factory()->intPropertyConverter(id, "Frequency"))
<< Binding::createConverting("@@[email protected]@", "Duration"
, customizer.factory()->intPropertyConverter(id, "Duration"))
<< Binding::createConverting("@@[email protected]@", "Volume"
, customizer.factory()->intPropertyConverter(id, "Volume"))
, parent)
{
}
示例11: BindingGenerator
SwitchGenerator::SwitchGenerator(const qrRepo::RepoApi &repo
, GeneratorCustomizer &customizer
, const qReal::Id &id
, const QString &part
, const QStringList &values
, QObject *parent)
: BindingGenerator(repo, customizer, id, QString("switch/%1.t").arg(part), {
Binding::createConverting("@@[email protected]@", "Expression"
, customizer.factory()->floatPropertyConverter(id, "Expression"))
, Binding::createConverting("@@[email protected]@", "Expression"
, customizer.factory()->switchConditionsMerger(values))
}, parent)
{
}
示例12: BindingGenerator
PrintTextBlockGenerator::PrintTextBlockGenerator(const qrRepo::RepoApi &repo
, GeneratorCustomizer &customizer
, const Id &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "drawing/printText.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "XCoordinateText"
, customizer.factory()->intPropertyConverter(id, "XCoordinateText"))
<< Binding::createConverting("@@[email protected]@", "YCoordinateText"
, customizer.factory()->intPropertyConverter(id, "YCoordinateText"))
<< (repo.property(id, "Evaluate").toBool()
? Binding::createConverting("@@[email protected]@", "PrintText"
, customizer.factory()->stringPropertyConverter(id, "PrintText"))
: Binding::createStatic("@@[email protected]@"
, utils::StringUtils::wrap(repo.stringProperty(id, "PrintText"))))
, parent)
{
}
示例13: toStringImpl
QString SimpleNode::toStringImpl(GeneratorCustomizer &customizer, int indent, QString const &indentString) const
{
switch (mSyntheticBinding) {
case breakNode:
return utils::StringUtils::addIndent(customizer.factory()->breakGenerator(mId
, customizer)->generate(), indent, indentString);
case continueNode:
return utils::StringUtils::addIndent(customizer.factory()->continueGenerator(mId
, customizer)->generate(), indent, indentString);
case gotoNode:
return utils::StringUtils::addIndent(customizer.factory()->gotoSimpleGenerator(mId
, customizer)->generate(), indent, indentString);
default:
return utils::StringUtils::addIndent(customizer.factory()->simpleGenerator(mId
, customizer)->generate(), indent, indentString);
}
}
示例14: BindingGenerator
EnginesGenerator::EnginesGenerator(qrRepo::RepoApi const &repo
, GeneratorCustomizer &customizer
, Id const &id
, QString const &engineType
, QObject *parent)
: BindingGenerator(repo, customizer, id
, engineType.contains("EnginesBackward")
? "engines/enginesBackward.t"
: "engines/enginesForward.t"
, QList<Binding *>()
<< Binding::createMultiTarget("@@[email protected]@", "Ports", customizer.factory()->enginesConverter())
<< Binding::createConverting("@@[email protected]@", "Power", customizer.factory()->intPropertyConverter())
<< Binding::createConverting("@@[email protected]@", "Mode", customizer.factory()->breakModeConverter())
, parent)
{
mCustomizer.factory()->engines()->registerUsageOnPorts(repo.property(id, "Ports").toString());
}
示例15: BindingGenerator
SubprogramsSimpleGenerator::SubprogramsSimpleGenerator(qrRepo::RepoApi const &repo
, GeneratorCustomizer &customizer
, Id const &id
, QObject *parent)
: BindingGenerator(repo, customizer, id, "subprograms/subprogramCall.t", QList<Binding *>()
<< Binding::createConverting("@@[email protected]@", "name", customizer.factory()->nameNormalizerConverter())
, parent)
{
}