Changes in src/Actions/Action.hpp [10fa1d:e4afb4]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Action.hpp
r10fa1d re4afb4 11 11 #include <string> 12 12 #include <boost/shared_ptr.hpp> 13 14 /** Used in .def files in paramdefaults define to set that no default value exists. 15 * We define NODEFAULT here, as it is used in .def files and needs to be present 16 * before these are included. 17 */ 18 #define NODEFAULT std::string() 13 19 14 20 // forward declaration … … 17 23 class ActionSequence; 18 24 class Dialog; 25 26 #include "Actions/ActionTraits.hpp" 19 27 20 28 /** … … 294 302 */ 295 303 304 296 305 /** 297 306 * Base class for all actions. … … 319 328 * be registered with the ActionRegistry. If the Action is registered the name of the 320 329 * Action needs to be unique for all Actions that are registered. 321 */ 322 Action(std::string _name,bool _doRegister=true); 330 * 331 * \note NO reference for \a _Traits as we do have to copy it, otherwise _Traits would have 332 * to be present throughout the program's run. 333 * 334 * \param Traits information class to this action 335 * \param _doRegister whether to register with ActionRegistry 336 */ 337 Action(const ActionTraits &_Traits, bool _doRegister=true); 323 338 virtual ~Action(); 324 339 … … 363 378 * Returns the name of the Action. 364 379 */ 365 virtual const std::string getName(); 380 const std::string getName(); 381 382 /** 383 * Traits resemble all necessary information that "surrounds" an action, such as 384 * its name (for ActionRegistry and as ref from string to instance and vice versa), 385 * which menu, which position, what parameters, their types, if it is itself a 386 * parameter and so on ... 387 * 388 * Note that is important that we do not use a reference here. We want to copy the 389 * information in the Action's constructor and have it contained herein. Hence, we 390 * also have our own copy constructor for ActionTraits. Information should be 391 * encapsulated in the Action, no more references to the outside than absolutely 392 * necessary. 393 */ 394 const ActionTraits Traits; 366 395 367 396 protected: … … 440 469 */ 441 470 virtual state_ptr performRedo(state_ptr)=0; 442 443 std::string name;444 471 }; 445 472
Note:
See TracChangeset
for help on using the changeset viewer.