Base class for defining an object that acts like a master in pierced synchronization. More...
#include <piercedSync.hpp>

Classes | |
struct | SyncModeHasher |
Public Types | |
typedef std::vector< PiercedSyncSlave * > | SyncGroup |
enum | SyncMode { SYNC_MODE_CONCURRENT , SYNC_MODE_JOURNALED , SYNC_MODE_DISABLED , SYNC_MODE_ITR_COUNT = SYNC_MODE_DISABLED + 1 , SYNC_MODE_ITR_BEGIN = 0 , SYNC_MODE_ITR_END = SYNC_MODE_ITR_BEGIN + SYNC_MODE_ITR_COUNT } |
Protected Member Functions | |
PiercedSyncMaster () | |
void | dump (std::ostream &stream) const |
PiercedSyncMaster::SyncMode | getSlaveSyncMode (const PiercedSyncSlave *slave) const |
bool | isSlaveRegistered (const PiercedSyncSlave *slave) const |
bool | isSlaveSynced (const PiercedSyncSlave *slave) const |
bool | isSynced () const |
bool | isSyncEnabled () const |
void | processSyncAction (const PiercedSyncAction &action) |
void | registerSlave (PiercedSyncSlave *slave, PiercedSyncMaster::SyncMode syncMode) const |
void | restore (std::istream &stream) |
void | setSyncEnabled (bool enabled) const |
void | swap (PiercedSyncMaster &other) noexcept |
void | sync () |
void | unregisterSlave (const PiercedSyncSlave *slave) const |
Protected Attributes | |
std::unordered_map< PiercedSyncSlave *, SyncMode > | m_slaves |
Detailed Description
Base class for defining an object that acts like a master in pierced synchronization.
Definition at line 128 of file piercedSync.hpp.
Member Typedef Documentation
◆ SyncGroup
typedef std::vector<PiercedSyncSlave *> bitpit::PiercedSyncMaster::SyncGroup |
Slave synchronization group definition
Definition at line 134 of file piercedSync.hpp.
Member Enumeration Documentation
◆ SyncMode
Synchronization mode
Definition at line 139 of file piercedSync.hpp.
Constructor & Destructor Documentation
◆ PiercedSyncMaster()
|
protected |
Constructor
Definition at line 213 of file piercedSync.cpp.
Member Function Documentation
◆ dump()
|
protected |
Dump the object.
- Parameters
-
stream is the stream data should be written to
Definition at line 564 of file piercedSync.cpp.
◆ getSlaveSyncMode()
|
protected |
Get the synchronization mode for the specified slave
- Parameters
-
slave is the slave for which the synchronization mode is requested
- Returns
- The synchronization mode of the slave
Definition at line 463 of file piercedSync.cpp.
◆ isSlaveRegistered()
|
protected |
Check if te specified slave is registered.
- Parameters
-
slave is the slave to check
Definition at line 452 of file piercedSync.cpp.
◆ isSlaveSynced()
|
protected |
Check if the specified slave is synced.
If synchronization is disabled for the slave, the slaved will be always considered out-of-sync.
- Parameters
-
slave is the slave for which the check has to be performed
- Returns
- Returns true if the slave is synchronized, false otherwise.
Definition at line 477 of file piercedSync.cpp.
◆ isSynced()
|
protected |
Check if all the slaves are synced.
- Returns
- Returns true if all slave are synchronized, false otherwise.
Definition at line 511 of file piercedSync.cpp.
◆ isSyncEnabled()
|
protected |
Checks if the synchronization is enabled.
- Returns
- Returns true if the synchronization is be enabled, otherwise it returns false
Definition at line 539 of file piercedSync.cpp.
◆ processSyncAction()
|
protected |
Process the specified synchronization action.
- Parameters
-
action is the synchronization action that will be processed
Definition at line 271 of file piercedSync.cpp.
◆ registerSlave()
|
protected |
Register the specified slave
- Parameters
-
slave is the slave that will be registered syncMode is the synchronization mode that will be used for the slave
Definition at line 247 of file piercedSync.cpp.
◆ restore()
|
protected |
Restore the object.
- Parameters
-
stream is the stream data should be read from
Definition at line 549 of file piercedSync.cpp.
◆ setSyncEnabled()
|
protected |
Enabled the synchronization.
- Parameters
-
enabled is set to true the synchronization will be enabled, otherwise it will be disabled
Definition at line 528 of file piercedSync.cpp.
◆ swap()
|
protectednoexcept |
Exchanges the content of the kernel by the content of x, which is another kernel object of the same type. Sizes may differ.
After the call to this member function, the elements in this kernel 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.
- Parameters
-
other is another kernel of the same type (i.e., instantiated with the same template parameters) whose content is swapped with that of this kernel.
Definition at line 234 of file piercedSync.cpp.
◆ sync()
|
protected |
Syncronize all the registered slaves.
Definition at line 492 of file piercedSync.cpp.
◆ unregisterSlave()
|
protected |
Unregister the specified slave
- Parameters
-
slave is the slave that will be unregistered
Definition at line 425 of file piercedSync.cpp.
Member Data Documentation
◆ m_slaves
|
mutableprotected |
Slaves
Definition at line 164 of file piercedSync.hpp.
The documentation for this class was generated from the following files:
- src/containers/piercedSync.hpp
- src/containers/piercedSync.cpp
