Skip to content

Commit f444ede

Browse files
committed
0.15.2
1 parent 2da3626 commit f444ede

File tree

10 files changed

+51
-30
lines changed

10 files changed

+51
-30
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
ObjectBox C and C++ API Changelog
22
=================================
33

4+
0.15.2 (2022-02-15)
5+
-------------------
6+
* Add store cloning
7+
* Fix attaching to a reopened store
8+
49
0.15.1 (2022-01-25)
510
-------------------
611
* Fix non-unique indexes triggering unique constraint violations in corner cases (introduced in 0.15.0)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ else ()
3131

3232
function(defineObjectBoxLib VARIANT)
3333
# Configuration updated for each release
34-
set(DL_VERSION 0.15.1)
34+
set(DL_VERSION 0.15.2)
3535

3636
# Platform detection and other setup
3737
set(DL_URL https://github.com/objectbox/objectbox-c/releases/download)

README.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ ObjectBox Data Persistence and Data Sync follows an offline-first approach and c
66

77
This is the **ObjectBox runtime library** to run ObjectBox as an embedded database in your C or C++ application.
88

9-
Here's a C++ example that inserts a `Task` data object (a plain user defined `struct`) into the database:
9+
Here's a C++ example that inserts a `Task` data object (a plain user defined `struct`) into the database:
1010
```c++
1111
obx::Box<Task> box(store);
1212
box.put({.text = "Buy milk"});
1313
```
1414
15-
See [ObjectBox C and C++ docs](https://cpp.objectbox.io/) for API details.
15+
See [ObjectBox C and C++ docs](https://cpp.objectbox.io/) for API details.
1616
17-
**Latest version: 0.15.1** (2022-01-26).
17+
**Latest version: 0.15.2** (2022-02-15).
1818
See [changelog](CHANGELOG.md) for more details.
1919
2020
Feature Highlights
@@ -36,7 +36,7 @@ Feature Highlights
3636
Some more technical details:
3737
3838
* Zero-copy reads for highest possible performance; access tens of millions of objects on commodity hardware
39-
* Lightweight for smart devices; its binary size is only around 1 MB
39+
* Lightweight for smart devices; its binary size is only around 1 MB
4040
* Direct support for [FlatBuffers](https://google.github.io/flatbuffers/) data objects (aka "flatbuffers table")
4141
* Flex type to represent any FlexBuffers
4242
* Secondary indexes based on object properties
@@ -50,10 +50,10 @@ In most cases you want to use the C and C++ APIs in combination with the **[Obje
5050
This way, you get a convenient C or C++ API which requires minimal code on your side to work with the database.
5151
5252
The APIs come as single header file for C and C++:
53-
54-
* C: [include/objectbox.h](include/objectbox.h)
55-
* C++: [include/objectbox.hpp](include/objectbox.hpp) (depends on objectbox.h)
56-
53+
54+
* C: [include/objectbox.h](include/objectbox.h)
55+
* C++: [include/objectbox.hpp](include/objectbox.hpp) (depends on objectbox.h)
56+
5757
Compile your code against it and use the binary library (.so, .dylib, .dll depending on the platform) to link against.
5858
Head over to [ObjectBox C and C++ installation docs](https://cpp.objectbox.io/installation) for step-by-step instructions.
5959
@@ -70,16 +70,16 @@ Examples
7070
Have a look at the following TaskList example apps, depending on your programming language and preference:
7171
7272
* [C, cursor, no generated code](examples/c-cursor-no-gen) - plain C; using flatcc directly; without any generated code
73-
* [C, with generated code](examples/c-gen) - plain C, using code generated by `objectbox-generator`
73+
* [C, with generated code](examples/c-gen) - plain C, using code generated by `objectbox-generator`
7474
* [C++, with generated code](examples/cpp-gen) - C++, using code generated by `objectbox-generator`
75-
* also includes sync client application example
75+
* also includes sync client application example
7676
7777
Documentation
7878
-------------
79-
* [C and C++ docs](https://cpp.objectbox.io/) - official ObjectBox C and C++ documentation
80-
* [include/objectbox.h](include/objectbox.h) - C API header file contains docs as code comments
81-
* [include/objectbox.hpp](include/objectbox.hpp) - C++ API header file contains docs as code comments
82-
* [C and C++ API reference docs](https://objectbox.io/docfiles/c/current/) - online HTML docs (Doxygen)
79+
* [C and C++ docs](https://cpp.objectbox.io/) - official ObjectBox C and C++ documentation
80+
* [include/objectbox.h](include/objectbox.h) - C API header file contains docs as code comments
81+
* [include/objectbox.hpp](include/objectbox.hpp) - C++ API header file contains docs as code comments
82+
* [C and C++ API reference docs](https://objectbox.io/docfiles/c/current/) - online HTML docs (Doxygen)
8383
8484
Current state / Changelog
8585
-------------------------
@@ -89,7 +89,7 @@ The C API is a thin wrapper around a robust DB core, which is version 3.x and al
8989
Until then, API improvements may result in breaking changes. For example, functions may still be renamed.
9090
9191
**[Changelog](CHANGELOG.md):** If you update from a previous version, please check the [changelog](CHANGELOG.md).
92-
Besides new features, there may be breaking changes requiring modifications to your code.
92+
Besides new features, there may be breaking changes requiring modifications to your code.
9393
9494
### Supported platforms:
9595
* Linux 64-bit
@@ -110,12 +110,12 @@ For the C API, data consists of bytes representing FlatBuffers tables, which you
110110
Other languages/bindings
111111
------------------------
112112
ObjectBox supports multiple platforms and languages.
113-
Besides C/C++, ObjectBox also offers:
113+
Besides C/C++, ObjectBox also offers:
114114
115115
* [ObjectBox Java / Kotlin](https://github.com/objectbox/objectbox-java): runs on Android, desktop, and servers.
116-
* [ObjectBox Swift](https://github.com/objectbox/objectbox-swift): build fast mobile apps for iOS (and macOS)
117-
* [ObjectBox Dart/Flutter](https://github.com/objectbox/objectbox-dart): cross-platform for mobile and desktop apps
118-
* [ObjectBox Go](https://github.com/objectbox/objectbox-go): great for data-driven tools and embedded server applications
116+
* [ObjectBox Swift](https://github.com/objectbox/objectbox-swift): build fast mobile apps for iOS (and macOS)
117+
* [ObjectBox Dart/Flutter](https://github.com/objectbox/objectbox-dart): cross-platform for mobile and desktop apps
118+
* [ObjectBox Go](https://github.com/objectbox/objectbox-go): great for data-driven tools and embedded server applications
119119
120120
121121
How can I help ObjectBox?
@@ -124,10 +124,10 @@ Let us know what you love, what you don’t, what do you want to see next?
124124
125125
**We're looking forward to receiving your comments and requests:**
126126
127-
- Add [GitHub issues](https://github.com/ObjectBox/objectbox-java/issues)
127+
- Add [GitHub issues](https://github.com/ObjectBox/objectbox-java/issues)
128128
- Upvote issues you find important by hitting the 👍/+1 reaction button
129129
- Drop us a line via [@ObjectBox_io](https://twitter.com/ObjectBox_io/)
130-
- ⭐ us, if you like what you see
130+
- ⭐ us, if you like what you see
131131
132132
Thank you! 🙏
133133
@@ -148,4 +148,3 @@ License
148148
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149149
See the License for the specific language governing permissions and
150150
limitations under the License.
151-

download.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tty -s || quiet=true
4444

4545
# Note: optional arguments like "--quiet" shifts argument positions in the case block above
4646

47-
version=${1:-0.15.1}
47+
version=${1:-0.15.2}
4848
os=${2:-$(uname)}
4949
arch=${3:-$(uname -m)}
5050
echo "Base config: OS ${os} and architecture ${arch}"

doxygen/Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
ObjectBox C and C++ API Changelog
44
=================================
55

6+
0.15.2 (2022-02-15)
7+
-------------------
8+
* Add store cloning
9+
* Fix attaching to a reopened store
10+
611
0.15.1 (2022-01-25)
712
-------------------
813
* Fix non-unique indexes triggering unique constraint violations in corner cases (introduced in 0.15.0)

doxygen/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "ObjectBox C and C++ API"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "0.15.1"
41+
PROJECT_NUMBER = "0.15.2"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

include/objectbox-sync.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "objectbox.h"
3535

3636
#if defined(static_assert) || defined(__cplusplus)
37-
static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 15 && OBX_VERSION_PATCH == 1,
37+
static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 15 && OBX_VERSION_PATCH == 2,
3838
"Versions of objectbox.h and objectbox-sync.h files do not match, please update");
3939
#endif
4040

include/objectbox-sync.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include "objectbox-sync.h"
2020
#include "objectbox.hpp"
2121

22-
static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 15 && OBX_VERSION_PATCH == 1,
22+
static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 15 && OBX_VERSION_PATCH == 2,
2323
"Versions of objectbox.h and objectbox-sync.hpp files do not match, please update");
2424

2525
static_assert(sizeof(obx_id) == sizeof(OBX_id_array::ids[0]),

include/objectbox.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern "C" {
5151
/// obx_version() or obx_version_is_at_least().
5252
#define OBX_VERSION_MAJOR 0
5353
#define OBX_VERSION_MINOR 15
54-
#define OBX_VERSION_PATCH 1 // values >= 100 are reserved for dev releases leading to the next minor/major increase
54+
#define OBX_VERSION_PATCH 2 // values >= 100 are reserved for dev releases leading to the next minor/major increase
5555

5656
//----------------------------------------------
5757
// Common types
@@ -693,9 +693,11 @@ OBX_C_API OBX_store* obx_store_open(OBX_store_options* opt);
693693
OBX_C_API bool obx_store_is_open(const char* path);
694694

695695
/// Attach to a previously opened store matching the path of the DB directory, which was used for opening the store.
696-
/// The returned store is a new instance (e.g. different pointer value) with its own lifetime and must also be closed.
696+
/// The returned store is a new instance (e.g. different pointer value) with its own lifetime and must also be closed
697+
/// via obx_store_close().
697698
/// The actual underlying store is only closed when the last store OBX_store instance is closed.
698699
/// @returns nullptr if no open store was found (i.e. not opened before or already closed)
700+
/// @see obx_store_clone() for "attaching" to a available store instance.
699701
OBX_C_API OBX_store* obx_store_attach(const char* path);
700702

701703
/// Combines the functionality of obx_store_attach() and obx_store_open() in a thread-safe way.
@@ -706,6 +708,16 @@ OBX_C_API OBX_store* obx_store_attach(const char* path);
706708
/// store (true) or a new store was created (false).
707709
OBX_C_API OBX_store* obx_store_attach_or_open(OBX_store_options* opt, bool check_matching_options, bool* out_attached);
708710

711+
/// Clone a previously opened store; while a store instance is usable from multiple threads, situations may exist
712+
/// in which cloning a store simplifies the overall lifecycle.
713+
/// E.g. when a store is used for multiple threads and it may only be fully released once the last thread completes.
714+
/// The returned store is a new instance (e.g. different pointer value) with its own lifetime and must also be closed
715+
/// via obx_store_close().
716+
/// The actual underlying store is only closed when the last store OBX_store instance is closed.
717+
/// @returns nullptr if the store could not be cloned
718+
/// @see obx_store_attach() for "cloning" using the store's path.
719+
OBX_C_API OBX_store* obx_store_clone(OBX_store* store);
720+
709721
/// For stores created outside of this C API, e.g. via C++ or Java, this is how you can use it via C too.
710722
/// Like this, it is OK to use the same store instance (same database) from multiple languages in parallel.
711723
/// Note: the store's life time will still be managed outside of the C API;

include/objectbox.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <optional>
2626
#endif
2727

28-
static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 15 && OBX_VERSION_PATCH == 1,
28+
static_assert(OBX_VERSION_MAJOR == 0 && OBX_VERSION_MINOR == 15 && OBX_VERSION_PATCH == 2,
2929
"Versions of objectbox.h and objectbox.hpp files do not match, please update");
3030

3131
static_assert(sizeof(obx_id) == sizeof(OBX_id_array::ids[0]),

0 commit comments

Comments
 (0)