Index: cpp/frams/vm/classes/genoobj.cpp
===================================================================
--- cpp/frams/vm/classes/genoobj.cpp	(revision 138)
+++ cpp/frams/vm/classes/genoobj.cpp	(revision 138)
@@ -0,0 +1,115 @@
+// This file is a part of the Framsticks GDK.
+// Copyright (C) 2002-2014  Maciej Komosinski and Szymon Ulatowski.  See LICENSE.txt for details.
+// Refer to http://www.framsticks.com/ for further information.
+
+#include "genoobj.h"
+#include <frams/util/extvalue.h>
+#include <frams/model/autoname.h>
+
+#define FIELDSTRUCT GenoObj
+ParamEntry geno_paramtab[]=
+{
+{"Geno",1,12,"Geno","All information about a single genotype.\nThis is a genetics-only object which does not contain any performance data. See also: Genotype class"},
+{"name",0,PARAM_NOSTATIC,"Name","s 0 40",GETSET(name),},
+{"rawgenotype",0,PARAM_NOSTATIC+PARAM_READONLY,"Raw genotype","s 1",GETONLY(genotype),"Genotype, excluding the format specifier"},
+{"info",0,PARAM_NOSTATIC,"Info","s 1",GETSET(info),"Additional information or comments",},
+{"format",0,PARAM_NOSTATIC+PARAM_READONLY,"Format","d",GETONLY(format),"Genotype format",},
+{"genotype",0,PARAM_NOSTATIC+PARAM_READONLY,"Genotype","s 1",GETONLY(string),},
+{"isValid",0,PARAM_NOSTATIC+PARAM_READONLY,"Valid","d 0 1",GETONLY(isvalid),},
+{"getConverted",0,PARAM_NOSTATIC,"get converted genotype","p oGeno(d format)",PROCEDURE(p_getconvert),},
+{"f0genotype",0,PARAM_NOSTATIC+PARAM_READONLY,"f0 genotype","s 1",GETONLY(f0genotype),"converted to f0 genotype",},
+{"new",0,0,"create new empty object","p oGeno()",PROCEDURE(p_new),},
+{"newFromString",0,0,"create new object from supplied string argument","p oGeno(s genotype)",PROCEDURE(p_newfromstring),},
+{"newFrom",0,0,"create new object","p oGeno(s genotype,d format,s name,s description)",PROCEDURE(p_newfrom),},
+{"autoname",0,PARAM_NOSTATIC+PARAM_READONLY,"Autogenerated name","s",GETONLY(autoname),},
+{0,0,0,},
+};
+#undef FIELDSTRUCT
+
+void GenoObj::get_isvalid(ExtValue *ret)
+{ret->setInt(isValid());}
+
+void GenoObj::get_genotype(ExtValue *ret)
+{ret->setString(getGene());}
+
+void GenoObj::get_name(ExtValue *ret)
+{ret->setString(getName());}
+
+void GenoObj::get_autoname(ExtValue *ret)
+{
+Model m(*this);
+ret->setString(AutoName::makeName(m));
+}
+
+int GenoObj::set_name(const ExtValue *v)
+{setName(v->getString());
+return PSET_CHANGED;}
+
+void GenoObj::get_info(ExtValue *ret)
+{ret->setString(getComment());}
+
+void GenoObj::get_string(ExtValue *ret)
+{ret->setString(shortString());}
+
+void GenoObj::get_format(ExtValue *ret)
+{ret->setInt(getFormat());}
+
+int GenoObj::set_info(const ExtValue *v)
+{setComment(v->getString());
+return PSET_CHANGED;}
+
+void GenoObj::get_f0genotype(ExtValue *ret)
+{ret->setString(getConverted('0').getGene());}
+
+void GenoObj::p_getconvert(ExtValue *args,ExtValue *ret)
+{*ret=makeDynamicObjectAndDecRef(new Geno(getConverted((char)args[0].getInt())));}
+
+void GenoObj::p_new(ExtValue *args,ExtValue *ret)
+{*ret=makeDynamicObjectAndDecRef(new Geno());}
+
+void GenoObj::p_newfromstring(ExtValue *args,ExtValue *ret)
+{*ret=makeDynamicObjectAndDecRef(new Geno(args[0].getString()));}
+
+void GenoObj::p_newfrom(ExtValue *args,ExtValue *ret)
+{*ret=makeDynamicObjectAndDecRef(new Geno(args[3].getString(),(char)args[2].getInt(),
+				 args[1].getString(),args[0].getString()));}
+
+Param& GenoObj::getStaticParam()
+{
+#ifdef __CODEGUARD__
+static GenoObj static_genoobj;
+static Param static_genoparam(geno_paramtab,&static_genoobj);
+#else
+static Param static_genoparam(geno_paramtab);
+#endif
+return static_genoparam;
+}
+
+Param& GenoObj::getDynamicParam()
+{
+static Param dynamic_genoparam(geno_paramtab);
+return dynamic_genoparam;
+}
+
+ParamInterface* GenoObj::getInterface() {return &getStaticParam();}
+
+ExtObject GenoObj::makeStaticObject(Geno* g)
+{return ExtObject(&getStaticParam(),(void*)g);}
+
+ExtObject GenoObj::makeDynamicObject(Geno* g)
+{return ExtObject(&getDynamicParam(),(DestrBase*)g);}
+
+ExtObject GenoObj::makeDynamicObjectAndDecRef(Geno* g)
+{
+const ExtObject& o=makeDynamicObject(g);
+g->decref();
+return o;
+}
+
+Geno* GenoObj::fromObject(const ExtValue& v)
+{
+if (v.type!=TObj) return 0;
+const ExtObject& o=v.getObject();
+//if ((o.param!=&getStaticParam())&&(o.param!=&getDynamicParam())) return 0;
+return (Geno*)o.getTarget(getStaticParam().getName());
+}
Index: cpp/frams/vm/classes/genoobj.h
===================================================================
--- cpp/frams/vm/classes/genoobj.h	(revision 138)
+++ cpp/frams/vm/classes/genoobj.h	(revision 138)
@@ -0,0 +1,45 @@
+// This file is a part of the Framsticks GDK.
+// Copyright (C) 2002-2014  Maciej Komosinski and Szymon Ulatowski.  See LICENSE.txt for details.
+// Refer to http://www.framsticks.com/ for further information.
+
+#ifndef _GENOOBJ_H_
+#define _GENOOBJ_H_
+
+#include <frams/genetics/geno.h>
+
+extern ParamEntry geno_paramtab[];
+
+class GenoObj: public Geno
+{
+  public:
+#define STATRICKCLASS GenoObj
+PARAMGETDEF(isvalid);
+PARAMGETDEF(genotype);
+PARAMGETDEF(name);
+PARAMSETDEF(name);
+PARAMGETDEF(autoname);
+PARAMGETDEF(info);
+PARAMSETDEF(info);
+PARAMGETDEF(format);
+PARAMGETDEF(string);
+PARAMPROCDEF(p_getconvert);
+PARAMGETDEF(f0genotype);
+PARAMPROCDEF(p_new);
+PARAMPROCDEF(p_newfrom);
+PARAMPROCDEF(p_newfromstring);
+#undef STATRICKCLASS
+
+static ExtObject makeStaticObject(Geno* g);
+static ExtObject makeDynamicObject(Geno* g);
+static ExtObject makeDynamicObjectAndDecRef(Geno* g);
+static Geno* fromObject(const ExtValue& v);
+static ParamInterface* getInterface();
+
+static Param& getStaticParam();
+static Param& getDynamicParam();
+};
+
+#endif
+
+
+
