Skip to content

Commit 7af5ade

Browse files
committed
Added HintUpdateDuration.
1 parent 2f0b63b commit 7af5ade

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

include/react/common/Types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "react/Defs.h"
1010
#include <cstdint>
11+
#include <chrono>
1112

1213
/***************************************/ REACT_IMPL_BEGIN /**************************************/
1314

@@ -21,5 +22,6 @@ ObjectId GetObjectId(const O& obj)
2122

2223
using TurnIdT = uint;
2324
using TurnFlagsT = uint;
25+
using UpdateDurationT = std::chrono::duration<uint, std::micro>;
2426

2527
/****************************************/ REACT_IMPL_END /***************************************/

include/react/interface/IReactiveEngine.h

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#pragma once
88

99
#include "react/Defs.h"
10+
#include "react/common/Types.h"
1011

1112
/***************************************/ REACT_IMPL_BEGIN /**************************************/
1213

@@ -23,8 +24,8 @@ struct IReactiveEngine
2324
using NodeT = TNode;
2425
using TurnT = TTurn;
2526

26-
void OnNodeCreate(NodeT& node) {}
27-
void OnNodeDestroy(NodeT& node) {}
27+
void OnNodeCreate(NodeT& node) {}
28+
void OnNodeDestroy(NodeT& node) {}
2829

2930
void OnNodeAttach(NodeT& node, NodeT& parent) {}
3031
void OnNodeDetach(NodeT& node, NodeT& parent) {}
@@ -34,7 +35,7 @@ struct IReactiveEngine
3435
void OnTurnEnd(TurnT& turn) {}
3536

3637
void OnTurnInputChange(NodeT& node, TurnT& turn) {}
37-
void OnTurnPropagate(TurnT& turn) {}
38+
void OnTurnPropagate(TurnT& turn) {}
3839

3940
void OnNodePulse(NodeT& node, TurnT& turn) {}
4041
void OnNodeIdlePulse(NodeT& node, TurnT& turn) {}
@@ -44,6 +45,8 @@ struct IReactiveEngine
4445

4546
template <typename F>
4647
bool TryMerge(F&& f) { return false; }
48+
49+
void HintUpdateDuration(NodeT& node, uint dur) {}
4750
};
4851

4952
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -155,6 +158,21 @@ struct EngineInterface
155158
{
156159
return Engine().TryMerge(std::forward<F>(f));
157160
}
161+
162+
static void HintUpdateDuration(NodeT& node, uint dur)
163+
{
164+
Engine().HintUpdateDuration(node, dur);
165+
}
166+
167+
};
168+
169+
///////////////////////////////////////////////////////////////////////////////////////////////////
170+
/// Traits
171+
///////////////////////////////////////////////////////////////////////////////////////////////////
172+
template <typename T>
173+
struct UseUpdateProfiling
174+
{
175+
static const bool value = false;
158176
};
159177

160178
/****************************************/ REACT_IMPL_END /***************************************/

0 commit comments

Comments
 (0)