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

Commit 9fd40df

Browse files
authored
Merge pull request #1221 from KFilipek/doc_primitives
[doxygen] Add description for primitives group.
2 parents 2ab4604 + 3e72c6f commit 9fd40df

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
@@ -192,7 +192,44 @@
192192
*/
193193

194194
/** @defgroup synchronization Synchronization Primitives*/
195-
/** @defgroup primitives Primitives*/
195+
/** @defgroup primitives Primitives
196+
* Basic classes that provides PMEM-aware pointers and pool handlers.
197+
*
198+
* ## Pointers
199+
* There are few types to handle data on PMEM.
200+
* - @ref pmem::obj::persistent_ptr<T> - implements a smart pointer.
201+
* It encapsulates the [PMEMoid](https://pmem.io/2015/06/11/type-safety-macros.html) fat
202+
* pointer and provides member access, dereference and array access operators.
203+
* - @ref pmem::obj::experimental::self_relative_ptr<T> - implements a smart ptr.
204+
* It encapsulates the self offsetted pointer and provides member access, dereference and array access operators.
205+
* self_relative_ptr in comparison to persistent_ptr is:
206+
* - smaller size (8B vs 16B)
207+
* - can be used with atomic operations
208+
* - faster dereference (important in loop), also allows vectorization
209+
* - if stored in a persistent memory pool, it can only points to elements within the same pool
210+
* - @ref pmem::obj::p<T> - template class that can be used for all variables (except persistent pointers),
211+
* which are used in @ref transactions.
212+
* This class is not designed to be used with compound types. For that see the @ref pmem::obj::persistent_ptr.
213+
* - @ref pmem::obj::experimental::v<T> - property-like template class that has to be used for
214+
* all volatile variables that reside on persistent memory. This class ensures that the enclosed
215+
* type is always properly initialized by always calling the class default constructor
216+
* exactly once per instance of the application. This class has 8 bytes of storage overhead.
217+
*
218+
* ## Pool handles
219+
* Pool class provides basic operations on pmemobj [pools](https://pmem.io/2016/05/10/cpp-05.html). C++ API for pools should
220+
* not be mixed with C API. For example explicitly calling pmemobj_set_user_data(pop)
221+
* on pool which is handled by C++ pool object is undefined behaviour.
222+
*
223+
* There are few pool handlers:
224+
* - @ref pmem::obj::pool<T> - the template parameter defines the type of the root object within the pool.
225+
* This pool class inherits also some methods from the base class: @ref pmem::obj::pool_base.
226+
* Example: @snippet pool/pool.cpp pool_example
227+
* - @ref pmem::obj::pool_base<T> - non template, basic version of pool,
228+
* useful when specifying root type is not desirable. The typical usage
229+
* example would be:
230+
* @snippet pool/pool.cpp pool_base_example
231+
*/
232+
196233
/** @defgroup exceptions Exceptions
197234
* Possible exceptions that could be thrown by the libpmemobj++.
198235
*

0 commit comments

Comments
 (0)