Ignore:
Timestamp:
01/27/18 22:27:20 (6 years ago)
Author:
Maciej Komosinski
Message:

Code formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/param/paramtrans.h

    r729 r731  
    77class TwoWayMap
    88{
    9 SListTempl<int> map,invmap;
    10 void printList(const SListTempl<int>&);
     9        SListTempl<int> map, invmap;
     10        void printList(const SListTempl<int>&);
    1111public:
    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(); }
    2020};
    2121
    2222/** wrapper for MutableParamInterface providing constant property#'s.
    23     \warn group membership can change if the property is removed!
     23        \warn group membership can change if the property is removed!
    2424
    25     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
     25        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        */
     35class ParamTransaction : public ParamInterface
    3636{
    37 MutableParamInterface &par;
    38 bool changed,grchanged;
    39 CallbackNode *panode,*pdnode,*pcnode,*ganode,*gdnode,*gcnode;
     37        MutableParamInterface &par;
     38        bool changed, grchanged;
     39        CallbackNode *panode, *pdnode, *pcnode, *ganode, *gdnode, *gcnode;
    4040
    4141#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);
    4848#undef STATRICKCLASS
    4949
    50 TwoWayMap propmap,groupmap;
     50        TwoWayMap propmap, groupmap;
    5151
    52 void resetMaps();
     52        void resetMaps();
    5353
    54   public:
    55 ParamTransaction(MutableParamInterface &mpi);
    56 ~ParamTransaction();
     54public:
     55        ParamTransaction(MutableParamInterface &mpi);
     56        ~ParamTransaction();
    5757
    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; }
    6161
    62 int propertyPosition(int prop);
    63 int groupPosition(int group);
     62        int propertyPosition(int prop);
     63        int groupPosition(int group);
    6464
    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(); }
    6868
    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 &);
    8888
    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        }
    9197};
    9298
Note: See TracChangeset for help on using the changeset viewer.