added virtual destructors to complete polymorphic life-cycles

This commit is contained in:
Jack Andersen 2015-07-15 15:56:33 -10:00
parent 993b30e4a5
commit 7114f079a4
4 changed files with 7 additions and 1 deletions

View File

@ -12,4 +12,3 @@ file(GLOB NOD_HEADERS include/NOD/*.hpp)
add_subdirectory(lib)
add_subdirectory(driver)
install(DIRECTORY include/NOD DESTINATION include/NOD)
set(NOD_LIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include CACHE PATH "NODLib include dir" FORCE)

View File

@ -16,6 +16,7 @@ namespace NOD
class DiscBase
{
public:
virtual ~DiscBase() {}
struct Header
{
char gameID[6];
@ -52,6 +53,7 @@ public:
class IPartition
{
public:
virtual ~IPartition() {}
enum Kind
{
PART_DATA,

View File

@ -21,6 +21,7 @@ public:
struct IReadStream
{
virtual ~IReadStream() {}
virtual uint64_t read(void* buf, uint64_t length)=0;
virtual void seek(int64_t offset, int whence=SEEK_SET)=0;
virtual uint64_t position() const=0;
@ -29,6 +30,7 @@ public:
struct IWriteStream
{
virtual ~IWriteStream() {}
virtual uint64_t write(void* buf, uint64_t length)=0;
};
virtual std::unique_ptr<IWriteStream> beginWriteStream(uint64_t offset=0) const=0;
@ -36,6 +38,7 @@ public:
struct IPartReadStream
{
virtual ~IPartReadStream() {}
virtual void seek(int64_t offset, int whence=SEEK_SET)=0;
virtual uint64_t position() const=0;
virtual uint64_t read(void* buf, uint64_t length)=0;
@ -43,6 +46,7 @@ struct IPartReadStream
struct IPartWriteStream
{
virtual ~IPartWriteStream() {}
virtual void seek(int64_t offset, int whence=SEEK_SET)=0;
virtual uint64_t position() const=0;
virtual uint64_t write(void* buf, uint64_t length)=0;

View File

@ -11,6 +11,7 @@ namespace NOD
class IAES
{
public:
virtual ~IAES() {}
virtual void encrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len)=0;
virtual void decrypt(const uint8_t* iv, const uint8_t* inbuf, uint8_t* outbuf, uint64_t len)=0;
virtual void setKey(const uint8_t* key)=0;