/* =head2 new Arg [...] : Superclass args. See Bio::EnsEMBL::DBSQL::BaseAdaptor Description: Instantiates a Bio::EnsEMBL::DBSQL::AttributeAdaptor Returntype : Bio::EnsEMBL::AttributeAdaptor Exceptions : none Caller : DBAdaptor Status : Stable =cut */ AttributeAdaptor *AttributeAdaptor_new(DBAdaptor *dba) { AttributeAdaptor *ata = NULL; // Note I don't use the normal 'aa' abbreviation here because I find it difficult to see clearly if ((ata = (AttributeAdaptor *)calloc(1,sizeof(AttributeAdaptor))) == NULL) { fprintf(stderr, "ERROR: Failed allocating space for AttributeAdaptor\n"); } else { BaseAdaptor_init((BaseAdaptor *)ata, dba, ATTRIBUTE_ADAPTOR); } return ata; }
RepeatConsensusAdaptor *RepeatConsensusAdaptor_new(DBAdaptor *dba) { RepeatConsensusAdaptor *rca; if ((rca = (RepeatConsensusAdaptor *)calloc(1,sizeof(RepeatConsensusAdaptor))) == NULL) { fprintf(stderr, "ERROR: Failed allocating space for RepeatConsensusAdaptor\n"); return NULL; } BaseAdaptor_init((BaseAdaptor *)rca, dba, REPEATCONSENSUS_ADAPTOR); return rca; }
DBEntryAdaptor *DBEntryAdaptor_new(DBAdaptor *dba) { DBEntryAdaptor *dea; if ((dea = (DBEntryAdaptor *)calloc(1,sizeof(DBEntryAdaptor))) == NULL) { fprintf(stderr, "ERROR: Failed allocating space for DBEntryAdaptor\n"); return NULL; } BaseAdaptor_init((BaseAdaptor *)dea, dba, DBENTRY_ADAPTOR); return dea; }
ChromosomeAdaptor *ChromosomeAdaptor_new(DBAdaptor *dba) { ChromosomeAdaptor *ca; if ((ca = (ChromosomeAdaptor *)calloc(1,sizeof(ChromosomeAdaptor))) == NULL) { fprintf(stderr, "ERROR: Failed allocating space for ChromosomeAdaptor\n"); return NULL; } BaseAdaptor_init((BaseAdaptor *)ca, dba, CHROMOSOME_ADAPTOR); ca->chrCache = IDHash_new(IDHASH_SMALL); ca->chrNameCache = StringHash_new(STRINGHASH_SMALL); return ca; }