HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SIM_SingleSolver.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  */
7 
8 #ifndef __SIM_SingleSolver_h__
9 #define __SIM_SingleSolver_h__
10 
11 #include "SIM_API.h"
12 #include "SIM_Solver.h"
13 
14 class SIM_Object;
15 
16 /// This class is a specialized version of SIM_Solver for solvers that
17 /// handle all objects in mutual affector relationships independently.
18 /// This class implements the solveObjectsSubclass() and
19 /// initializeObjectsSubclass() functions by calling the new virtuals
20 /// solveSingleObjectSubclass() and initializeSingleObjectSubclass()
21 /// for each object.
23 {
24 public:
25  /// Solve for the given object. This function is called for each timestep
26  /// after the one where the objects are first created. This function calls
27  /// solveObjectSubclass to perform the real work.
28  SIM_Result solveSingleObject(SIM_Engine &engine,
29  SIM_Object &object,
30  SIM_ObjectArray &feedbacktoobjects,
31  const SIM_Time &timestep,
32  bool newobject);
33 
34 protected:
35  /// Basic SIM_SingleSolver constructor.
36  explicit SIM_SingleSolver(const SIM_DataFactory *factory);
37  /// Basic SIM_SingleSolver destructor.
38  ~SIM_SingleSolver() override;
39 
40  /// Override this method to call solveSingleObject().
42  SIM_ObjectArray &objects,
43  SIM_ObjectArray &newobjects,
44  SIM_ObjectArray &feedbacktoobjects,
45  const SIM_Time &timestep) override;
46 
47  /// This method is called for each object passed to
48  /// solveObjectsSubclass().
49  virtual SIM_Result solveSingleObjectSubclass(SIM_Engine &engine,
50  SIM_Object &object,
51  SIM_ObjectArray &feedbacktoobjects,
52  const SIM_Time &timestep,
53  bool newobject) = 0;
54 
55 private:
58 };
59 
60 #endif
61 
#define DECLARE_STANDARD_GETCASTTOTYPE()
Definition: SIM_DataUtils.h:50
#define DECLARE_CLASSNAME(DataClass, SuperClass)
Definition: SIM_DataUtils.h:20
Holds pointers to a number of SIM_Object objects.
virtual SIM_Result solveObjectsSubclass(SIM_Engine &engine, SIM_ObjectArray &objects, SIM_ObjectArray &newobjects, SIM_ObjectArray &feedbacktoobjects, const SIM_Time &timestep)=0
#define SIM_API
Definition: SIM_API.h:12