Ignore:
Timestamp:
06/25/20 00:34:29 (4 years ago)
Author:
Maciej Komosinski
Message:

Genetic format ID becomes a string (no longer limited to a single character)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/genoconv.h

    r783 r955  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    4343public:
    4444        const char *name;       //< converter name (short)
    45         char in_format,         //< input format, eg. '1'
    46                 out_format;     //< output format, eg. '0'
     45        SString in_format,      //< input format, eg. "1"
     46                out_format;     //< output format, eg. "0"
    4747        paInt enabled;  //< don't touch this! (used by configuration module)
    4848        paInt mapsupport; //< set to 1 if your converter supports genotype mapping
     
    5656        virtual ~GenoConverter() {}
    5757        /// Don't forget to set public fields in your constructor
    58         GenoConverter() :name(""), in_format(-1), out_format('0'), enabled(1), mapsupport(0) {}
     58        GenoConverter() :name(""), in_format(Geno::UNKNOWN_FORMAT), out_format("0"), enabled(1), mapsupport(0) {}
    5959};
    6060
     
    7777        /// make a genotype in other format. genotype will be invalid
    7878        /// if GenoConvManager cannot convert it.
    79         Geno convert(Geno &in, char format, MultiMap *map = 0, bool using_checkpoints = false, bool *converter_missing = NULL);
     79        Geno convert(Geno &in, SString format, MultiMap *map = 0, bool using_checkpoints = false, bool *converter_missing = NULL);
    8080        /// register GenoConverter, the added object will be automatically deleted when GenoConvManager is destructed (call removeConverter() if this is not desirable)
    8181        void addConverter(GenoConverter *conv);
     
    8383        void removeConverter(GenoConverter *conv);
    8484
    85         char *getPath(char in, char out, char *path, int maxlen, int *mapavailable = 0);
    86         char *getFormatPath(char in, char out, char *path, int maxlen, int *mapavailable = 0);
     85        GenoConverter **getPath(const SString& in, const SString& out, GenoConverter **path, int maxlen, int *mapavailable = 0);
    8786        /// returns the list of converters meeting the specified criteria
    8887        /// pass result=0 if you only need one result (by return value)
    8988        /// default criteria values mean "don't care", pass anything else to narrow your search
    90         GenoConverter *findConverters(SListTempl<GenoConverter*>* result = 0, char in = -1, char out = -1, int enabled = -1, char* name = 0);
     89        GenoConverter *findConverters(SListTempl<GenoConverter*>* result = 0, const SString& in = Geno::UNKNOWN_FORMAT, const SString& out = Geno::UNKNOWN_FORMAT, int enabled = -1, char* name = 0);
    9190};
    9291
Note: See TracChangeset for help on using the changeset viewer.