Changeset 731 for cpp/frams/param/paramtrans.h
- Timestamp:
- 01/27/18 22:27:20 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/param/paramtrans.h
r729 r731 7 7 class TwoWayMap 8 8 { 9 SListTempl<int> map,invmap;10 void printList(const SListTempl<int>&);9 SListTempl<int> map, invmap; 10 void printList(const SListTempl<int>&); 11 11 public: 12 void reset(int size);13 int get(int pos);14 int invget(int pos);15 void insert(int pos);16 void remove(int pos);17 void print();18 int size() {return map.size();}19 int invsize() {return invmap.size();}12 void reset(int size); 13 int get(int pos); 14 int invget(int pos); 15 void insert(int pos); 16 void remove(int pos); 17 void print(); 18 int size() { return map.size(); } 19 int invsize() { return invmap.size(); } 20 20 }; 21 21 22 22 /** wrapper for MutableParamInterface providing constant property#'s. 23 23 \warn group membership can change if the property is removed! 24 24 25 26 27 28 29 30 31 32 33 34 35 class ParamTransaction : public ParamInterface25 properties handling: 26 - adding and removing will not change property count and property# 27 - the description (ParamInterface::id/name/type) of the removed property is always "?" 28 - group membership of the removed property is always 0 29 - requests for property# are redirected to the new property# or ignored 30 groups handling: 31 - group count is constant 32 - accessing group name of the removed group will return "?" 33 - removed properties are moved to group 0 34 */ 35 class ParamTransaction : public ParamInterface 36 36 { 37 MutableParamInterface ∥38 bool changed,grchanged;39 CallbackNode *panode,*pdnode,*pcnode,*ganode,*gdnode,*gcnode;37 MutableParamInterface ∥ 38 bool changed, grchanged; 39 CallbackNode *panode, *pdnode, *pcnode, *ganode, *gdnode, *gcnode; 40 40 41 41 #define STATRICKCLASS ParamTransaction 42 STCALLBACKDEF(onPropAdd);43 STCALLBACKDEF(onPropDelete);44 STCALLBACKDEF(onGroupAdd);45 STCALLBACKDEF(onGroupDelete);46 STCALLBACKDEF(onPropChange);47 STCALLBACKDEF(onGroupChange);42 STCALLBACKDEF(onPropAdd); 43 STCALLBACKDEF(onPropDelete); 44 STCALLBACKDEF(onGroupAdd); 45 STCALLBACKDEF(onGroupDelete); 46 STCALLBACKDEF(onPropChange); 47 STCALLBACKDEF(onGroupChange); 48 48 #undef STATRICKCLASS 49 49 50 TwoWayMap propmap,groupmap;50 TwoWayMap propmap, groupmap; 51 51 52 void resetMaps();52 void resetMaps(); 53 53 54 55 ParamTransaction(MutableParamInterface &mpi);56 ~ParamTransaction();54 public: 55 ParamTransaction(MutableParamInterface &mpi); 56 ~ParamTransaction(); 57 57 58 void reset();59 bool propChanged() {return changed;}60 bool groupChanged() {return grchanged;}58 void reset(); 59 bool propChanged() { return changed; } 60 bool groupChanged() { return grchanged; } 61 61 62 int propertyPosition(int prop);63 int groupPosition(int group);62 int propertyPosition(int prop); 63 int groupPosition(int group); 64 64 65 int getGroupCount() {return groupmap.invsize();}66 int getPropCount() {return propmap.invsize();}67 const char * getName() {return par.getName();}65 int getGroupCount() { return groupmap.invsize(); } 66 int getPropCount() { return propmap.invsize(); } 67 const char * getName() { return par.getName(); } 68 68 69 const char * id(int);70 const char * name(int);71 const char * type(int);72 const char * help(int);73 int flags(int);74 int group(int);75 const char * grname(int);76 int grmember(int, int);77 void call(int, class ExtValue *, class ExtValue *);78 class SString getString(int);79 paInt getInt(int);80 double getDouble(int);81 class ExtObject getObject(int);82 class ExtValue getExtValue(int);83 int setInt(int, paInt);84 int setDouble(int, double);85 int setString(int, const class SString &);86 int setObject(int, const class ExtObject &);87 int setExtValue(int, const class ExtValue &);69 const char * id(int); 70 const char * name(int); 71 const char * type(int); 72 const char * help(int); 73 int flags(int); 74 int group(int); 75 const char * grname(int); 76 int grmember(int, int); 77 void call(int, class ExtValue *, class ExtValue *); 78 class SString getString(int); 79 paInt getInt(int); 80 double getDouble(int); 81 class ExtObject getObject(int); 82 class ExtValue getExtValue(int); 83 int setInt(int, paInt); 84 int setDouble(int, double); 85 int setString(int, const class SString &); 86 int setObject(int, const class ExtObject &); 87 int setExtValue(int, const class ExtValue &); 88 88 89 void print() 90 {printf("props(");propmap.print();printf(") groups(");groupmap.print();printf(")\n");} 89 void print() 90 { 91 printf("props("); 92 propmap.print(); 93 printf(") groups("); 94 groupmap.print(); 95 printf(")\n"); 96 } 91 97 }; 92 98
Note: See TracChangeset
for help on using the changeset viewer.