Made Block a template class.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3219 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder 2003-05-12 21:28:21 +00:00
parent fe89a5bae9
commit 0a100e1176

View File

@ -14,18 +14,19 @@
namespace UDF {
template<class DataType>
class Block {
public:
Block(uint32 size)
: fSize(size)
, fData(malloc(size))
Block(uint32 blockSize)
: fSize(blockSize)
, fData(malloc(blockSize))
{
}
~Block() { free(fData); }
~Block() { free(Data()); }
uint32 Size() { return fSize; }
void* Data() { return fData; }
status_t InitCheck() { return fData ? B_OK : B_NO_MEMORY; }
DataType* Data() { return (DataType*)fData; }
status_t InitCheck() { return Data() ? B_OK : B_NO_MEMORY; }
private:
Block();