X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodel.h;h=235f164d4cd28325c68daac533538c166ef44dd0;hb=623097444fac1993a86e6d73b203bc3c6d731c11;hp=52e4d747c4b6eb0677e18805cc30230244e6102f;hpb=d7c119fefaf9cce07974afbefb4b6a017689a961;p=germs.git diff --git a/src/model.h b/src/model.h index 52e4d74..235f164 100644 --- a/src/model.h +++ b/src/model.h @@ -21,7 +21,8 @@ #ifndef __MODEL_H__ #define __MODEL_H__ -#include +#include "shared_ptr.h" +#include class SortAction; class GeneOrder; @@ -30,16 +31,39 @@ namespace Models { class ModelImpl; } +/** + * Abstraction of a model. + * + * Handles scoring of specific actions on gene orders. + */ class Model{ public: - typedef std::tr1::shared_ptr ModelPointer; + typedef shared_ptr ModelPointer; + /** + * Constructs a new model. + * + * \param model The actual model implementation. This model takes + * ownership of the new allocated implementation and will delete it. + */ Model(Models::ModelImpl* model); + /** + * Gives the score for the action on a given gene order. + * A better match for this model gives a higher score. + */ double score(const SortAction& sa, const GeneOrder& go) const; + /** + * The name for the model used. + */ const char* name() const; + /** + * Creates a model from a name. + */ + static Model modelFactory(const std::string& name); + private: ModelPointer _impl;