source: cpp/frams/_demos/genotypeloader.cpp @ 147

Last change on this file since 147 was 121, checked in by sz, 10 years ago

updated file headers and makefiles

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// This file is a part of the Framsticks GDK.
2// Copyright (C) 2002-2014  Maciej Komosinski and Szymon Ulatowski.  See LICENSE.txt for details.
3// Refer to http://www.framsticks.com/ for further information.
4
5#include "genotypeloader.h"
6
7#define FIELDSTRUCT MiniGenotype
8ParamEntry minigenotype_paramtab[]=
9 {
10 {"Genotype",1,3,"org",},
11 {"name",0,0,"Name","s 0 40",FIELD(name),},
12 {"genotype",0,0,"Genotype","s 1",FIELD(genotype),},
13 {"info",0,0,"Info","s 1",FIELD(info),},
14 {0,0,0,},
15};
16#undef FIELDSTRUCT
17
18MiniGenotypeLoader::MiniGenotypeLoader():genotype_param(minigenotype_paramtab,&genotype_object) {init();}
19MiniGenotypeLoader::MiniGenotypeLoader(VirtFILE *f):MultiParamLoader(f),genotype_param(minigenotype_paramtab,&genotype_object) {init();}
20MiniGenotypeLoader::MiniGenotypeLoader(const char* filename):MultiParamLoader(filename),genotype_param(minigenotype_paramtab,&genotype_object) {init();}
21
22void MiniGenotypeLoader::init()
23{
24addObject(&genotype_param);
25breakOn(MultiParamLoader::OnError + MultiParamLoader::AfterObject);
26}
27
28MiniGenotype* MiniGenotypeLoader::loadNextGenotype()
29{
30genotype_object.clear();
31if ((go()==AfterObject)&&(getObject().matchesInterfaceName(&genotype_param)))
32        return &genotype_object;
33else
34        return 0;
35}
Note: See TracBrowser for help on using the repository browser.