rambrain
managedDummySwap.h
Go to the documentation of this file.
1 /* rambrain - a dynamical physical memory extender
2  * Copyright (C) 2015 M. Imgrund, A. Arth
3  * mimgrund (at) mpifr-bonn.mpg.de
4  * arth (at) usm.uni-muenchen.de
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef MANAGEDDUMMYSWAP_H
21 #define MANAGEDDUMMYSWAP_H
22 
23 #include "managedMemoryChunk.h"
24 #include "managedSwap.h"
25 
26 namespace rambrain
27 {
32 {
33 public:
35  virtual ~managedDummySwap() {
36  close();
37  }
38 
39  virtual global_bytesize swapIn ( managedMemoryChunk **chunklist, unsigned int nchunks );
40  virtual global_bytesize swapIn ( managedMemoryChunk *chunk );
41  virtual global_bytesize swapOut ( managedMemoryChunk **chunklist, unsigned int nchunks );
42  virtual global_bytesize swapOut ( managedMemoryChunk *chunk );
43  virtual void swapDelete ( managedMemoryChunk *chunk );
44 
45  virtual void close() {
46  closed = true;
47  }
48 };
49 
50 }
51 
52 #endif
53 
virtual void close()
Close the swap if not already closed.
managedDummySwap(rambrain::global_bytesize size)
Class that serves as a backend to managedMemory to actual write/read managedMemoryChunks to/from hard...
Definition: managedSwap.h:35
virtual global_bytesize swapOut(managedMemoryChunk **chunklist, unsigned int nchunks)
Trigger swap out of the chunks pointed to by chunklist.
virtual void swapDelete(managedMemoryChunk *chunk)
Mark chunk as deleted.
uint64_t global_bytesize
Definition: common.h:65
manages all managed Chunks of raw memory
A dummy swap that just copies swapped out chunks to a different location in ram.
virtual global_bytesize swapIn(managedMemoryChunk **chunklist, unsigned int nchunks)
Trigger swap in of the chunks pointed to by chunklist.