|
162 | 162 | /** @defgroup allocation Allocation*/ |
163 | 163 | /** @defgroup data_view Data View*/ |
164 | 164 | /** @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 | + |
166 | 203 | /** @defgroup exceptions Exceptions |
167 | 204 | * Possible exceptions that could be thrown by the libpmemobj++. |
168 | 205 | * |
|
0 commit comments