Generalize Syncable interface and use mutex locks for SyncData

This commit is contained in:
Erik Broberg
2016-09-16 11:30:03 -04:00
parent 9e59cd3b8d
commit 0cd40512dd
4 changed files with 36 additions and 20 deletions

View File

@@ -37,6 +37,11 @@ namespace {
namespace openspace {
void SyncEngine::presync(bool isMaster) {
for (const auto& syncable : _syncables) {
syncable->presync(isMaster);
}
}
// should be called on sgct master
void SyncEngine::encode(SyncBuffer* syncBuffer) {
@@ -52,12 +57,14 @@ namespace openspace {
}
}
void SyncEngine::applySyncedUpdates() {
void SyncEngine::postsync(bool isMaster) {
for (const auto& syncable : _syncables) {
syncable->applySyncedUpdate();
syncable->postsync(isMaster);
}
}
void SyncEngine::addSyncable(Syncable* syncable) {
_syncables.push_back(syncable);
}