Inject SyncBuffer into SyncEngine. Add Doxygen comments for SyncEngine and SyncData

This commit is contained in:
Erik Broberg
2016-09-16 20:32:29 -04:00
parent dd304fee31
commit 7f393a3270
5 changed files with 94 additions and 26 deletions

View File

@@ -37,6 +37,13 @@ namespace {
namespace openspace {
SyncEngine::SyncEngine(SyncBuffer* syncBuffer)
: _syncBuffer(syncBuffer)
{
}
void SyncEngine::presync(bool isMaster) {
for (const auto& syncable : _syncables) {
syncable->presync(isMaster);
@@ -44,16 +51,18 @@ namespace openspace {
}
// should be called on sgct master
void SyncEngine::encode(SyncBuffer* syncBuffer) {
void SyncEngine::encodeSyncables() {
for (const auto& syncable : _syncables) {
syncable->encode(syncBuffer);
syncable->encode(_syncBuffer.get());
}
_syncBuffer->write();
}
//should be called on sgct slaves
void SyncEngine::decode(SyncBuffer* syncBuffer) {
void SyncEngine::decodeSyncables() {
_syncBuffer->read();
for (const auto& syncable : _syncables) {
syncable->decode(syncBuffer);
syncable->decode(_syncBuffer.get());
}
}