| 1 |
|
| #include "EXTERN.h" |
| 2 |
|
| #include "perl.h" |
| 3 |
|
| #include "XSUB.h" |
| 4 |
|
| |
| 5 |
|
| # include "src/Datum.h" |
| 6 |
|
| # include "src/TypeSafeData.h" |
| 7 |
|
| # include "src/types.h" |
| 8 |
|
| |
| 9 |
0 |
| Datum* create(const char * classname) { |
| 10 |
|
| Datum *self; |
| 11 |
0 |
| Newx(self,1,Datum); |
| 12 |
0 |
| initialize_datum(self); |
| 13 |
0 |
| return self; |
| 14 |
|
| } |
| 15 |
|
| |
| 16 |
0 |
| void initialize_datum(Datum* self){ |
| 17 |
0 |
| initialize_typesafedata((TypeSafeData*)self); |
| 18 |
0 |
| self->position = 0; |
| 19 |
0 |
| self->weight = 1.0; |
| 20 |
0 |
| self->annotations = newAV(); |
| 21 |
0 |
| ((Identifiable*)self)->_type = _DATUM_; |
| 22 |
0 |
| ((Identifiable*)self)->_container = _MATRIX_; |
| 23 |
0 |
| ((Identifiable*)self)->_index = _DATUM_IDX_; |
| 24 |
0 |
| } |
| 25 |
|
| |
| 26 |
0 |
| void destroy_datum(Datum* self) { |
| 27 |
0 |
| destroy_typesafedata((TypeSafeData*)self); |
| 28 |
0 |
| SvREFCNT_dec( self->annotations ); |
| 29 |
0 |
| } |
| 30 |
|
| MODULE = Bio::PhyloXS::Matrices::Datum PACKAGE = Bio::PhyloXS::Matrices::Datum |
| 31 |
|
| |
| 32 |
|
| PROTOTYPES: DISABLE |
| 33 |
|
| |
| 34 |
|
| |
| 35 |
|
| Datum * |
| 36 |
|
| create (classname) |
| 37 |
|
| const char * classname |
| 38 |
|
| |
| 39 |
|
| void |
| 40 |
|
| initialize_datum (self) |
| 41 |
|
| Datum * self |
| 42 |
|
| PREINIT: |
| 43 |
|
| I32* temp; |
| 44 |
|
| PPCODE: |
| 45 |
0 |
| temp = PL_markstack_ptr++; |
| 46 |
0 |
| initialize_datum(self); |
| 47 |
0 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
0 |
0 |
0 |
|
| 48 |
|
| /* truly void, because dXSARGS not invoked */ |
| 49 |
0 |
| PL_markstack_ptr = temp; |
| 50 |
0 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 51 |
|
| } |
| 52 |
|
| /* must have used dXSARGS; list context implied */ |
| 53 |
0 |
| return; /* assume stack size is correct */ |
| 54 |
|
| |
| 55 |
|
| void |
| 56 |
|
| destroy_datum (self) |
| 57 |
|
| Datum * self |
| 58 |
|
| PREINIT: |
| 59 |
|
| I32* temp; |
| 60 |
|
| PPCODE: |
| 61 |
0 |
| temp = PL_markstack_ptr++; |
| 62 |
0 |
| destroy_datum(self); |
| 63 |
0 |
▶ | if (PL_markstack_ptr != temp) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (PL_markstack_ptr != temp) { |
0 |
0 |
0 |
|
| 64 |
|
| /* truly void, because dXSARGS not invoked */ |
| 65 |
0 |
| PL_markstack_ptr = temp; |
| 66 |
0 |
| XSRETURN_EMPTY; /* return empty stack */ |
| 67 |
|
| } |
| 68 |
|
| /* must have used dXSARGS; list context implied */ |
| 69 |
0 |
| return; /* assume stack size is correct */ |
| 70 |
|
| |