Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://coin3d.github.io
https://www.kongsberg.com/en/kogt/
ScXMLMinimumEvaluator.h
1 #ifndef COIN_SCXMLMINIMUMEVALUATOR_H
2 #define COIN_SCXMLMINIMUMEVALUATOR_H
3 
4 /**************************************************************************\
5  * Copyright (c) Kongsberg Oil & Gas Technologies AS
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are
10  * met:
11  *
12  * Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution.
18  *
19  * Neither the name of the copyright holder nor the names of its
20  * contributors may be used to endorse or promote products derived from
21  * this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 \**************************************************************************/
35 
36 #include <Inventor/scxml/ScXMLEvaluator.h>
37 #include <Inventor/tools/SbLazyPimplPtr.h>
38 
39 class COIN_DLL_API ScXMLMinimumEvaluator : public ScXMLEvaluator {
40  typedef ScXMLEvaluator inherited;
41  SCXML_OBJECT_HEADER(ScXMLMinimumEvaluator)
42 
43 public:
44  static void initClass(void);
45  static void cleanClass(void);
46 
48  virtual ~ScXMLMinimumEvaluator(void);
49 
50  virtual void setStateMachine(ScXMLStateMachine *);
51 
52  virtual ScXMLDataObj * evaluate(const char * expression) const;
53 
54  virtual SbBool setAtLocation(const char * location, ScXMLDataObj * obj);
55  virtual ScXMLDataObj * locate(const char * location) const;
56 
57  virtual void clearTemporaryVariables(void);
58 
59 private:
60  class PImpl;
62 
63 }; // ScXMLMinimumEvaluator
64 
65 
66 class COIN_DLL_API ScXMLMinimumExprDataObj : public ScXMLExprDataObj {
67  SCXML_OBJECT_ABSTRACT_HEADER(ScXMLMinimumExprDataObj)
69 public:
70  static void initClass(void);
71  static void cleanClass(void);
72 
73 }; // ScXMLMinimumDataObj
74 
75 
76 class COIN_DLL_API ScXMLInExprDataObj : public ScXMLMinimumExprDataObj {
77  SCXML_OBJECT_HEADER(ScXMLMinimumExprDataObj)
79 public:
80  static void initClass(void);
81  static void cleanClass(void);
82 
83  static ScXMLDataObj * createFor(const char * stateid);
84 
85  ScXMLInExprDataObj(void);
86  ScXMLInExprDataObj(const char * stateid);
87  virtual ~ScXMLInExprDataObj(void);
88 
89  void setStateId(const char * stateid);
90  const char * getStateId(void) const { return this->stateid; }
91 
92 protected:
93  char * stateid;
94 
95  virtual SbBool evaluateNow(ScXMLStateMachine * sm, ScXMLDataObj *& pointer) const;
96 
97 }; // ScXMLMinimumDataObj
98 
99 
100 class COIN_DLL_API ScXMLAppendOpExprDataObj : public ScXMLExprDataObj {
101  SCXML_OBJECT_HEADER(ScXMLAppendOpExprDataObj)
102  typedef ScXMLExprDataObj inherited;
103 public:
104  static void initClass(void);
105  static void cleanClass(void);
106 
107  static ScXMLDataObj * createFor(ScXMLDataObj * lhs, ScXMLDataObj * rhs);
108 
111  virtual ~ScXMLAppendOpExprDataObj(void);
112 
113  void setLHS(ScXMLDataObj * lhs);
114  const ScXMLDataObj * getLHS(void) const { return this->lhs; }
115  void setRHS(ScXMLDataObj * rhs);
116  const ScXMLDataObj * getRHS(void) const { return this->rhs; }
117 
118 protected:
119  virtual SbBool evaluateNow(ScXMLStateMachine * sm, ScXMLDataObj *& pointer) const;
120 
121 private:
122  ScXMLDataObj * lhs, * rhs;
123 
124 };
125 
126 #endif // !COIN_SCXMLMINIMUMEVALUATOR_H
Definition: ScXMLMinimumEvaluator.h:76
Definition: ScXMLMinimumEvaluator.h:100
implements the evaluator for the minimum profile.
Definition: ScXMLMinimumEvaluator.h:39
base class for evaluator data objects in the SCXML data module
Definition: ScXMLEvaluator.h:77
defines an interface for profile-dependent evaluators.
Definition: ScXMLEvaluator.h:44
implements the data objects for the evaluator for the minimum profile.
Definition: ScXMLMinimumEvaluator.h:66
virtual void setStateMachine(ScXMLStateMachine *sm)
Definition: ScXMLEvaluator.cpp:134
Definition: ScXMLEvaluator.h:223
virtual void clearTemporaryVariables(void)
Definition: ScXMLEvaluator.cpp:155
Base class for all SCXML objects.
Definition: ScXMLObject.h:41
Manager for processing events and setting states in SCXML structures.
Definition: ScXMLStateMachine.h:61