Skip to content

Commit 38f8b46

Browse files
committed
Improve Query object
1 parent f6337e6 commit 38f8b46

File tree

12 files changed

+3749
-767
lines changed

12 files changed

+3749
-767
lines changed

modules/yup_data_model/tree/yup_AtomicCachedValue.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace yup
3838
3939
@tparam T The type of value to cache atomically (must be atomic-compatible)
4040
*/
41-
template<typename T>
41+
template <typename T>
4242
class YUP_API AtomicCachedValue : private DataTree::Listener
4343
{
4444
public:
@@ -108,8 +108,8 @@ class YUP_API AtomicCachedValue : private DataTree::Listener
108108
propertyName = Identifier();
109109
hasDefaultValue = false;
110110
usingDefault = false;
111-
cachedValue.store (T{});
112-
defaultValue = T{};
111+
cachedValue.store (T {});
112+
defaultValue = T {};
113113
}
114114

115115
/** Returns true if this AtomicCachedValue is bound to a DataTree property. */
@@ -180,7 +180,7 @@ class YUP_API AtomicCachedValue : private DataTree::Listener
180180
{
181181
// Handle unbound case
182182
usingDefault = hasDefaultValue;
183-
cachedValue.store (hasDefaultValue ? defaultValue : T{});
183+
cachedValue.store (hasDefaultValue ? defaultValue : T {});
184184
}
185185
}
186186

@@ -213,14 +213,14 @@ class YUP_API AtomicCachedValue : private DataTree::Listener
213213
{
214214
if (! isBound())
215215
{
216-
cachedValue.store (hasDefaultValue ? defaultValue : T{});
216+
cachedValue.store (hasDefaultValue ? defaultValue : T {});
217217
usingDefault = hasDefaultValue;
218218
return;
219219
}
220220

221221
if (! dataTree.hasProperty (propertyName))
222222
{
223-
cachedValue.store (hasDefaultValue ? defaultValue : T{});
223+
cachedValue.store (hasDefaultValue ? defaultValue : T {});
224224
usingDefault = hasDefaultValue;
225225
return;
226226
}
@@ -234,7 +234,7 @@ class YUP_API AtomicCachedValue : private DataTree::Listener
234234
}
235235
catch (...)
236236
{
237-
cachedValue.store (hasDefaultValue ? defaultValue : T{});
237+
cachedValue.store (hasDefaultValue ? defaultValue : T {});
238238
usingDefault = hasDefaultValue;
239239
}
240240
}

modules/yup_data_model/tree/yup_CachedValue.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,10 @@ namespace yup
3838
3939
@tparam T The type of value to cache (must be copy-constructible)
4040
*/
41-
template<typename T>
41+
template <typename T>
4242
class YUP_API CachedValue : private DataTree::Listener
4343
{
4444
public:
45-
4645
//==============================================================================
4746
/** Creates an unbound CachedValue. */
4847
CachedValue() = default;
@@ -109,8 +108,8 @@ class YUP_API CachedValue : private DataTree::Listener
109108
propertyName = Identifier();
110109
hasDefaultValue = false;
111110
usingDefault = false;
112-
cachedValue = T{};
113-
defaultValue = T{};
111+
cachedValue = T {};
112+
defaultValue = T {};
114113
}
115114

116115
/** Returns true if this CachedValue is bound to a DataTree property. */
@@ -181,7 +180,7 @@ class YUP_API CachedValue : private DataTree::Listener
181180
{
182181
// Handle unbound case
183182
usingDefault = hasDefaultValue;
184-
cachedValue = hasDefaultValue ? defaultValue : T{};
183+
cachedValue = hasDefaultValue ? defaultValue : T {};
185184
}
186185
}
187186

@@ -215,14 +214,14 @@ class YUP_API CachedValue : private DataTree::Listener
215214
if (! isBound())
216215
{
217216
usingDefault = hasDefaultValue;
218-
cachedValue = hasDefaultValue ? defaultValue : T{};
217+
cachedValue = hasDefaultValue ? defaultValue : T {};
219218
return;
220219
}
221220

222221
if (! dataTree.hasProperty (propertyName))
223222
{
224223
usingDefault = hasDefaultValue;
225-
cachedValue = hasDefaultValue ? defaultValue : T{};
224+
cachedValue = hasDefaultValue ? defaultValue : T {};
226225
return;
227226
}
228227

@@ -235,7 +234,7 @@ class YUP_API CachedValue : private DataTree::Listener
235234
catch (...)
236235
{
237236
usingDefault = hasDefaultValue;
238-
cachedValue = hasDefaultValue ? defaultValue : T{};
237+
cachedValue = hasDefaultValue ? defaultValue : T {};
239238
}
240239
}
241240

0 commit comments

Comments
 (0)