Changeset 203
- Timestamp:
- 04/02/14 16:17:01 (11 years ago)
- Location:
- cpp/frams/vm/classes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/vm/classes/genoobj.cpp
r197 r203 6 6 #include <frams/util/extvalue.h> 7 7 #include <frams/model/autoname.h> 8 #include "collectionobj.h" 8 9 9 10 #define FIELDSTRUCT GenoObj 10 11 ParamEntry geno_paramtab[]= 11 12 { 12 {"Geno",1,1 2,"Geno","All information about a single genotype.\nThis is a genetics-only object which does not contain any performance data. See also: Genotype class"},13 {"Geno",1,14,"Geno","All information about a single genotype.\nThis is a genetics-only object which does not contain any performance data. See also: Genotype class"}, 13 14 {"name",0,PARAM_NOSTATIC,"Name","s 0 40",GETSET(name),}, 14 15 {"rawgenotype",0,PARAM_NOSTATIC+PARAM_READONLY,"Raw genotype","s 1",GETONLY(genotype),"Genotype, excluding the format specifier"}, … … 23 24 {"newFrom",0,0,"create new object","p oGeno(s genotype,d format,s name,s description)",PROCEDURE(p_newfrom),}, 24 25 {"autoname",0,PARAM_NOSTATIC+PARAM_READONLY,"Autogenerated name","s",GETONLY(autoname),}, 26 {"toVector",0,PARAM_READONLY+PARAM_NOSTATIC,"serialization support","oVector",GETONLY(toVector),}, 27 {"newFromVector",0,0,"serialization support","p oGeno(oVector)",PROCEDURE(p_newfromvector),}, 25 28 {0,0,0,}, 26 29 }; … … 111 114 return (Geno*)v.getObjectTarget(getStaticParam().getName(), warn); 112 115 } 116 117 void GenoObj::get_toVector(ExtValue *ret) 118 { 119 VectorObject *vec=new VectorObject; 120 vec->data+=new ExtValue(shortString()); 121 vec->data+=new ExtValue(getName()); 122 vec->data+=new ExtValue(getComment()); 123 ret->setObject(ExtObject(&VectorObject::par,vec)); 124 } 125 126 void GenoObj::p_newfromvector(ExtValue *args,ExtValue *ret) 127 { 128 VectorObject *vec=VectorObject::fromObject(args->getObject()); 129 if (vec && (vec->data.size()>=3)) 130 { 131 SString g=vec->get(0)?vec->get(0)->getString():""; 132 SString n=vec->get(1)?vec->get(1)->getString():""; 133 SString c=vec->get(2)?vec->get(2)->getString():""; 134 *ret=makeDynamicObjectAndDecRef(new Geno(g,-1,n,c)); 135 } 136 else 137 ret->setEmpty(); 138 } -
cpp/frams/vm/classes/genoobj.h
r197 r203 28 28 PARAMPROCDEF(p_newfrom); 29 29 PARAMPROCDEF(p_newfromstring); 30 PARAMPROCDEF(p_newfromvector); 31 PARAMGETDEF(toVector); 30 32 #undef STATRICKCLASS 31 33
Note: See TracChangeset
for help on using the changeset viewer.