Coin: ScXMLMinimumEvaluator.h Source File

| 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
43public:
44 static void initClass(void);
45 static void cleanClass(void);
46
47 ScXMLMinimumEvaluator(void);
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
59private:
60 class PImpl;
61 SbLazyPimplPtr<PImpl> pimpl;
62
63}; // ScXMLMinimumEvaluator
64
65
66 class COIN_DLL_API ScXMLMinimumExprDataObj : public ScXMLExprDataObj {
67 SCXML_OBJECT_ABSTRACT_HEADER(ScXMLMinimumExprDataObj)
68 typedef ScXMLExprDataObj inherited;
69public:
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)
78 typedef ScXMLExprDataObj inherited;
79public:
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
92protected:
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;
103public:
104 static void initClass(void);
105 static void cleanClass(void);
106
107 static ScXMLDataObj * createFor(ScXMLDataObj * lhs, ScXMLDataObj * rhs);
108
109 ScXMLAppendOpExprDataObj(void);
110 ScXMLAppendOpExprDataObj(ScXMLDataObj * lhs, ScXMLDataObj * rhs);
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
118protected:
119 virtual SbBool evaluateNow(ScXMLStateMachine * sm, ScXMLDataObj *& pointer) const;
120
121private:
122 ScXMLDataObj * lhs, * rhs;
123
124};
125
126#endif // !COIN_SCXMLMINIMUMEVALUATOR_H
SbLazyPimplPtr
Definition SbLazyPimplPtr.h:56
ScXMLDataObj
base class for evaluator data objects in the SCXML data module
Definition ScXMLEvaluator.h:77
ScXMLEvaluator::clearTemporaryVariables
virtual void clearTemporaryVariables(void)
Definition ScXMLEvaluator.cpp:155
ScXMLEvaluator::setStateMachine
virtual void setStateMachine(ScXMLStateMachine *sm)
Definition ScXMLEvaluator.cpp:134
ScXMLMinimumEvaluator::locate
virtual ScXMLDataObj * locate(const char *location) const
Definition ScXMLMinimumEvaluator.cpp:134
ScXMLMinimumEvaluator::evaluate
virtual ScXMLDataObj * evaluate(const char *expression) const
Definition ScXMLMinimumEvaluator.cpp:115
ScXMLMinimumEvaluator::setAtLocation
virtual SbBool setAtLocation(const char *location, ScXMLDataObj *obj)
Definition ScXMLMinimumEvaluator.cpp:125
ScXMLMinimumExprDataObj
implements the data objects for the evaluator for the minimum profile.
Definition ScXMLMinimumEvaluator.h:66
ScXMLObject::cleanClass
static void cleanClass(void)
Does the opposite of initClass, deallocates any class specific resources and resets the class to an u...
Definition ScXMLObject.cpp:115
ScXMLObject::initClass
static void initClass(void)
Sets up initialization for data common to all instances of this class, like submitting necessary info...
Definition ScXMLObject.cpp:102
ScXMLStateMachine
Manager for processing events and setting states in SCXML structures.
Definition ScXMLStateMachine.h:61