Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 5bbf9a0

Browse files
docs: update miscellaneous Doxygen comments
1 parent f45d359 commit 5bbf9a0

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

doc/groups_definitions.dox

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,37 @@
55
/** @defgroup experimental_containers Experimental Containers */
66

77
/** @defgroup transactions Transactions
8-
* This section introduces transaction feature in libpmemobj-cpp.
8+
* Transactional approach to store data on pmem.
99
*
10-
* ## General info about transactions
10+
* # General info about transactions
11+
*
12+
* The heart of the libpmemobj are transactions. A transaction is defined as series of operations on
13+
* **persistent memory objects** that either all occur, or nothing occurs. In particular, if the execution
14+
* of a transaction is interrupted by a power failure or a system crash, it is guaranteed that after
15+
* system restart, all the changes made as a part of the uncompleted transaction will be rolled back,
16+
* restoring the consistent state of the memory pool from the moment when the transaction was started.
17+
*
18+
* @note Any operations not using libpmemobj-cpp API (like `int x = 5` or `malloc()`) used within
19+
* transaction will not be a part ot the transaction and won't be rolled back on failure! To properly
20+
* store variables on pmem use @ref primitives , to allocate data on pmem see @ref allocation functions.
21+
*
22+
* In C++ bindings (*this library*) transactions were designed (in comparison to C API)
23+
* to be as developer-friendly as possible. Even though libpmemobj++ are the bindings you should not
24+
* mix these two APIs - using libpmemobj (C API) in C++ application will not work!
1125
*
12-
* The heart of the libpmemobj are transactions, and they are designed to be developer-friendly.
1326
* Let's take a look at the following snippet:
1427
*
1528
* @snippet transaction/transaction.cpp general_tx_example
1629
*
17-
* Code snippet above is an example how automatic transaction can look like.
30+
* Code above is an example how automatic transaction can look like.
1831
* After object creation there are a few statements executed within a transaction.
19-
* Transaction will be committed during *tx* object's destruction at the end of scope.
32+
* Transaction will be committed during *tx* object's destruction at the end of the scope.
2033
*
2134
* It's worth noticing that @ref pmem::obj::flat_transaction is recommended to use over @ref pmem::obj::basic_transaction.
2235
* An extra explanation is provided inline an example in @ref pmem::obj::flat_transaction description.
2336
*
2437
* Mentioned above transactions are handled through two internal classes:
38+
*
2539
* - **manual** transactions has to be committed explicitly, otherwise it will abort.
2640
* All operations between creating and destroying the transaction
2741
* object are treated as performed in a transaction block and
@@ -31,6 +45,7 @@
3145
* they are already unlocked.
3246
* The best way to use manual transactions is by
3347
* @ref pmem::obj::transaction::run, which is used in example above.
48+
*
3449
* - **automatic** transactions are only available in C++17. All operations
3550
* between creating and destroying the transaction object are treated as
3651
* performed in a transaction block and can be rolled back.
@@ -43,7 +58,7 @@
4358
* If you want to read more and see example usages of both, you have to see
4459
* flat or basic transaction documentation, because each implementation may differ.
4560
*
46-
* ## Lifecycle and stages:
61+
* # Lifecycle and stages:
4762
*
4863
* When you are using transaction API a transaction can be in one of the following states:
4964
* - *TX_STAGE_NONE* - no open transaction in this thread
@@ -58,13 +73,12 @@
5873
*
5974
* ![lifecycle](https://pmem.io/assets/lifecycle.png "Transaction lifecycle")
6075
*
61-
* To be more familiar with functions used in diagram read:
62-
* [pmemobj_tx_begin manpage](https://pmem.io/pmdk/manpages/linux/master/libpmemobj/pmemobj_tx_begin.3.html),
63-
* this is a C API manpage for [libpmemobj](https://pmem.io/pmdk/libpmemobj/).
76+
* To be more familiar with functions used in diagram read e.g. **pmemobj_tx_begin**(3) manpage
77+
* (C API for [libpmemobj](https://pmem.io/pmdk/libpmemobj/), link below in *Additional resources*).
6478
*
6579
* If you need to read general information about transaction move to the *Additional resources* section.
6680
*
67-
* ## Example of flat_transaction
81+
* # Example of flat_transaction
6882
* For comparison with the previous snippet, here is a code snippet of
6983
* @ref pmem::obj::flat_transaction which is listed below with basic explanation inline.
7084
* @snippet transaction/transaction.cpp tx_nested_struct_example
@@ -73,7 +87,8 @@
7387
* For more examples please look at the
7488
* [examples directory](https://github.com/pmem/libpmemobj-cpp/tree/master/examples) in libpmemobj-cpp repository.
7589
*
76-
* ## Additional resources
90+
* # Additional resources
91+
* - [pmemobj_tx_begin(3) manpage with transaction description (C API)](https://pmem.io/pmdk/manpages/linux/master/libpmemobj/pmemobj_tx_begin.3)
7792
* - [blog post about transactions](https://pmem.io/2016/05/25/cpp-07.html)
7893
* - [blog post about transactional allocations](https://pmem.io/2016/05/19/cpp-06.html)
7994
*/

include/libpmemobj++/pool.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class persistent_ptr;
4444
* example would be:
4545
* @snippet pool/pool.cpp pool_base_example
4646
*
47-
* The exmple of using pool with RAII idiom:
47+
* The example of using pool with RAII idiom:
4848
* @snippet pool/pool_as_class_member.cpp pool_class_member_example
4949
* @ingroup primitives
5050
*/

include/libpmemobj++/string_view.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ basic_string_view<CharT, Traits>::crbegin() const noexcept
296296
}
297297

298298
/**
299-
* Returns an iterator to the first character of the view.
299+
* Returns a reverse_iterator to the first character of the view.
300300
* Reverse iterators iterate backwards: increasing
301301
* them moves them towards the beginning of the string.
302302
* This character acts as a placeholder, attempting to access it results
@@ -312,7 +312,7 @@ basic_string_view<CharT, Traits>::rend() const noexcept
312312
}
313313

314314
/**
315-
* Returns an iterator to the first character of the view.
315+
* Returns a reverse_iterator to the first character of the view.
316316
* Reverse iterators iterate backwards: increasing
317317
* them moves them towards the beginning of the string.
318318
* This character acts as a placeholder, attempting to access it results

0 commit comments

Comments
 (0)