48 lines
899 B
C++
48 lines
899 B
C++
/*
|
|
* File: PeerIDSet.h
|
|
* Author: jgaebler
|
|
*
|
|
* Created on January 30, 2014, 4:26 PM
|
|
*/
|
|
#pragma once
|
|
|
|
#ifndef PEERIDSET_H
|
|
#define PEERIDSET_H
|
|
|
|
#include "common/Defines.h"
|
|
#include "common/container/Set.h"
|
|
|
|
#include <serializable.h>
|
|
|
|
namespace ubeeme {
|
|
namespace moversight {
|
|
|
|
/**
|
|
* @brief Provides a set of peer IDs
|
|
* @class PeerIDSet
|
|
* @author Jan Gäbler
|
|
* @ingroup Moversight
|
|
*/
|
|
class PeerIDSet : public Set<PeerID>, public Serializable {
|
|
|
|
void set(Archive &archive) {
|
|
|
|
if (archive.isReading()) {
|
|
|
|
std::vector<PeerID> v;
|
|
archive(v);
|
|
add(v);
|
|
|
|
} else {
|
|
std::vector<PeerID> v = toVector();
|
|
archive(v);
|
|
}
|
|
}
|
|
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif /* PEERIDSET_H */
|
|
|