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

Commit 3e72c6f

Browse files
committed
[doxygen] Add description for primitives group.
1 parent 3cc48e1 commit 3e72c6f

File tree

1 file changed

+38
-1
lines changed

1 file changed

+38
-1
lines changed

doc/groups_definitions.dox

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,44 @@
162162
/** @defgroup allocation Allocation*/
163163
/** @defgroup data_view Data View*/
164164
/** @defgroup synchronization Synchronization Primitives*/
165-
/** @defgroup primitives Primitives*/
165+
/** @defgroup primitives Primitives
166+
* Basic classes that provides PMEM-aware pointers and pool handlers.
167+
*
168+
* ## Pointers
169+
* There are few types to handle data on PMEM.
170+
* - @ref pmem::obj::persistent_ptr<T> - implements a smart pointer.
171+
* It encapsulates the [PMEMoid](https://pmem.io/2015/06/11/type-safety-macros.html) fat
172+
* pointer and provides member access, dereference and array access operators.
173+
* - @ref pmem::obj::experimental::self_relative_ptr<T> - implements a smart ptr.
174+
* It encapsulates the self offsetted pointer and provides member access, dereference and array access operators.
175+
* self_relative_ptr in comparison to persistent_ptr is:
176+
* - smaller size (8B vs 16B)
177+
* - can be used with atomic operations
178+
* - faster dereference (important in loop), also allows vectorization
179+
* - if stored in a persistent memory pool, it can only points to elements within the same pool
180+
* - @ref pmem::obj::p<T> - template class that can be used for all variables (except persistent pointers),
181+
* which are used in @ref transactions.
182+
* This class is not designed to be used with compound types. For that see the @ref pmem::obj::persistent_ptr.
183+
* - @ref pmem::obj::experimental::v<T> - property-like template class that has to be used for
184+
* all volatile variables that reside on persistent memory. This class ensures that the enclosed
185+
* type is always properly initialized by always calling the class default constructor
186+
* exactly once per instance of the application. This class has 8 bytes of storage overhead.
187+
*
188+
* ## Pool handles
189+
* Pool class provides basic operations on pmemobj [pools](https://pmem.io/2016/05/10/cpp-05.html). C++ API for pools should
190+
* not be mixed with C API. For example explicitly calling pmemobj_set_user_data(pop)
191+
* on pool which is handled by C++ pool object is undefined behaviour.
192+
*
193+
* There are few pool handlers:
194+
* - @ref pmem::obj::pool<T> - the template parameter defines the type of the root object within the pool.
195+
* This pool class inherits also some methods from the base class: @ref pmem::obj::pool_base.
196+
* Example: @snippet pool/pool.cpp pool_example
197+
* - @ref pmem::obj::pool_base<T> - non template, basic version of pool,
198+
* useful when specifying root type is not desirable. The typical usage
199+
* example would be:
200+
* @snippet pool/pool.cpp pool_base_example
201+
*/
202+
166203
/** @defgroup exceptions Exceptions
167204
* Possible exceptions that could be thrown by the libpmemobj++.
168205
*

0 commit comments

Comments
 (0)