2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
4 #include "bbstdDateTime.h"
5 #include "bbstdPackage.h"
15 BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,DateTime)
16 BBTK_BLACK_BOX_IMPLEMENTATION(DateTime,bbtk::AtomicBlackBox);
18 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
20 void DateTime::Process()
23 // THE MAIN PROCESSING METHOD BODY
24 // Here we simply set the input 'In' value to the output 'Out'
25 // And print out the output value
26 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
27 // void bbSet{Input|Output}NAME(const TYPE&)
28 // const TYPE& bbGet{Input|Output}NAME() const
30 // * NAME is the name of the input/output
31 // (the one provided in the attribute 'name' of the tag 'input')
32 // * TYPE is the C++ type of the input/output
33 // (the one provided in the attribute 'type' of the tag 'input')
34 // bbSetOutputOut( bbGetInputIn() );
35 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
37 std::time_t t = std::time(nullptr);
38 std::tm tm = *std::localtime(&t);
40 std::stringstream ssDate;
41 ssDate << std::put_time(&tm, "%Y/%m/%d");
42 std::string date = ssDate.str();
44 std::stringstream ssTime;
45 ssTime << std::put_time(&tm, "%H:%M");
46 std::string time = ssTime.str();
47 bbSetOutputDate( date );
48 bbSetOutputTime( time );
51 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
53 void DateTime::bbUserSetDefaultValues()
56 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
57 // Here we initialize the input 'In' to 0
62 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
64 void DateTime::bbUserInitializeProcessing()
67 // THE INITIALIZATION METHOD BODY :
69 // but this is where you should allocate the internal/output pointers
75 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
77 void DateTime::bbUserFinalizeProcessing()
80 // THE FINALIZATION METHOD BODY :
82 // but this is where you should desallocate the internal/output pointers