line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
MODE: INLINE |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
#include |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
struct DateRecipe10; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
struct TimezoneRecipe10 { |
8
|
|
|
|
|
|
|
const char* get_name() const { return name.c_str(); } |
9
|
|
|
|
|
|
|
private: |
10
|
|
|
|
|
|
|
TimezoneRecipe10(const char* name_): name{name_} { } |
11
|
|
|
|
|
|
|
std::string name; |
12
|
|
|
|
|
|
|
friend struct DateRecipe10; |
13
|
|
|
|
|
|
|
}; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
struct DateRecipe10 { |
16
|
|
|
|
|
|
|
DateRecipe10(const char* tz_ = "Europe/Minsk"): tz(tz_) { update(); } |
17
|
|
|
|
|
|
|
~DateRecipe10() { std::cout << "~DateRecipe10()\n"; } |
18
|
|
|
|
|
|
|
void update() { epoch = std::time(nullptr); } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
int get_epoch() const { return epoch; } |
21
|
|
|
|
|
|
|
TimezoneRecipe10& get_timezone() { return tz; } |
22
|
|
|
|
|
|
|
private: |
23
|
|
|
|
|
|
|
std::time_t epoch; |
24
|
|
|
|
|
|
|
TimezoneRecipe10 tz; |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
namespace xs { |
28
|
|
|
|
|
|
|
template <> |
29
|
|
|
|
|
|
|
struct Typemap : TypemapObject { |
30
|
|
|
|
|
|
|
static std::string package () { return "MyTest::Cookbook::DateRecipe10"; } |
31
|
|
|
|
|
|
|
}; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
template <> |
34
|
|
|
|
|
|
|
struct Typemap : TypemapObject { |
35
|
|
|
|
|
|
|
static std::string package () { return "MyTest::Cookbook::TimezoneRecipe10"; } |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
}; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
static xs::Sv::payload_marker_t payload_marker_10; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
MODULE = MyTest::Cookbook PACKAGE = MyTest::Cookbook::TimezoneRecipe10 |
43
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
const char* TimezoneRecipe10::get_name() |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
MODULE = MyTest::Cookbook PACKAGE = MyTest::Cookbook::DateRecipe10 |
48
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
DateRecipe10* DateRecipe10::new(const char* name) |
51
|
0
|
0
|
|
|
|
|
|
52
|
0
|
0
|
|
|
|
|
void DateRecipe10::update() |
|
|
0
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
std::time_t DateRecipe10::get_epoch() |
55
|
0
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Sv DateRecipe10::get_timezone() { |
57
|
0
|
0
|
|
|
|
|
Object self {ST(0)}; |
|
|
0
|
|
|
|
|
|
58
|
0
|
0
|
|
|
|
|
Object tz = xs::out<>(&THIS->get_timezone()); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
|
auto self_ref = Ref::create(self); |
|
|
0
|
|
|
|
|
|
60
|
0
|
0
|
|
|
|
|
tz.payload_attach(self_ref, &payload_marker_10); |
61
|
0
|
0
|
|
|
|
|
RETVAL = tz.ref(); |
|
|
0
|
|
|
|
|
|
62
|
|
|
|
|
|
|
} |