当前位置: 首页>>代码示例>>C++>>正文


C++ GeneratorCustomizer类代码示例

本文整理汇总了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;
}
开发者ID:AirVan21,项目名称:qreal,代码行数:27,代码来源:switchNode.cpp

示例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)
{
}
开发者ID:Esenin,项目名称:qreal,代码行数:10,代码来源:waitForTouchSensorBlockGenerator.cpp

示例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)
{
}
开发者ID:Esenin,项目名称:qreal,代码行数:10,代码来源:waitForColorBlockGenerator.cpp

示例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)
{
}
开发者ID:Esenin,项目名称:qreal,代码行数:11,代码来源:waitForLightBlockGenerator.cpp

示例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)
{
}
开发者ID:ZiminGrigory,项目名称:qreal,代码行数:11,代码来源:subprogramsSimpleGenerator.cpp

示例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)
{
}
开发者ID:ASabina,项目名称:qreal,代码行数:11,代码来源:waitForSoundBlockGenerator.cpp

示例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)
{
}
开发者ID:Esenin,项目名称:qreal,代码行数:11,代码来源:printTextBlockGenerator.cpp

示例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)
{
}
开发者ID:Esenin,项目名称:qreal,代码行数:11,代码来源:waitForGyroscopeBlockGenerator.cpp

示例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)
{
}
开发者ID:Antropovi,项目名称:qreal,代码行数:12,代码来源:waitForMotionGenerator.cpp

示例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)
{
}
开发者ID:Antropovi,项目名称:qreal,代码行数:14,代码来源:playToneGenerator.cpp

示例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)
{
}
开发者ID:Antropovi,项目名称:qreal,代码行数:14,代码来源:switchGenerator.cpp

示例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)
{
}
开发者ID:Smirnov-Mikhail,项目名称:qreal,代码行数:17,代码来源:printTextBlockGenerator.cpp

示例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);
	}
}
开发者ID:AirVan21,项目名称:qreal,代码行数:17,代码来源:simpleNode.cpp

示例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());
}
开发者ID:ASabina,项目名称:qreal,代码行数:17,代码来源:enginesGenerator.cpp

示例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)
{
}
开发者ID:Esenin,项目名称:qreal,代码行数:9,代码来源:subprogramsSimpleGenerator.cpp


注:本文中的GeneratorCustomizer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。