File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1515use crate :: bindings as ll_bindings;
1616use crate :: SizeType ;
1717use crate :: { tsk_id_t, tsk_size_t, ProvenanceId , TskitError } ;
18+ use ll_bindings:: { tsk_provenance_table_free, tsk_provenance_table_init} ;
1819
1920#[ derive( Eq ) ]
2021/// Row of a [`ProvenanceTable`].
@@ -177,6 +178,31 @@ impl<'a> ProvenanceTable<'a> {
177178 }
178179}
179180
181+ build_owned_table_type ! (
182+ /// A provenance table that owns its own data.
183+ ///
184+ /// # Examples
185+ ///
186+ /// ```rust
187+ /// # #[cfg(any(doc, feature = "provenance"))] {
188+ /// use tskit::provenance::OwnedProvenanceTable;
189+ /// let mut provenances = OwnedProvenanceTable::default();
190+ /// let id = provenances.add_row("message").unwrap();
191+ /// assert_eq!(id, 0);
192+ /// assert_eq!(provenances.num_rows(), 1);
193+ /// # }
194+ /// ```
195+ => OwnedProvenanceTable ,
196+ ProvenanceTable ,
197+ tsk_provenance_table_t,
198+ tsk_provenance_table_init,
199+ tsk_provenance_table_free
200+ ) ;
201+
202+ impl OwnedProvenanceTable {
203+ provenance_table_add_row ! ( => add_row, self , * self . table) ;
204+ }
205+
180206#[ cfg( test) ]
181207mod test_provenances {
182208 use super :: * ;
You can’t perform that action at this time.
0 commit comments