t/cookbook/recipe02.xsi

filter: Statementstmt 15.3% 2 / 13 Branchbran 11.7% 4 / 34 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 12.7% 6 / 47 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« src/xs/Sv.h ↑ Summary t/MyTest.xs »
1 MODE: INLINE
2  
3 #include <ctime>
4 #include <iostream>
5  
6 struct DateRecipe02a {
7 DateRecipe02a() { update() ; }
8 void update() { epoch = std::time(nullptr); }
9  
10 int get_epoch() const { return epoch; }
11 private:
12 std::time_t epoch;
13 };
14  
15 namespace xs {
16 template <>
17 struct Typemap<DateRecipe02a*> : TypemapObject<DateRecipe02a*, DateRecipe02a*, ObjectTypePtr, ObjectStorageIV, StaticCast> {
18 static std::string package () { return "MyTest::Cookbook::DateRecipe02a"; }
19 };
20 }
21  
22 struct DateRecipe02b {
23 DateRecipe02b() { update() ; }
24 void update() { epoch = std::time(nullptr); }
25  
26 int get_epoch() const { return epoch; }
27 private:
28 std::time_t epoch;
29 };
30  
31 namespace xs {
32 template <>
33 struct Typemap<DateRecipe02b*> : TypemapObject<DateRecipe02b*, DateRecipe02b*, ObjectTypePtr, ObjectStorageMG, StaticCast> {
34 static std::string package () { return "MyTest::Cookbook::DateRecipe02b"; }
35 };
36 }
37  
38 MODULE = MyTest::Cookbook PACKAGE = MyTest::Cookbook::DateRecipe02a
39 PROTOTYPES: DISABLE
40  
41 0 DateRecipe02a* DateRecipe02a::new() { RETVAL = new DateRecipe02a(); }
42 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
43 0 ▶void DateRecipe02a::update()
Branch: 4 branches
BranchTrueFalseTotal
void DateRecipe02a::update() 0 0 0
void DateRecipe02a::update() 0 0 0
void DateRecipe02a::update() 0 0 0
void DateRecipe02a::update() 0 0 0
44  
45 0 std::time_t DateRecipe02a::get_epoch()
46 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
47 BOOT {
48 35 ▶ Stash(__PACKAGE__, GV_ADD).mark_as_loaded(__MODULE__);
Branch: 2 branches
BranchTrueFalseTotal
Stash(__PACKAGE__, GV_ADD).mark_as_loaded(__MODULE__); 35 0 35
Stash(__PACKAGE__, GV_ADD).mark_as_loaded(__MODULE__); 35 0 35
49 }
50  
51 0 ▶void DateRecipe02a::DESTROY() {
Branch: 1 branch
BranchTrueFalseTotal
void DateRecipe02a::DESTROY() { 0 0 0
52 }
53  
54 MODULE = MyTest::Cookbook PACKAGE = MyTest::Cookbook::DateRecipe02b
55 PROTOTYPES: DISABLE
56  
57 0 DateRecipe02b* DateRecipe02b::new() { RETVAL = new DateRecipe02b(); }
58 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
59 0 ▶void DateRecipe02b::update()
Branch: 4 branches
BranchTrueFalseTotal
void DateRecipe02b::update() 0 0 0
void DateRecipe02b::update() 0 0 0
void DateRecipe02b::update() 0 0 0
void DateRecipe02b::update() 0 0 0
60  
61 0 std::time_t DateRecipe02b::get_epoch()
62 0 ▶ 
Branch: 1 branch
BranchTrueFalseTotal
0 0 0
63 BOOT {
64 35 ▶ Stash(__PACKAGE__, GV_ADD).mark_as_loaded(__MODULE__);
Branch: 2 branches
BranchTrueFalseTotal
Stash(__PACKAGE__, GV_ADD).mark_as_loaded(__MODULE__); 35 0 35
Stash(__PACKAGE__, GV_ADD).mark_as_loaded(__MODULE__); 35 0 35
65 }
« src/xs/Sv.h ↑ Summary t/MyTest.xs »