Skip to content

Commit 79a1779

Browse files
Update documentation of Box and Store
1 parent a07b338 commit 79a1779

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/src/box.dart

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ enum _PutMode {
1717
Update,
1818
}
1919

20+
/// A box to store objects of a particular class.
2021
class Box<T> {
2122
Store _store;
2223
Pointer<Void> _cBox;

lib/src/store.dart

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ enum TxMode {
1313
Write,
1414
}
1515

16+
/// Represents an ObjectBox database and works together with [Box] to allow getting and putting Objects of
17+
/// specific type.
1618
class Store {
1719
Pointer<Void> _cStore;
1820
Map<Type, EntityDefinition> _entityDefinitions = {};
@@ -45,6 +47,10 @@ class Store {
4547
checkObxPtr(_cStore, "failed to create store");
4648
}
4749

50+
/// Closes this store.
51+
///
52+
/// This method is useful for unit tests; most real applications should open a Store once and keep it open until
53+
/// the app dies.
4854
close() {
4955
checkObx(bindings.obx_store_close(_cStore));
5056
}
@@ -75,5 +81,6 @@ class Store {
7581
}
7682
}
7783

84+
/// The low-level pointer to this store.
7885
get ptr => _cStore;
7986
}

0 commit comments

Comments
 (0)