36 lines
690 B
C++
36 lines
690 B
C++
/*
|
||
* Memory.h
|
||
*
|
||
* Created on: 13 сент. 2019 г.
|
||
* Author: titov
|
||
*/
|
||
|
||
#ifndef SOURCE_DRIVER_MEMORY_H_
|
||
#define SOURCE_DRIVER_MEMORY_H_
|
||
|
||
#include "../peripheral/IMemoryAccess.hh"
|
||
#include <cstddef>
|
||
|
||
namespace driver {
|
||
|
||
class Memory : public peripheral::IMemoryAccess {
|
||
public:
|
||
bool read( char * data, std::size_t begin, std::size_t size );
|
||
bool write( const char * data, std::size_t begin, std::size_t size );
|
||
bool isReadComplete() const;
|
||
bool isWriteComplete() const;
|
||
std::size_t getCapacity() const;
|
||
|
||
Memory( char * memory, std::size_t size );
|
||
|
||
private:
|
||
char * const memory;
|
||
const std::size_t size;
|
||
};
|
||
|
||
}
|
||
|
||
|
||
|
||
#endif /* SOURCE_DRIVER_MEMORY_H_ */
|