bool ExtremeValueAnalysisAttributes::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const ExtremeValueAnalysisAttributes *tmp = (const ExtremeValueAnalysisAttributes *)atts; *this = *tmp; return true; }
bool PickVarInfo::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const PickVarInfo *tmp = (const PickVarInfo *)atts; *this = *tmp; return true; }
/** * WalkTypeList callback. * * @returns WR_CONTINUE * @param th The type handle. * @param _idx Pointer to the current module index. */ static walk_result Type2Callback( type_handle *th, void *_idx ) { int *idx = (int *)_idx; char buff[2048]; unsigned len; symbol_type tag; dip_type_info tinfo; dip_status rc; printf( "%5d ", ++*idx ); /** @todo all this needs some serious work */ /* type name. */ len = TypeName( th, 0, &tag, buff, sizeof( buff ) ); if( len > 0 ) { printf( "tag=%d %-13s name=%s\n" " ", tag, GetTypeTag( tag ), buff ); } /* type info */ rc = TypeInfo( th, NULL, &tinfo ); if( rc == DS_OK ) { printf( "size=%#06lx kind=%2d %-12s modifier=%#04x %s\n", tinfo.size, tinfo.kind, GetTypeKind( tinfo.kind ), tinfo.modifier, GetTypeModifier( tinfo.modifier, tinfo.kind ) ); switch( tinfo.kind ) { case TK_ARRAY: { array_info ainfo; rc = TypeArrayInfo( th, NULL, &ainfo, NULL ); if( rc == DS_OK ) { printf( " " "low_bound=%ld num_elts=%lu stride=%lu num_dims=%u column_major=%d\n", ainfo.low_bound, ainfo.num_elts, ainfo.stride, ainfo.num_dims, ainfo.column_major ); } else { printf( "TypeArrayInfo -> %d\n", rc ); } } break; case TK_FUNCTION: { } break; } } else { printf( "TypeInfo -> %d\n", rc ); } return( WR_CONTINUE ); }
bool SimulationCommand::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const SimulationCommand *tmp = (const SimulationCommand *)atts; *this = *tmp; return true; }
bool StatisticalTrendsAttributes::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const StatisticalTrendsAttributes *tmp = (const StatisticalTrendsAttributes *)atts; *this = *tmp; return true; }
bool ViewerRPC::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const ViewerRPC *tmp = (const ViewerRPC *)atts; *this = *tmp; return true; }
bool RectilinearProject2DAttributes::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const RectilinearProject2DAttributes *tmp = (const RectilinearProject2DAttributes *)atts; *this = *tmp; return true; }
bool ToroidalPoloidalProjection::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const ToroidalPoloidalProjection *tmp = (const ToroidalPoloidalProjection *)atts; *this = *tmp; return true; }
bool ColorControlPoint::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const ColorControlPoint *tmp = (const ColorControlPoint *)atts; *this = *tmp; return true; }
bool CartographicProjectionAttributes::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const CartographicProjectionAttributes *tmp = (const CartographicProjectionAttributes *)atts; *this = *tmp; return true; }
// Get the value of a union from an object. static void GetUnionField(const StructDef &struct_def, const FieldDef &field, std::string *code_ptr) { std::string &code = *code_ptr; GenReceiver(struct_def, code_ptr); code += MakeCamel(field.name) + "(self):"; code += OffsetPrefix(field); // TODO(rw): this works and is not the good way to it: bool is_native_table = TypeName(field) == "*flatbuffers.Table"; if (is_native_table) { code += Indent + Indent + Indent + "from flatbuffers.table import Table\n"; } else { code += Indent + Indent + Indent; code += "from ." + TypeName(field) + " import " + TypeName(field) + "\n"; } code += Indent + Indent + Indent + "obj = Table(bytearray(), 0)\n"; code += Indent + Indent + Indent + GenGetter(field.value.type); code += "obj, o)\n" + Indent + Indent + Indent + "return obj\n"; code += Indent + Indent + "return None\n\n"; }
// Get a struct by initializing an existing struct. // Specific to Table. static void GetStructFieldOfTable(const StructDef &struct_def, const FieldDef &field, std::string *code_ptr) { std::string &code = *code_ptr; GenReceiver(struct_def, code_ptr); code += MakeCamel(field.name); code += "(self):"; code += OffsetPrefix(field); if (field.value.type.struct_def->fixed) { code += Indent + Indent + Indent + "x = o + self._tab.Pos\n"; } else { code += Indent + Indent + Indent; code += "x = self._tab.Indirect(o + self._tab.Pos)\n"; } code += Indent + Indent + Indent; code += "from ." + TypeName(field) + " import " + TypeName(field) + "\n"; code += Indent + Indent + Indent + "obj = " + TypeName(field) + "()\n"; code += Indent + Indent + Indent + "obj.Init(self._tab.Bytes, x)\n"; code += Indent + Indent + Indent + "return obj\n"; code += Indent + Indent + "return None\n\n"; }
bool PeaksOverThresholdAttributes::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const PeaksOverThresholdAttributes *tmp = (const PeaksOverThresholdAttributes *)atts; *this = *tmp; return true; }
// Get a struct by initializing an existing struct. // Specific to Table. static void GetStructFieldOfTable(const StructDef &struct_def, const FieldDef &field, std::string *code_ptr) { std::string &code = *code_ptr; GenReceiver(struct_def, code_ptr); code += " " + MakeCamel(field.name); code += "(obj *"; code += TypeName(field); code += ") *" + TypeName(field) + " " + OffsetPrefix(field); if (field.value.type.struct_def->fixed) { code += "\t\tx := o + rcv._tab.Pos\n"; } else { code += "\t\tx := rcv._tab.Indirect(o + rcv._tab.Pos)\n"; } code += "\t\tif obj == nil {\n"; code += "\t\t\tobj = new(" + TypeName(field) + ")\n"; code += "\t\t}\n"; code += "\t\tobj.Init(rcv._tab.Bytes, x)\n"; code += "\t\treturn obj\n\t}\n\treturn nil\n"; code += "}\n\n"; }
bool DatabaseCorrelation::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const DatabaseCorrelation *tmp = (const DatabaseCorrelation *)atts; *this = *tmp; return true; }
bool avtTensorMetaData::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const avtTensorMetaData *tmp = (const avtTensorMetaData *)atts; *this = *tmp; return true; }
bool PersistentParticlesAttributes::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const PersistentParticlesAttributes *tmp = (const PersistentParticlesAttributes *)atts; *this = *tmp; return true; }
bool ConstructDataBinningAttributes::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const ConstructDataBinningAttributes *tmp = (const ConstructDataBinningAttributes *)atts; *this = *tmp; return true; }
bool SelectionVariableSummary::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const SelectionVariableSummary *tmp = (const SelectionVariableSummary *)atts; *this = *tmp; return true; }
bool TimeFormat::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const TimeFormat *tmp = (const TimeFormat *)atts; *this = *tmp; return true; }
bool DecimateAttributes::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const DecimateAttributes *tmp = (const DecimateAttributes *)atts; *this = *tmp; return true; }
bool AxesArray::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const AxesArray *tmp = (const AxesArray *)atts; *this = *tmp; return true; }
bool AnnotationObjectList::CopyAttributes(const AttributeGroup *atts) { if(TypeName() != atts->TypeName()) return false; // Call assignment operator. const AnnotationObjectList *tmp = (const AnnotationObjectList *)atts; *this = *tmp; return true; }
// Get the value of a union from an object. static void GetUnionField(const StructDef &struct_def, const FieldDef &field, std::string *code_ptr) { std::string &code = *code_ptr; GenReceiver(struct_def, code_ptr); code += " " + MakeCamel(field.name) + "("; code += "obj " + TypeName(field) + ") bool "; code += OffsetPrefix(field); code += "\t\t" + GenGetter(field.value.type); code += "(obj, o)\n\t\treturn true\n\t}\n"; code += "\treturn false\n"; code += "}\n\n"; }
// Get the value of a table's scalar. static void GetScalarFieldOfTable(const StructDef &struct_def, const FieldDef &field, std::string *code_ptr) { std::string &code = *code_ptr; std::string getter = GenGetter(field.value.type); GenReceiver(struct_def, code_ptr); code += " " + MakeCamel(field.name); code += "() " + TypeName(field) + " "; code += OffsetPrefix(field) + "\t\treturn " + getter; code += "(o + rcv._tab.Pos)\n\t}\n"; code += "\treturn " + field.value.constant + "\n"; code += "}\n\n"; }
CFunc CParmStatDlg::GetFunc(int index, int dstType) { CMyString funcBase = FuncBase(index); CMyString typeName; if (TypeFlag(funcBase)) typeName = TypeName(dstType); CFunc func = "ipps" + funcBase + "_" + typeName; if (typeName.IsEmpty()) func += m_pDocSrc->GetVector()->TypeString(); if (func.DstType() & PP_SIGN) func += "_Sfs"; return func; }
void TypeParser::TypeSpecifier(TokenStream *lexerStream, TypeSystem *__typeSystem) throw(ParserError) { if( __typeSystem->isTemplate(lexerStream->current().value())) { TemplateTypeSpecifier(lexerStream, __typeSystem); } else if( !__typeSystem->isRegisterType(lexerStream->current().value())) { TypeName(lexerStream, __typeSystem); __typeSystem->getHelper()->pushArgumentTypeMetaData(__typeSystem->getTypeMetaData(lexerStream->current().value())); __typeSystem->getHelper()->pushTypeToken(__typeSystem->getFullTypeName(lexerStream->current().value())); } else { throw ParserError(-1, "Type "+lexerStream->current().value()+" not exist."); } }
/****************************************************************** NAME : PrintMethod DESCRIPTION : Lists a brief description of methods for a method INPUTS : 1) Buffer for method info 2) Size of buffer (not including space for '\0') 3) The method address RETURNS : Nothing useful SIDE EFFECTS : None NOTES : A terminating newline is NOT included ******************************************************************/ globle void PrintMethod( void *theEnv, char *buf, int buflen, DEFMETHOD *meth) { long j,k; register RESTRICTION *rptr; char numbuf[15]; buf[0] = '\0'; if (meth->system) genstrncpy(buf,"SYS",(STD_SIZE) buflen); gensprintf(numbuf,"%-2d ",meth->index); genstrncat(buf,numbuf,(STD_SIZE) buflen-3); for (j = 0 ; j < meth->restrictionCount ; j++) { rptr = &meth->restrictions[j]; if ((((int) j) == meth->restrictionCount-1) && (meth->maxRestrictions == -1)) { if ((rptr->tcnt == 0) && (rptr->query == NULL)) { genstrncat(buf,"$?",buflen-strlen(buf)); break; } genstrncat(buf,"($? ",buflen-strlen(buf)); } else genstrncat(buf,"(",buflen-strlen(buf)); for (k = 0 ; k < rptr->tcnt ; k++) { #if OBJECT_SYSTEM genstrncat(buf,EnvGetDefclassName(theEnv,rptr->types[k]),buflen-strlen(buf)); #else genstrncat(buf,TypeName(theEnv,ValueToInteger(rptr->types[k])),buflen-strlen(buf)); #endif if (((int) k) < (((int) rptr->tcnt) - 1)) genstrncat(buf," ",buflen-strlen(buf)); } if (rptr->query != NULL) { if (rptr->tcnt != 0) genstrncat(buf," ",buflen-strlen(buf)); genstrncat(buf,"<qry>",buflen-strlen(buf)); } genstrncat(buf,")",buflen-strlen(buf)); if (((int) j) != (((int) meth->restrictionCount)-1)) genstrncat(buf," ",buflen-strlen(buf)); } }
/* Opens the first audio stream of the named file. If a file is already open, * it will be closed first. */ static int OpenPlayerFile(StreamPlayer *player, const char *filename) { ClosePlayerFile(player); /* Open the file and get the first stream from it */ player->file = openAVFile(filename); player->stream = getAVAudioStream(player->file, 0); if(!player->stream) { fprintf(stderr, "Could not open audio in %s\n", filename); goto error; } /* Get the stream format, and figure out the OpenAL format */ if(getAVAudioInfo(player->stream, &player->rate, &player->channels, &player->type) != 0) { fprintf(stderr, "Error getting audio info for %s\n", filename); goto error; } player->format = GetFormat(player->channels, player->type, alIsBufferFormatSupportedSOFT); if(player->format == 0) { fprintf(stderr, "Unsupported format (%s, %s) for %s\n", ChannelsName(player->channels), TypeName(player->type), filename); goto error; } /* Allocate enough space for the temp buffer, given the format */ player->datasize = FramesToBytes(BUFFER_SIZE, player->channels, player->type); player->data = malloc(player->datasize); if(player->data == NULL) { fprintf(stderr, "Error allocating %d bytes\n", player->datasize); goto error; } return 1; error: closeAVFile(player->file); player->file = NULL; player->stream = NULL; player->datasize = 0; return 0; }
QDomElement ComponentInterface::BeginSerialization(QDomDocument& doc, QDomElement& base_element) const { QDomElement comp_element = doc.createElement("component"); comp_element.setAttribute("type", QString::fromStdString(TypeName())); if (!name_.empty()) comp_element.setAttribute("name", QString::fromStdString(name_)); if (!base_element.isNull()) base_element.appendChild(comp_element); else doc.appendChild(comp_element); return comp_element; }