btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / bin / makeudfimage / PhysicalPartitionAllocator.h
bloba659fcfbdc94fd0e015a78ee5dd952eb611439e8
1 //----------------------------------------------------------------------
2 // This software is part of the OpenBeOS distribution and is covered
3 // by the MIT License.
4 //
5 // Copyright (c) 2003 Tyler Dauwalder, tyler@dauwalder.net
6 //----------------------------------------------------------------------
8 /*! \file PhysicalPartitionAllocator.h
10 Udf physical partition allocator (declarations).
13 #ifndef _PHYSICAL_PARTITION_ALLOCATOR_H
14 #define _PHYSICAL_PARTITION_ALLOCATOR_H
16 #include <list>
18 #include "Allocator.h"
19 #include "UdfStructures.h"
21 /*! \brief Allocates blocks and extents from a Udf physical partition.
23 class PhysicalPartitionAllocator {
24 public:
25 PhysicalPartitionAllocator(uint16 number, uint32 offset, Allocator &allocator);
27 status_t GetNextBlock(uint32 &block, uint32 &physicalBlock);
28 status_t GetNextExtent(uint32 length, bool contiguous, long_address &extent,
29 extent_address &physicalExtent = dummyExtent);
30 status_t GetNextExtents(off_t length, std::list<long_address> &extents,
31 std::list<extent_address> &physicalExtents);
34 uint16 PartitionNumber() const { return fNumber; }
35 uint32 Length() const;
36 private:
37 static extent_address dummyExtent;
38 uint16 fNumber; //!< The partition number of this partition
39 uint32 fOffset; //!< The offset of the start of this partition in physical space
40 Allocator &fAllocator;
43 #endif // _PHYSICAL_PARTITION_ALLOCATOR_H