Type* Library::GetFunctionType(std::vector<Type*> parameterTypes, Type* returnType) { std::string functionName = "function("; Type* retVal; auto typeIt = parameterTypes.begin(); if(typeIt != parameterTypes.end()) { functionName += (*typeIt)->mName; ++typeIt; } for(typeIt; typeIt != parameterTypes.end(); ++typeIt) { functionName += ", " + (*typeIt)->mName; } functionName += ") : " + returnType->mName; auto type = mGlobalsByName.find(functionName); if(type != mGlobalsByName.end()) { return static_cast<Type*>(type->second); } retVal = CreateType(functionName, true); retVal->mMode = TypeMode::Function; retVal->mReturnType = returnType; retVal->mParameterTypes = parameterTypes; return retVal; }
void Schema::CreateTables() { CreateSourceFile(); CreateSourceRange(); CreateSourceLocation(); CreateNamespace(); CreateType(); }
void Object::SendCreateInfo(Player *player) { player->SendCreate( GameID(), Scale(), BaseAsset(), CreateType(), HSV0(), HSV1(), HSV2()); }
/* Create types */ void CreateTypes(){ TypeNone = CreateType(0, NULL); TypeCons = CreateType(sizeof(VyCons), CreateSymbol_NoObj("cons")); TypeString = CreateType(sizeof(VyString), CreateSymbol_NoObj("string")); TypeSymbol = CreateType(sizeof(VySymbol), CreateSymbol_NoObj("symbol")); TypeFloat = CreateType(sizeof(VyFloat), CreateSymbol_NoObj("float")); TypeInt = CreateType(sizeof(VyInt), CreateSymbol_NoObj("int")); TypeFunction = CreateType(sizeof(VyFunction), CreateSymbol_NoObj("function")); }
Type* Library::GetPointerType(Type* pointerToType) { std::string newName = pointerToType->mName + "*"; auto typeIt = mGlobalsByName.find(newName); if(typeIt != mGlobalsByName.end()) { return static_cast<Type*>(typeIt->second); } auto type = CreateType(newName, true); type->mPointerToType = pointerToType; type->mMode = TypeMode::Pointer; return type; }
void StaticMap::SendAuxDataPacket(Player *player) { switch (CreateType()) { case 3 : // Planet, moon, sun case 11 : // Gate case 12 : // Station player->SendSimpleAuxName(this); break; case 37 : // Decoration/Nav player->SendAuxNameSignature(this); break; case 4: player->SendResourceName(GameID(), Name()); //what's 4? break; default: break; } }
void AMRStitchCellAttributes::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("AMRStitchCellAttributes"); if(searchNode == 0) return; DataNode *node; if((node = searchNode->GetNode("CreateCellsOfType")) != 0) { // Allow enums to be int or string in the config file if(node->GetNodeType() == INT_NODE) { int ival = node->AsInt(); if(ival >= 0 && ival < 3) SetCreateCellsOfType(CreateType(ival)); } else if(node->GetNodeType() == STRING_NODE) { CreateType value; if(CreateType_FromString(node->AsString(), value)) SetCreateCellsOfType(value); } } if((node = searchNode->GetNode("AddCaseNo")) != 0) SetAddCaseNo(node->AsBool()); if((node = searchNode->GetNode("OnlyProcessListedDomains")) != 0) SetOnlyProcessListedDomains(node->AsBool()); if((node = searchNode->GetNode("Domains")) != 0) SetDomains(node->AsIntVector()); if((node = searchNode->GetNode("OnlyProcessLevel")) != 0) SetOnlyProcessLevel(node->AsBool()); if((node = searchNode->GetNode("Level")) != 0) SetLevel(node->AsInt()); }
void InitalizeLanguagePrimitives(ASTBlock* scope, llvm::Module* module) { global_voidType = CreateType(scope, "Void", llvm::Type::getVoidTy(module->getContext())); global_U8Type = CreateType(scope, "U8", llvm::IntegerType::get(module->getContext(), 8)); global_U16Type = CreateType(scope, "U16", llvm::IntegerType::get(module->getContext(), 16)); global_U32Type = CreateType(scope, "U32", llvm::IntegerType::get(module->getContext(), 32)); global_U64Type = CreateType(scope, "U64", llvm::IntegerType::get(module->getContext(), 64)); global_S8Type = CreateType(scope, "S8", llvm::Type::getInt8Ty(module->getContext())); global_S16Type = CreateType(scope, "S16", llvm::Type::getInt16Ty(module->getContext())); global_S32Type = CreateType(scope, "S32", llvm::Type::getInt32Ty(module->getContext())); global_S64Type = CreateType(scope, "S64", llvm::Type::getInt64Ty(module->getContext())); global_F16Type = CreateType(scope, "F16", llvm::Type::getHalfTy(module->getContext())); global_F32Type = CreateType(scope, "F32", llvm::Type::getFloatTy(module->getContext())); global_F64Type = CreateType(scope, "F64", llvm::Type::getDoubleTy(module->getContext())); global_F128Type = CreateType(scope, "F128", llvm::Type::getFP128Ty(module->getContext())); }
AMRStitchCellAttributes::CreateType AMRStitchCellAttributes::GetCreateCellsOfType() const { return CreateType(CreateCellsOfType); }
bool Wsdl::CreateType( QObject *pParent, QString &sTypeName ) { if ( m_typesCreated.contains( sTypeName )) return true; // sTypeName.remove( "DTC::" ); sTypeName.remove( QChar('*') ); int id = QMetaType::type( sTypeName.toUtf8() ); switch( id ) { case QMetaType::QStringList: return CreateArrayType( pParent, sTypeName, "Value", "string", true ); case QMetaType::QVariantMap: return CreateMapType( pParent, sTypeName, "Settings", "string", true ); default: // for not, treat QFileInfo as a string. Need to turn into MTOM later. if (id == QMetaType::type( "QFileInfo" )) { sTypeName = "QString"; return false; } break; } if ((id == -1) || (id < QMetaType::User)) return false; // ------------------------------------------------------------------ // Need to create an instance of the class to access it's metadata. // ------------------------------------------------------------------ QObject *pClass = (QObject *)QMetaType::construct( id ); if (pClass != NULL) { const QMetaObject *pMetaObject = pClass->metaObject(); // ------------------------------------------------------------------ // Create xsd element structure // ------------------------------------------------------------------ QDomElement oTypeNode = createElement( "xs:complexType" ); QDomElement oSeqNode = createElement( "xs:sequence" ); oTypeNode.setAttribute( "name", ConvertTypeToXSD( sTypeName, true)); // oElementNode.appendChild( oTypeNode ); oTypeNode .appendChild( oSeqNode ); // ------------------------------------------------------------------ // Add all properties for this type // ------------------------------------------------------------------ int nCount = pMetaObject->propertyCount(); for (int nIdx=0; nIdx < nCount; ++nIdx ) { QMetaProperty metaProperty = pMetaObject->property( nIdx ); if (metaProperty.isDesignable( pClass )) { const char *pszPropName = metaProperty.name(); QString sPropName( pszPropName ); if ( sPropName.compare( "objectName" ) == 0) continue; QDomElement oNode = createElement( "xs:element" ); QString sType = metaProperty.typeName(); // if this is a child object, sType will be QObject* // which we can't use, so we need to read the // properties value, and read it's metaObject data if (sType == "QObject*") { QVariant val = metaProperty.read( pClass ); const QObject *pObject = val.value< QObject* >(); sType = pObject->metaObject()->className(); // sType.remove( "DTC::" ); } oNode.setAttribute( "minOccurs", 0 ); oNode.setAttribute( "name" , metaProperty.name() ); oNode.setAttribute( "nillable" , true ); //-=>TODO: This may need to be determined by sParamType bool bCustomType = CreateType( pClass, sType ); oNode.setAttribute( "type" , ((bCustomType) ? "tns:" : "") + ConvertTypeToXSD( sType, bCustomType )); oSeqNode.appendChild( oNode ); } } QDomElement oElementNode = createElement( "xs:element" ); oElementNode.setAttribute( "name" , ConvertTypeToXSD( sTypeName, true)); oElementNode.setAttribute( "nillable", "true" ); oElementNode.setAttribute( "type" , "tns:" + ConvertTypeToXSD( sTypeName, true)); m_oTypes.appendChild( oTypeNode ); m_oTypes.appendChild( oElementNode ); QMetaType::destroy( id, pClass ); } m_typesCreated.insert( sTypeName, true ); return true; }
QDomElement Wsdl::CreateMethodType( MethodInfo &oInfo, QString sTypeName, bool bReturnType /* = false */) { QDomElement oElementNode = createElement( "xs:element" ); oElementNode.setAttribute( "name", sTypeName ); QDomElement oTypeNode = createElement( "xs:complexType" ); QDomElement oSeqNode = createElement( "xs:sequence" ); oElementNode.appendChild( oTypeNode ); oTypeNode .appendChild( oSeqNode ); // ------------------------------------------------------------------ // Create message for parameters // ------------------------------------------------------------------ if (bReturnType) { QDomElement oNode = createElement( "xs:element" ); QString sType = oInfo.m_oMethod.typeName(); // sType.remove( "DTC::" ); sType.remove( QChar('*') ); sTypeName.remove( "Response" ); oNode.setAttribute( "minOccurs", 0 ); oNode.setAttribute( "name" , sTypeName + "Result" ); oNode.setAttribute( "nillable" , true ); //-=>TODO: This may need to be determined by sParamType bool bCustomType = CreateType( NULL, sType ); oNode.setAttribute( "type" , "tns:" + ConvertTypeToXSD( sType, bCustomType )); oSeqNode.appendChild( oNode ); } else { QList<QByteArray> paramNames = oInfo.m_oMethod.parameterNames(); QList<QByteArray> paramTypes = oInfo.m_oMethod.parameterTypes(); for( int nIdx = 0; nIdx < paramNames.length(); nIdx++ ) { QString sName = paramNames[ nIdx ]; QString sParamType = paramTypes[ nIdx ]; QDomElement oNode = createElement( "xs:element" ); oNode.setAttribute( "minOccurs", 0 ); oNode.setAttribute( "name" , sName ); oNode.setAttribute( "nillable" , true ); //-=>TODO: This may need to be determined by sParamType oNode.setAttribute( "type" , ConvertTypeToXSD( sParamType )); oSeqNode.appendChild( oNode ); } } return oElementNode; }
named_recursive_mutex_adapter(const char* name) : m_mtx(CreateType(), name) { }