// =============================================================== //
//                                                                 //
//   File      : AP_seq_dna.hxx                                    //
//   Purpose   :                                                   //
//                                                                 //
//   Institute of Microbiology (Technical University Munich)       //
//   http://www.arb-home.de/                                       //
//                                                                 //
// =============================================================== //

#ifndef AP_SEQ_DNA_HXX
#define AP_SEQ_DNA_HXX

#ifndef AP_SEQUENCE_HXX
#include <AP_sequence.hxx>
#endif
#ifndef DOWNCAST_H
#include <downcast.h>
#endif

class AP_sequence_parsimony FINAL_TYPE : public AP_combinableSeq { // derived from a Noncopyable
    void build_table();
    AP_FLOAT count_weighted_bases() const OVERRIDE;

    void set(const char *sequence) OVERRIDE;
    void unset() OVERRIDE;

    char *seq_pars;                                 // AP_BASES

public:
    static char *table;

    AP_sequence_parsimony(const AliView *aliview);
    ~AP_sequence_parsimony() OVERRIDE;

    const char *get_sequence() const {
        lazy_load_sequence();
        ap_assert(seq_pars);
        return seq_pars;
    }
    const unsigned char *get_usequence() const { return (const unsigned char*)get_sequence(); }

    AP_combinableSeq *dup() const OVERRIDE; // used to get the real new element
    Mutations combine_seq(const AP_combinableSeq *lefts, const AP_combinableSeq *rights, char *mutation_per_site) OVERRIDE;
    Mutations mutations_if_combined_with(const AP_combinableSeq *other) OVERRIDE;
    void partial_match(const AP_combinableSeq *part, long *overlap, long *penalty) const OVERRIDE;
    uint32_t checksum() const OVERRIDE;
    int cmp_combined(const AP_combinableSeq *other) const OVERRIDE;
};


#else
#error AP_seq_dna.hxx included twice
#endif // AP_SEQ_DNA_HXX
