ctkExampleDerivedWorkflowStep.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) 2010 Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.commontk.org/LICENSE
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkExampleDerivedWorkflowStep_h
  15. #define __ctkExampleDerivedWorkflowStep_h
  16. // CTK includes
  17. #include "ctkPimpl.h"
  18. #include "ctkWorkflowStep.h"
  19. #include "ctkWorkflowTransitions.h"
  20. class ctkExampleDerivedWorkflowStepPrivate;
  21. ///
  22. /// ctkExampleDerivedWorkflowStep is an example custom step created by
  23. /// deriving ctkWorkflowStep and re-implementing validate(const QString&),
  24. /// onEntry() and onExit().
  25. class ctkExampleDerivedWorkflowStep : public ctkWorkflowStep
  26. {
  27. Q_OBJECT
  28. public:
  29. typedef ctkWorkflowStep Superclass;
  30. explicit ctkExampleDerivedWorkflowStep(ctkWorkflow* newWorkflow, const QString& newId);
  31. virtual ~ctkExampleDerivedWorkflowStep(){}
  32. /// Get the values for the counters of the number of times we have
  33. /// run the onEntry() and onExit() functions
  34. virtual int numberOfTimesRanOnEntry()const;
  35. virtual int numberOfTimesRanOnExit()const;
  36. virtual void validate(const QString& desiredBranchId = QString());
  37. /// Increments the counter numberOfTimesRanOnEntry
  38. virtual void onEntry(const ctkWorkflowStep* comingFrom,
  39. const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType);
  40. /// Increments the counter numberOfTimesRanOnExit
  41. virtual void onExit(const ctkWorkflowStep* goingTo,
  42. const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType);
  43. private:
  44. CTK_DECLARE_PRIVATE(ctkExampleDerivedWorkflowStep);
  45. };
  46. #endif