Files
2014-06-30 13:58:10 +02:00

62 lines
1.5 KiB
C++

/*
* File: TrasnferContainer.h
* Author: jgaebler
*
* Created on May 10, 2012, 10:44 AM
*/
#pragma once
#ifndef TRANSFERCONTAINER_H
#define TRANSFERCONTAINER_H
#include "common/Defines.h"
#include "TransferList.h"
#include <byte_array.h>
#include <serializer_byte_array.h>
namespace ubeeme {
namespace moversight {
/**
* @brief Provides a container that can be transfered between a host and
* the cloud. The container is identified by the ID of the peer that
* uploads the messages or by the peer. In the download case, the peer
* is identified by the ID of the peer, which has stored the messages in
* the cloud.
*
* @author Jan G&auml;bler
* @class TransferContainer
* @ingroup Moversight
*/
class TransferContainer {
public:
TransferContainer();
TransferContainer(PeerID i, const TransferList & l);
TransferContainer(const TransferContainer& orig);
virtual ~TransferContainer();
void setPeerID(PeerID i);
const PeerID & getPeerID();
void setTransferList(TransferList & tl);
TransferList getTransferList();
// serialization methods
bool serialize(SerializerByteArray & serializer);
bool deserialize(byte const * buffer, int size, bool checkSize = true);
private:
PeerID id;
TransferList list;
};
}
}
#endif /* TRANSFERCONTAINER_H */