OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Action.h
Go to the documentation of this file.
1 #ifndef OPAL_Action_HH
2 #define OPAL_Action_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: Action.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: Action
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2000/03/27 09:33:34 $
17 // $Author: Andreas Adelmann $
18 //
19 // ------------------------------------------------------------------------
20 
21 #include "AbstractObjects/Object.h"
22 
23 
24 // Class Action
25 // ------------------------------------------------------------------------
27 // It implements the common behavior of actions, it can also be used via
28 // dynamic casting to determine whether an object represents an action.
29 
30 class Action: public Object {
31 
32 public:
33 
34  virtual ~Action();
35 
37  // Always return [b]true[/b].
38  virtual bool canReplaceBy(Object *object);
39 
41  // Return the string "ACTION".
42  virtual const std::string getCategory() const;
43 
45  // If true, the object's execute() function should be traced.
46  // Always true for actions.
47  virtual bool shouldTrace() const;
48 
50  // If true, the data structure should be updated before calling execute().
51  // Always true for actions.
52  virtual bool shouldUpdate() const;
53 
54 protected:
55 
57  Action(int size, const char *name, const char *help);
58 
60  Action(const std::string &name, Action *parent);
61 
62 private:
63 
64  // Not implemented.
65  Action();
66  Action(const Action &);
67  void operator=(const Action &);
68 };
69 
70 #endif // OPAL_Action_HH
const std::string name
The base class for all OPAL actions.
Definition: Action.h:30
virtual bool shouldUpdate() const
Update flag.
Definition: Action.cpp:44
virtual const std::string getCategory() const
Return the object category as a string.
Definition: Action.cpp:34
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.
Definition: Action.cpp:29
virtual ~Action()
Definition: Action.cpp:25
void operator=(const Action &)
Action(const Action &)
virtual bool shouldTrace() const
Trace flag.
Definition: Action.cpp:39
The base class for all OPAL objects.
Definition: Object.h:48