Changeset 490 for cpp/frams/param/paramobj.cpp
- Timestamp:
- 03/30/16 17:08:08 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/param/paramobj.cpp
r478 r490 23 23 24 24 ParamEntry* ParamObject::makeParamTab(ParamInterface *pi, bool stripgroups, bool stripproc, 25 int firstprop, int maxprops, bool dupentries, int flagsexclude, bool addnew, const char* rename, bool readonly_into_userreadonly) 26 { 25 int firstprop, int maxprops, bool dupentries, int flagsexclude_data, int flagsexclude_tab, bool addnew, const char* rename, bool readonly_into_userreadonly) 26 { 27 // flagsexclude_data - skip while calculating data offsets 28 // flagsexclude_tab - skip while creating paramtab 29 // usually _data==_tab, but vmneuron public properties need _data=0 and _tab=PARAM_USERHIDDEN (data object has all fields, paramtab skips private fields) 27 30 ParamEntry *tab, *t; 28 31 int i, n, offset; … … 30 33 int count = 0, gcount = 1; 31 34 if (!stripgroups) gcount = pi->getGroupCount(); 32 if (stripproc || flagsexclude )35 if (stripproc || flagsexclude_tab) 33 36 for (int i = firstprop; i < pi->getPropCount(); i++) 34 37 { 35 38 const char*t = pi->type(i); 36 39 if ((!stripproc) || (strchr("dfsox", *t))) 37 if ((!flagsexclude ) || (!(pi->flags(i)&flagsexclude)))40 if ((!flagsexclude_tab) || (!(pi->flags(i)&flagsexclude_tab))) 38 41 if (++count >= maxprops) break; 39 42 } … … 72 75 if ((!stripproc) || (strchr("dfsox", type[0]))) 73 76 { 74 if ((!flagsexclude) || (!(pi->flags(i)&flagsexclude))) 77 paInt flag=pi->flags(i); 78 int tmp_offset; 79 if ((!flagsexclude_data) || (!(flag&flagsexclude_data))) 75 80 { 76 81 if (type[0]=='p') 77 t ->offset=0;82 tmp_offset=0; 78 83 else 79 84 { 80 t ->offset = offset;81 if (type[0] != 'x') t ->offset += (((char*)&ex.data[0]) - ((char*)&ex));85 tmp_offset = offset; 86 if (type[0] != 'x') tmp_offset += (((char*)&ex.data[0]) - ((char*)&ex)); 82 87 offset += sizeof(ExtValue); 83 88 } 89 } 90 91 if ((!flagsexclude_tab) || (!(flag&flagsexclude_tab))) 92 { 93 t->offset=tmp_offset; 84 94 t->group = (paInt)(stripgroups ? 0 : pi->group(i)); 85 t->flags = (paInt) pi->flags(i);95 t->flags = (paInt)flag; 86 96 if (readonly_into_userreadonly && (t->flags & PARAM_READONLY)) 87 97 t->flags=(t->flags & ~PARAM_READONLY) | PARAM_USERREADONLY; … … 190 200 case 'f': v->setDouble(0); v++; break; 191 201 case 's': v->setString(SString::empty()); v++; break; 192 case 'o': v->setObject(ExtObject()); v++; break; 202 case 'o': 203 { 204 ExtObject new_obj; 205 if (t->flags & PARAM_OBJECTSET) 206 { 207 ParamInterface *cls=ExtValue::findDeserializableClass(t->type+1); 208 if (cls) 209 { 210 int new_fun = cls->findId("new"); 211 if (new_fun>=0) 212 { 213 ExtValue dummy,new_value; 214 cls->call(new_fun, &dummy, &new_value); 215 new_obj=new_value.getObject(); 216 } 217 } 218 } 219 v->setObject(new_obj); 220 v++; 221 } 222 break; 193 223 case 'x': v++; break; 194 224 }
Note: See TracChangeset
for help on using the changeset viewer.