Changes in src/Actions/Action_impl_pre.hpp [e4afb4:b4fa106]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Action_impl_pre.hpp
re4afb4 rb4fa106 42 42 #include <boost/preprocessor/seq/transform.hpp> 43 43 44 // some derived names: if CATEGORY is not given, we don't prefix with it 45 #ifdef CATEGORY 44 // some derived names 46 45 #define ACTION BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Action)) 47 46 #define COMMAND BOOST_PP_CAT(CATEGORY, ACTIONNAME) 48 47 #define STATE BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, State)) 49 48 #define PARAMS BOOST_PP_CAT(CATEGORY, BOOST_PP_CAT(ACTIONNAME, Parameters)) 50 #else51 #define ACTION BOOST_PP_CAT(ACTIONNAME, Action)52 #define COMMAND ACTIONNAME53 #define STATE BOOST_PP_CAT(ACTIONNAME, State)54 #define PARAMS BOOST_PP_CAT(ACTIONNAME, Parameters)55 #endif56 #define INSTANCE BOOST_PP_CAT(this_, BOOST_PP_CAT(ACTIONNAME, _instance))57 49 58 50 // check if no lists given … … 69 61 70 62 // check user has given name and category 63 #ifndef CATEGORY 64 ERROR: No "CATEGORY" defined in: __FILE__ 65 #endif 66 71 67 #ifndef ACTIONNAME 72 68 ERROR: No "ACTIONNAME" defined in: __FILE__ … … 114 110 >(\ 115 111 BOOST_PP_SEQ_ELEM(n, paramtokens)\ 116 , Traits.getDescription()\ 117 ); 112 , ValueStorage::getInstance().getDescription(\ 113 BOOST_PP_SEQ_ELEM(n, paramtokens)\ 114 )); 118 115 119 116 // prints set/queryCurrentValue (command) for paramreferences and paramtokens … … 128 125 #include "Actions/ActionRegistry.hpp" 129 126 #include "UIElements/Dialog.hpp" 130 131 #ifdef paramtokens 132 #define statenecessary 1 133 #endif 134 #ifndef statetokens 135 #define statenecessary 1 136 #endif 127 #include "Actions/ValueStorage.hpp" 128 137 129 138 130 // =========== memento to remember the state when undoing =========== 139 #ifdef statenecessary140 131 class STATE : public ActionState { 141 132 public: … … 163 154 ACTION::PARAMS params; 164 155 }; 165 #endif /* statenecessary */ 166 167 // (const) prototype to be placed into the ActionRegistry (must be deleted by registry itself) 168 const ACTION INSTANCE; 156 157 // =========== name of action =========== 158 const char ACTION::NAME[] = TOKEN; 169 159 170 160 // =========== constructor =========== 171 161 ACTION::ACTION () : 172 Action( ActionTrait<ACTION>())162 Action(NAME) 173 163 {} 174 164 175 165 // =========== destructor =========== 176 166 ACTION::~ACTION () 177 { 178 //std::cout << "Action ACTION is being destroyed." << std::endl; 179 } 167 {} 180 168 181 169 // =========== fill a dialog =========== … … 183 171 ASSERT(dialog,"No Dialog given when filling actionname's dialog"); 184 172 #if BOOST_PP_EQUAL(MAXPARAMTYPES,0) 185 dialog->queryEmpty( TOKEN, Traits.getDescription());173 dialog->queryEmpty(NAME, ValueStorage::getInstance().getDescription(NAME)); 186 174 #else 187 175 #define BOOST_PP_LOCAL_MACRO(n) dialog_print(~, n, ~) … … 204 192 { 205 193 ACTION::PARAMS params; 206 Action *ToCall = ActionRegistry::getInstance().getActionByName( TOKEN); //->clone(params);194 Action *ToCall = ActionRegistry::getInstance().getActionByName( ACTION::NAME ); //->clone(params); 207 195 #if BOOST_PP_NOT_EQUAL(MAXPARAMTYPES,0) 208 196 #define BOOST_PP_LOCAL_MACRO(n) value_print(~, n, setCurrentValue, ) … … 235 223 #undef PARAMS 236 224 #undef STATE 237 #undef INSTANCE238 225 239 226 #undef ACTIONNAME
Note:
See TracChangeset
for help on using the changeset viewer.