-
Notifications
You must be signed in to change notification settings - Fork 2
/
IDataBlockListCreator.h
42 lines (33 loc) · 1.08 KB
/
IDataBlockListCreator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* File: IDataBlockListCreator.h
* Author: Tobias Fleig <tobifleig@gmail.com>
*
* Created on September 16, 2015, 11:29 PM
*/
#ifndef SDI4FS_IDATABLOCKLISTCREATOR_H
#define SDI4FS_IDATABLOCKLISTCREATOR_H
#include "DataBlockList.h"
namespace SDI4FS {
/**
* Anonymously implemented callback for fs operations that may require the creation of one or more DataBlockLists.
*/
class IDataBlockListCreator {
public:
/**
* Allocate a new DataBlockList.
* Caller is responsible for cleaning up the created object.
* @return pointer to new DataBlockList or NULL
*/
virtual DataBlockList* alloc() = 0;
/**
* Frees a DataBlockList.
* Caller should drop all references to the given object, callee will clean it up.
* @param block pointer to the DataBlockList to free
*/
virtual void dealloc(DataBlockList* block) = 0;
virtual ~IDataBlockListCreator() {
// this desctructor has a body, because otherwise, gcc (linker) emits the infamous "undefined reference to vtable" error.
}
};
}
#endif // SDI4FS_IDATABLOCKLISTCREATOR_H