History

TimeSeriesPlatformLibrary: Added temporal support options to DataPublisher interfaces.

J. Ritchie Carroll committed 7 years ago

Commit 5c5b4061 parent 04505f228 files · +603 −300Browse files

Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/FilterExpressions (3 of 28 files). Show all

Unified · Split

3 files
  1. Source/Libraries/TimeSeriesPlatformLibrary/FilterExpressions/ExpressionTree.cpp +9 −9
  2. Source/Libraries/TimeSeriesPlatformLibrary/FilterExpressions/ExpressionTree.h +2 −2
  3. Source/Libraries/TimeSeriesPlatformLibrary/FilterExpressions/FilterExpressionParser.cpp +1 −1
Source/Libraries/TimeSeriesPlatformLibrary/FilterExpressions/ExpressionTree.cpp+9−9
@@ -387,24 +387,24 @@ Nullable<Guid> ValueExpression::ValueAsNullableGuid() const · 386 unmodified lines
387 return Cast<Guid>(Value);387 return Cast<Guid>(Value);
388}388}
389 389
390DateTime ValueExpression::ValueAsDateTime() const390datetime_t ValueExpression::ValueAsDateTime() const
391{391{
392 ValidateValueType(ExpressionValueType::DateTime);392 ValidateValueType(ExpressionValueType::DateTime);
393 393
394 if (ValueIsNullable)394 if (ValueIsNullable)
395 return Cast<Nullable<DateTime>>(Value).GetValueOrDefault();395 return Cast<Nullable<datetime_t>>(Value).GetValueOrDefault();
396 396
397 return Cast<DateTime>(Value);397 return Cast<datetime_t>(Value);
398}398}
399 399
400Nullable<DateTime> ValueExpression::ValueAsNullableDateTime() const400Nullable<datetime_t> ValueExpression::ValueAsNullableDateTime() const
401{401{
402 ValidateValueType(ExpressionValueType::DateTime);402 ValidateValueType(ExpressionValueType::DateTime);
403 403
404 if (ValueIsNullable)404 if (ValueIsNullable)
405 return Cast<Nullable<DateTime>>(Value);405 return Cast<Nullable<datetime_t>>(Value);
406 406
407 return Cast<DateTime>(Value);407 return Cast<datetime_t>(Value);
408}408}
409 409
410UnaryExpression::UnaryExpression(const ExpressionUnaryType unaryType, ExpressionPtr value) :410UnaryExpression::UnaryExpression(const ExpressionUnaryType unaryType, ExpressionPtr value) :
@@ -1626,7 +1626,7 @@ ValueExpressionPtr ExpressionTree::IsDate(const ValueExpressionPtr& testValue) c · 1215 unmodified lines
1626 if (testValue->ValueType == ExpressionValueType::DateTime)1626 if (testValue->ValueType == ExpressionValueType::DateTime)
1627 return ExpressionTree::True;1627 return ExpressionTree::True;
1628 1628
1629 DateTime timestamp;1629 datetime_t timestamp;
1630 1630
1631 if (testValue->ValueType == ExpressionValueType::String && TryParseTimestamp(testValue->ValueAsString().c_str(), timestamp))1631 if (testValue->ValueType == ExpressionValueType::String && TryParseTimestamp(testValue->ValueAsString().c_str(), timestamp))
1632 return ExpressionTree::True;1632 return ExpressionTree::True;
@@ -3119,7 +3119,7 @@ ValueExpressionPtr ExpressionTree::Convert(const ValueExpressionPtr& sourceValue · 1486 unmodified lines
3119 }3119 }
3120 case ExpressionValueType::DateTime:3120 case ExpressionValueType::DateTime:
3121 {3121 {
3122 const DateTime result = sourceValue->ValueAsDateTime();3122 const datetime_t result = sourceValue->ValueAsDateTime();
3123 const time_t value = to_time_t(result);3123 const time_t value = to_time_t(result);
3124 3124
3125 switch (targetValueType)3125 switch (targetValueType)
@@ -3236,7 +3236,7 @@ ValueExpressionPtr ExpressionTree::NullValue(const ExpressionValueType targetVal · 110 unmodified lines
3236 case ExpressionValueType::Guid:3236 case ExpressionValueType::Guid:
3237 return NewSharedPtr<ValueExpression>(ExpressionValueType::Guid, Nullable<Guid>(nullptr), true);3237 return NewSharedPtr<ValueExpression>(ExpressionValueType::Guid, Nullable<Guid>(nullptr), true);
3238 case ExpressionValueType::DateTime:3238 case ExpressionValueType::DateTime:
3239 return NewSharedPtr<ValueExpression>(ExpressionValueType::DateTime, Nullable<DateTime>(nullptr), true);3239 return NewSharedPtr<ValueExpression>(ExpressionValueType::DateTime, Nullable<datetime_t>(nullptr), true);
3240 default:3240 default:
3241 return NewSharedPtr<ValueExpression>(ExpressionValueType::Undefined, nullptr);3241 return NewSharedPtr<ValueExpression>(ExpressionValueType::Undefined, nullptr);
3242 }3242 }
Source/Libraries/TimeSeriesPlatformLibrary/FilterExpressions/ExpressionTree.h+2−2
@@ -127,8 +127,8 @@ namespace FilterExpressions · 126 unmodified lines
127 GSF::Guid ValueAsGuid() const;127 GSF::Guid ValueAsGuid() const;
128 Nullable<GSF::Guid> ValueAsNullableGuid() const;128 Nullable<GSF::Guid> ValueAsNullableGuid() const;
129 129
130 GSF::DateTime ValueAsDateTime() const;130 GSF::datetime_t ValueAsDateTime() const;
131 Nullable<GSF::DateTime> ValueAsNullableDateTime() const;131 Nullable<GSF::datetime_t> ValueAsNullableDateTime() const;
132 };132 };
133 133
134 typedef GSF::SharedPtr<ValueExpression> ValueExpressionPtr;134 typedef GSF::SharedPtr<ValueExpression> ValueExpressionPtr;
Source/Libraries/TimeSeriesPlatformLibrary/FilterExpressions/FilterExpressionParser.cpp+1−1
@@ -59,7 +59,7 @@ static GSF::Guid ParseGuidLiteral(string guidLiteral) · 58 unmodified lines
59 return ParseGuid(guidLiteral.c_str());59 return ParseGuid(guidLiteral.c_str());
60}60}
61 61
62static DateTime ParseDateTimeLiteral(string time)62static datetime_t ParseDateTimeLiteral(string time)
63{63{
64 // Remove any surrounding '#' symbols from date/time, ANTLR grammar already64 // Remove any surrounding '#' symbols from date/time, ANTLR grammar already
65 // ensures date/time starting with '#' symbol will also end with one65 // ensures date/time starting with '#' symbol will also end with one

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t