]> ruin.nu Git - germs.git/blobdiff - src/model.h
Check for TR1 or Boost
[germs.git] / src / model.h
index 9ebcb23818960d722bbee289a5c299849000330d..235f164d4cd28325c68daac533538c166ef44dd0 100644 (file)
 #ifndef __MODEL_H__
 #define __MODEL_H__
 
-#include <tr1/memory>
+#include "shared_ptr.h"
 #include <string>
 
 class SortAction;
+class GeneOrder;
+
 namespace Models {
        class ModelImpl;
 }
 
+/**
+ * Abstraction of a model.
+ * 
+ * Handles scoring of specific actions on gene orders.
+ */
 class Model{
        public:
-               typedef std::tr1::shared_ptr<Models::ModelImpl> ModelPointer;
+               typedef shared_ptr<Models::ModelImpl> 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);
 
-               double score(const SortAction& sa) const;
+               /**
+                * 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;
 
-               std::string name() const;
+               /**
+                * Creates a model from a name.
+                */
+               static Model modelFactory(const std::string& name);
 
        private:
                ModelPointer _impl;