00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef __FREESPACE_H__
00027 #define __FREESPACE_H__
00028
00029 #include "FreeBlock.h"
00030 #include "Vessel.h"
00031
00032 #include <LEDA/list.h>
00033
00034 class FreeSpace
00035 {
00036 public:
00037 FreeSpace();
00038 FreeSpace(int aSize);
00039 FreeSpace(list<FreeBlock>& aListOfFreeBlocks);
00040 FreeSpace(const FreeSpace& aFreeSpace);
00041 ~FreeSpace();
00042
00043
00044 void Print(int aWidth = 1, int aDetail = 0) const;
00045
00046
00047 void Initialize(int aSize);
00048
00049
00050 void Remove(FreeBlock& aFreeBlock);
00051 void Substitute(FreeBlock& OldFB, FreeBlock& NewFB);
00052
00053
00054 void Insert(FreeBlock& aPosition, FreeBlock& aFreeBlock,
00055 int aDirection = 0);
00056
00057
00058 void AssignVessel(FreeBlock& aFreeBlock, Vessel& aVessel);
00059
00060
00061 void Liberation(Vessel& aVessel);
00062
00063
00064 list<FreeBlock> GetFreeBlockList() const;
00065 FreeBlock First() const;
00066 FreeBlock Last() const;
00067 int GetLength() const;
00068
00069 private:
00070 list<FreeBlock> mFreeBlockList;
00071 };
00072
00073 #endif