本文整理汇总了C++中CodeGenerator::initFromParentDocument方法的典型用法代码示例。如果您正苦于以下问题:C++ CodeGenerator::initFromParentDocument方法的具体用法?C++ CodeGenerator::initFromParentDocument怎么用?C++ CodeGenerator::initFromParentDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CodeGenerator
的用法示例。
在下文中一共展示了CodeGenerator::initFromParentDocument方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createObject
CodeGenerator* createObject(Uml::ProgrammingLanguage::Enum pl)
{
CodeGenerator* obj = 0;
Settings::OptionState optionState = Settings::optionState();
switch (pl) {
case Uml::ProgrammingLanguage::Ada:
obj = new AdaWriter();
break;
case Uml::ProgrammingLanguage::ActionScript:
obj = new ASWriter();
break;
case Uml::ProgrammingLanguage::Cpp:
if (optionState.generalState.newcodegen) {
obj = new CPPCodeGenerator();
obj->connect_newcodegen_slots();
} else {
obj = new CppWriter();
}
break;
case Uml::ProgrammingLanguage::CSharp:
obj = new CSharpWriter();
break;
case Uml::ProgrammingLanguage::D:
if (optionState.generalState.newcodegen) {
obj = new DCodeGenerator();
obj->connect_newcodegen_slots();
} else {
obj = new DWriter();
}
break;
case Uml::ProgrammingLanguage::IDL:
obj = new IDLWriter();
break;
case Uml::ProgrammingLanguage::Java:
if (optionState.generalState.newcodegen) {
obj = new JavaCodeGenerator();
obj->connect_newcodegen_slots();
} else {
obj = new JavaWriter();
}
break;
case Uml::ProgrammingLanguage::JavaScript:
obj = new JSWriter();
break;
case Uml::ProgrammingLanguage::MySQL:
obj = new MySQLWriter();
break;
case Uml::ProgrammingLanguage::PHP:
obj = new PhpWriter();
break;
case Uml::ProgrammingLanguage::PHP5:
obj = new Php5Writer();
break;
case Uml::ProgrammingLanguage::Pascal:
obj = new PascalWriter();
break;
case Uml::ProgrammingLanguage::Perl:
obj = new PerlWriter();
break;
case Uml::ProgrammingLanguage::PostgreSQL:
obj = new PostgreSQLWriter();
break;
case Uml::ProgrammingLanguage::Python:
obj = new PythonWriter();
break;
case Uml::ProgrammingLanguage::Ruby:
if (optionState.generalState.newcodegen) {
obj = new RubyCodeGenerator();
obj->connect_newcodegen_slots();
} else {
obj = new RubyWriter();
}
break;
case Uml::ProgrammingLanguage::SQL:
obj = new SQLWriter();
break;
case Uml::ProgrammingLanguage::Tcl:
obj = new TclWriter();
break;
case Uml::ProgrammingLanguage::Vala:
obj = new ValaWriter();
break;
case Uml::ProgrammingLanguage::XMLSchema:
obj = new XMLSchemaWriter();
break;
default:
uWarning() << "cannot create object of type "
<< Uml::ProgrammingLanguage::toString(pl)
<< ". Type unknown";
break;
}
UMLApp::app()->setPolicyExt(CodeGenFactory::newCodeGenPolicyExt(pl));
if (obj) {
obj->initFromParentDocument();
}
return obj;
}