HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DEP_TimedMicroNode.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  * NAME: DEP_TimedMicroNode.h (DEP Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __DEP_TIMEDMICRONODE_H_INCLUDED__
12 #define __DEP_TIMEDMICRONODE_H_INCLUDED__
13 
14 #include "DEP_API.h"
15 #include "DEP_MicroNode.h"
16 #include <SYS/SYS_Math.h>
17 #include <SYS/SYS_Types.h>
18 #include <float.h>
19 
20 /// MicroNode that caches the last time it was updated to determine if requires
21 /// an update.
23 {
24 public:
26  : myLastUpdateTime(DBL_MAX)
27  {
28  }
29 
30  virtual const char *
31  className() const
32  {
33  return "DEP_TimedMicroNode";
34  }
35 
36  virtual bool
38  {
40  return true;
41  return (isTimeDependent() && !isSameTime(t, myLastUpdateTime));
42  }
43 
44  virtual void
46  {
47  myLastUpdateTime = t;
48  if (!isTimeDependent())
51  }
52 
53 private:
54  fpreal myLastUpdateTime;
55 };
56 
57 #endif // __DEP_TIMEDMICRONODE_H_INCLUDED__
static SYS_FORCE_INLINE bool isSameTime(fpreal a, fpreal b)
virtual const char * className() const
virtual void update(fpreal t)
Definition: DEP_MicroNode.h:89
virtual bool requiresUpdate(fpreal t) const
Definition: DEP_MicroNode.h:96
virtual bool requiresUpdate(fpreal t) const
bool isTimeDependent() const
Flag accessors.
double fpreal
Definition: SYS_Types.h:269
bool inheritTimeDependentFromExplicitInputs()
#define DEP_API
Definition: DEP_API.h:10
virtual void update(fpreal t)