I'd like to call toTimestamp (const Enum &type, const SPL::rstring &str) in C++ primitive operator, but I can't find the way to specify TimestampFormat enum as the 1st parameter.
I could call counterpart SPL function toTimestamp( Sys.YYYY_MM_DD_hh_mm_ss, sTime ) like this:
myTime = toTimestamp( Sys.YYYY_MM_DD_hh_mm_ss, sTime );
I tried several ways (the following is one of them), but they cause compile errors.
using namespace SPL::Functions::Time;
myTime = toTimestamp( SPL::Functions::Time::YYYY_MM_DD_hh_mm_ss, timeString );
Thenks in advance.
This topic has been locked.
2 replies Latest Post - 2013-02-04T08:12:11Z by Saruton
Pinned topic How should I specify TimestampFormat enum in C++ primitive operator?
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
hnasgaard 27000064QT200 PostsACCEPTED ANSWER
Re: How should I specify TimestampFormat enum in C++ primitive operator?2013-02-01T13:06:56Z in response to SarutonCalling that version of toTimestamp from C++ primitive operators isn't supported. The problem is, that function takes a ref to a Enum, and you don't have an Enum to pass it. When using this from SPL code the Enum code is generated in response to its use. It doesn't exist anywhere else other than in the operator that uses it. If you write a small SPL example that uses that enum, you can see the generated code in output/src/type.
Saruton 270002YPVS111 PostsACCEPTED ANSWER
Re: How should I specify TimestampFormat enum in C++ primitive operator?2013-02-04T08:12:11Z in response to hnasgaardThanks for reply.
I understood the situation. The easiest way is add Functor or Custom which calls toTimestamp() and converts date/time string attribute to timestamp type. I think.
Thanks a lot!