source: cpp/frams/_demos/geno_test.cpp @ 348

Last change on this file since 348 was 348, checked in by Maciej Komosinski, 9 years ago
  • explicit c_str() in SString instead of (const char*) cast
  • genetic converters and GenMan? are now thread-local which enables multi-threaded simulator separation
  • Property svn:eol-style set to native
File size: 681 bytes
Line 
1// This file is a part of Framsticks SDK.  http://www.framsticks.com/
2// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
3// See LICENSE.txt for details.
4
5#include <frams/virtfile/stdiofile.h>
6#include <frams/util/sstringutils.h>
7#include <frams/genetics/preconfigured.h>
8
9/**
10 @file
11 Sample code: Testing genotype validity
12
13 \include geno_test.cpp
14*/
15
16int main(int argc,char*argv[])
17{
18PreconfiguredGenetics genetics;
19
20if (argc<=1)
21        {
22        puts("no genotype");
23        return 10;
24        }
25SString gen(argv[1]);
26if (!strcmp(gen.c_str(),"-"))
27        {
28        gen=0;
29        StdioFILEDontClose in(stdin);
30        loadSString(&in,gen);
31        }
32Geno g(gen);
33puts(g.isValid()?"valid":"invalid");
34return !g.isValid();
35}
Note: See TracBrowser for help on using the repository browser.