Files
MP-SPDZ/Protocols/BufferScope.h
Marcel Keller 78fe3d8bad Maintenance.
2024-07-09 12:19:52 +10:00

35 lines
551 B
C++

/*
* BufferScope.h
*
*/
#ifndef PROTOCOLS_BUFFERSCOPE_H_
#define PROTOCOLS_BUFFERSCOPE_H_
template<class T> class BufferPrep;
template<class T> class Preprocessing;
#include "Processor/OnlineOptions.h"
template<class T>
class BufferScope
{
T& prep;
int bak;
public:
BufferScope(T& prep, int buffer_size) :
prep(prep)
{
bak = this->prep.buffer_size;
this->prep.buffer_size = buffer_size;
}
~BufferScope()
{
prep.buffer_size = bak;
}
};
#endif /* PROTOCOLS_BUFFERSCOPE_H_ */