Base class for defining storages that acts like a slave in pierced synchronization. More...
#include <piercedStorage.hpp>
Public Types | |
typedef Kernel< id_t >::id_type | id_type |
template<typename PK_id_t > | |
using | Kernel = PiercedKernel<PK_id_t> |
typedef Kernel< id_t > | kernel_t |
enum | KernelType { KERNEL_NONE = -1 , KERNEL_STATIC = 0 , KERNEL_DYNAMIC = 1 } |
Public Member Functions | |
virtual | ~PiercedStorageSyncSlave () |
const PiercedKernel< id_t > * | getKernel () const |
KernelType | getKernelType () const |
PiercedSyncMaster::SyncMode | getSyncMode () const |
void | setDynamicKernel (const PiercedKernel< id_t > *kernel, PiercedSyncMaster::SyncMode syncMode) |
void | setStaticKernel (const PiercedKernel< id_t > *kernel) |
void | swap (PiercedStorageSyncSlave< id_t > &other) noexcept |
void | unsetKernel (bool release=true) |
Protected Attributes | |
const PiercedKernel< id_t > * | m_kernel |
KernelType | m_kernelType |
Base class for defining storages that acts like a slave in pierced synchronization.
Definition at line 66 of file piercedStorage.hpp.
typedef Kernel<id_t>::id_type bitpit::PiercedStorageSyncSlave< id_t >::id_type |
Type of ids stored in the container
Definition at line 82 of file piercedStorage.hpp.
using bitpit::PiercedStorageSyncSlave< id_t >::Kernel = PiercedKernel<PK_id_t> |
Kernel template
Definition at line 75 of file piercedStorage.hpp.
typedef Kernel<id_t> bitpit::PiercedStorageSyncSlave< id_t >::kernel_t |
Kernel
Definition at line 87 of file piercedStorage.hpp.
enum bitpit::PiercedStorageSyncSlave::KernelType |
Definition at line 90 of file piercedStorage.hpp.
|
virtual |
Destructor
Definition at line 220 of file piercedStorage.tpp.
|
protected |
Constructor.
Definition at line 34 of file piercedStorage.tpp.
|
protected |
Constructor.
kernel | is the kernel that will be set |
Definition at line 45 of file piercedStorage.tpp.
|
protected |
Constructor.
kernel | is the kernel that will be set |
syncMode | is the synchronization mode that will be used for the storage |
Definition at line 58 of file piercedStorage.tpp.
|
protected |
Constructor.
other | is another container of the same type (i.e., instantiated with the same template parameters) whose content is copied in this container |
Definition at line 71 of file piercedStorage.tpp.
|
protected |
Constructor.
The newly created pierced sync slave will be associated with the given static kernel.
other | is another container of the same type (i.e., instantiated with the same template parameters) whose content is copied in this container |
kernel | is the kernel that will be set |
Definition at line 108 of file piercedStorage.tpp.
|
protected |
Constructor.
The newly created pierced sync slave will be associated with the given dynamic kernel and will use the specified synchronization mode.
other | is another container of the same type (i.e., instantiated with the same template parameters) whose content is copied in this container |
kernel | is the kernel that will be set |
syncMode | is the synchronization mode that will be used for the storage |
Definition at line 128 of file piercedStorage.tpp.
|
protected |
Constructor.
other | is another container of the same type (i.e., instantiated with the same template parameters) whose content is moved in this container |
Definition at line 143 of file piercedStorage.tpp.
|
protected |
Constructor.
The newly created pierced sync slave will be associated with the given static kernel.
other | is another container of the same type (i.e., instantiated with the same template parameters) whose content is moved in this container |
kernel | is the kernel that will be set |
Definition at line 184 of file piercedStorage.tpp.
|
protected |
Constructor.
The newly created pierced sync slave will be associated with the given dynamic kernel and will use the given synchronization mode.
other | is another container of the same type (i.e., instantiated with the same template parameters) whose content is moved in this container |
kernel | is the kernel that will be set |
syncMode | is the synchronization mode that will be used for the storage |
Definition at line 206 of file piercedStorage.tpp.
|
protectedvirtual |
Internal function that will be called after setting a dynamic kernel.
Reimplemented in bitpit::PiercedStorage< value_t, id_t >, bitpit::PiercedStorage< bitpit::Cell, long >, bitpit::PiercedStorage< bitpit::Interface, long >, bitpit::PiercedStorage< bitpit::mapping::Info >, bitpit::PiercedStorage< bitpit::Vertex, long >, bitpit::PiercedStorage< bool >, bitpit::PiercedStorage< bool, key_t >, bitpit::PiercedStorage< double >, bitpit::PiercedStorage< double, long >, bitpit::PiercedStorage< long, long >, bitpit::PiercedStorage< std::array< double, 3 > >, bitpit::PiercedStorage< std::array< double, 3 >, long >, bitpit::PiercedStorage< std::size_t >, bitpit::PiercedStorage< stencil_t >, bitpit::PiercedStorage< value_t, key_t >, and bitpit::PiercedStorage< value_t, long >.
Definition at line 297 of file piercedStorage.tpp.
|
protectedvirtual |
Internal function that will be called after setting a static kernel.
kernel | is the kernel that will be set |
Reimplemented in bitpit::PiercedStorage< value_t, id_t >, bitpit::PiercedStorage< bitpit::Cell, long >, bitpit::PiercedStorage< bitpit::Interface, long >, bitpit::PiercedStorage< bitpit::mapping::Info >, bitpit::PiercedStorage< bitpit::Vertex, long >, bitpit::PiercedStorage< bool >, bitpit::PiercedStorage< bool, key_t >, bitpit::PiercedStorage< double >, bitpit::PiercedStorage< double, long >, bitpit::PiercedStorage< long, long >, bitpit::PiercedStorage< std::array< double, 3 > >, bitpit::PiercedStorage< std::array< double, 3 >, long >, bitpit::PiercedStorage< std::size_t >, bitpit::PiercedStorage< stencil_t >, bitpit::PiercedStorage< value_t, key_t >, and bitpit::PiercedStorage< value_t, long >.
Definition at line 260 of file piercedStorage.tpp.
|
protectedvirtual |
Internal function that will be called after unsetting the kernel.
release | if it's true the memory hold by the container will be released, otherwise the container will be cleared but its memory will not be released |
Reimplemented in bitpit::PiercedStorage< value_t, id_t >, bitpit::PiercedStorage< bitpit::Cell, long >, bitpit::PiercedStorage< bitpit::Interface, long >, bitpit::PiercedStorage< bitpit::mapping::Info >, bitpit::PiercedStorage< bitpit::Vertex, long >, bitpit::PiercedStorage< bool >, bitpit::PiercedStorage< bool, key_t >, bitpit::PiercedStorage< double >, bitpit::PiercedStorage< double, long >, bitpit::PiercedStorage< long, long >, bitpit::PiercedStorage< std::array< double, 3 > >, bitpit::PiercedStorage< std::array< double, 3 >, long >, bitpit::PiercedStorage< std::size_t >, bitpit::PiercedStorage< stencil_t >, bitpit::PiercedStorage< value_t, key_t >, and bitpit::PiercedStorage< value_t, long >.
Definition at line 327 of file piercedStorage.tpp.
|
protected |
Detach the kernel without clearing the container.
Definition at line 338 of file piercedStorage.tpp.
const PiercedKernel< id_t > * bitpit::PiercedStorageSyncSlave< id_t >::getKernel | ( | ) | const |
Gets a constant reference to the kernel of the storage
Definition at line 360 of file piercedStorage.tpp.
PiercedStorageSyncSlave< id_t >::KernelType bitpit::PiercedStorageSyncSlave< id_t >::getKernelType | ( | ) | const |
Get the type of kernel set for the storage.
Definition at line 371 of file piercedStorage.tpp.
PiercedSyncMaster::SyncMode bitpit::PiercedStorageSyncSlave< id_t >::getSyncMode | ( | ) | const |
Gets the syncronization mode of the storage.
Definition at line 382 of file piercedStorage.tpp.
void bitpit::PiercedStorageSyncSlave< id_t >::setDynamicKernel | ( | const PiercedKernel< id_t > * | kernel, |
PiercedSyncMaster::SyncMode | syncMode ) |
Sets the kernel that will be used by the storage.
The storage will dynamically synchronized with the kernel.
If a kernel has already been set for the storage, it is mandatory to unset it before setting a new one. Calling this function when the kernel is already associated with a kernel will lead to an exception being thrown.
kernel | is the kernel that will be set |
syncMode | is the synchronization mode that will be used for the storage |
Definition at line 278 of file piercedStorage.tpp.
void bitpit::PiercedStorageSyncSlave< id_t >::setStaticKernel | ( | const PiercedKernel< id_t > * | kernel | ) |
Sets the kernel that will be used by the storage
The storage will NOT be synchronized with the kernel. Every change to the kernel can potentially invalidate the link between kernel and storage.
If a kernel has already been set for the storage, it is mandatory to unset it before setting a new one. Calling this function when the kernel is already associated with a kernel will lead to an exception being thrown.
kernel | is the kernel that will be set |
Definition at line 238 of file piercedStorage.tpp.
|
noexcept |
Exchanges the content of the storage by the content of x, which is another storage object of the same type. Sizes may differ but the number of fields has to be the same.
After the call to this member function, the elements in this storage are those which were in x before the call, and the elements of x are those which were in this. All iterators, references and pointers remain valid for the swapped objects.
other | is another storage of the same type (i.e., instantiated with the same template parameters) whose content is swapped with that of this storage. |
Definition at line 406 of file piercedStorage.tpp.
void bitpit::PiercedStorageSyncSlave< id_t >::unsetKernel | ( | bool | release = true | ) |
Unsets the kernel.
release | if it's true the memory hold by the container will be released, otherwise the container will be cleared but its memory will not be released |
Definition at line 310 of file piercedStorage.tpp.
|
protected |
Definition at line 111 of file piercedStorage.hpp.
|
protected |
Definition at line 112 of file piercedStorage.hpp.