File Coverage

t/cookbook/recipe04.xsi
Criterion Covered Total %
statement 0 11 0.0
branch 0 8 0.0
condition n/a
subroutine n/a
pod n/a
total 0 19 0.0


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