Decided that BPartition::ImmutableDelegate would basically be a big
collection of no-op methods, which could as well be implemented in BPartition itself. This makes the Delegate hierarchy unnecessary: MutableDelegate becomes Delegate, and we save a few casts as a side effect. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22547 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
7a5b0bb588
commit
08baf63a9f
@ -72,7 +72,7 @@ public:
|
||||
|
||||
private:
|
||||
BMutablePartition(
|
||||
BPartition::MutableDelegate* delegate);
|
||||
BPartition::Delegate* delegate);
|
||||
~BMutablePartition();
|
||||
|
||||
status_t Init(const user_partition_data* partitionData,
|
||||
@ -81,11 +81,11 @@ private:
|
||||
const user_partition_data* PartitionData() const;
|
||||
|
||||
private:
|
||||
friend class BPartition::MutableDelegate;
|
||||
friend class BPartition::Delegate;
|
||||
|
||||
BPartition::MutableDelegate* GetDelegate() const;
|
||||
BPartition::Delegate* GetDelegate() const;
|
||||
|
||||
BPartition::MutableDelegate* fDelegate;
|
||||
BPartition::Delegate* fDelegate;
|
||||
user_partition_data* fData;
|
||||
BMutablePartition* fParent;
|
||||
BList fChildren;
|
||||
|
@ -142,8 +142,6 @@ public:
|
||||
|
||||
private:
|
||||
class Delegate;
|
||||
class ImmutableDelegate;
|
||||
class MutableDelegate;
|
||||
|
||||
BPartition();
|
||||
BPartition(const BPartition &);
|
||||
|
@ -260,9 +260,9 @@ BMutablePartition::CreateChild(int32 index, BMutablePartition** _child)
|
||||
if (!partition)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
// create the MutableDelegate
|
||||
BPartition::MutableDelegate* delegate
|
||||
= new(nothrow) BPartition::MutableDelegate(partition);
|
||||
// create the delegate
|
||||
BPartition::Delegate* delegate
|
||||
= new(nothrow) BPartition::Delegate(partition);
|
||||
if (!delegate) {
|
||||
delete partition;
|
||||
return B_NO_MEMORY;
|
||||
@ -386,7 +386,7 @@ BMutablePartition::SetChildCookie(void* cookie)
|
||||
|
||||
|
||||
// constructor
|
||||
BMutablePartition::BMutablePartition(BPartition::MutableDelegate* delegate)
|
||||
BMutablePartition::BMutablePartition(BPartition::Delegate* delegate)
|
||||
: fDelegate(delegate),
|
||||
fData(NULL),
|
||||
fParent(NULL),
|
||||
@ -467,7 +467,7 @@ BMutablePartition::PartitionData() const
|
||||
|
||||
|
||||
// GetDelegate
|
||||
BPartition::MutableDelegate*
|
||||
BPartition::Delegate*
|
||||
BMutablePartition::GetDelegate() const
|
||||
{
|
||||
return fDelegate;
|
||||
|
@ -10,12 +10,12 @@
|
||||
#include "DiskSystemAddOnManager.h"
|
||||
|
||||
|
||||
// #pragma mark - Delegate
|
||||
|
||||
|
||||
// constructor
|
||||
BPartition::Delegate::Delegate(BPartition* partition)
|
||||
: fPartition(partition)
|
||||
: fPartition(partition),
|
||||
fMutablePartition(this),
|
||||
fDiskSystem(NULL),
|
||||
fPartitionHandle(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@ -26,28 +26,9 @@ BPartition::Delegate::~Delegate()
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - MutableDelegate
|
||||
|
||||
|
||||
// constructor
|
||||
BPartition::MutableDelegate::MutableDelegate(BPartition* partition)
|
||||
: Delegate(partition),
|
||||
fMutablePartition(this),
|
||||
fDiskSystem(NULL),
|
||||
fPartitionHandle(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// destructor
|
||||
BPartition::MutableDelegate::~MutableDelegate()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// MutablePartition
|
||||
BMutablePartition*
|
||||
BPartition::MutableDelegate::MutablePartition()
|
||||
BPartition::Delegate::MutablePartition()
|
||||
{
|
||||
return &fMutablePartition;
|
||||
}
|
||||
@ -55,7 +36,7 @@ BPartition::MutableDelegate::MutablePartition()
|
||||
|
||||
// MutablePartition
|
||||
const BMutablePartition*
|
||||
BPartition::MutableDelegate::MutablePartition() const
|
||||
BPartition::Delegate::MutablePartition() const
|
||||
{
|
||||
return &fMutablePartition;
|
||||
}
|
||||
@ -63,10 +44,9 @@ BPartition::MutableDelegate::MutablePartition() const
|
||||
|
||||
// InitHierarchy
|
||||
status_t
|
||||
BPartition::MutableDelegate::InitHierarchy(
|
||||
const user_partition_data* partitionData, Delegate* _parent)
|
||||
BPartition::Delegate::InitHierarchy(
|
||||
const user_partition_data* partitionData, Delegate* parent)
|
||||
{
|
||||
MutableDelegate* parent = dynamic_cast<MutableDelegate*>(_parent);
|
||||
return fMutablePartition.Init(partitionData,
|
||||
parent ? &parent->fMutablePartition : NULL);
|
||||
}
|
||||
@ -74,7 +54,7 @@ BPartition::MutableDelegate::InitHierarchy(
|
||||
|
||||
// InitAfterHierarchy
|
||||
status_t
|
||||
BPartition::MutableDelegate::InitAfterHierarchy()
|
||||
BPartition::Delegate::InitAfterHierarchy()
|
||||
{
|
||||
if (!fMutablePartition.ContentType())
|
||||
return B_OK;
|
||||
@ -104,7 +84,7 @@ BPartition::MutableDelegate::InitAfterHierarchy()
|
||||
|
||||
// PartitionData
|
||||
const user_partition_data*
|
||||
BPartition::MutableDelegate::PartitionData() const
|
||||
BPartition::Delegate::PartitionData() const
|
||||
{
|
||||
return fMutablePartition.PartitionData();
|
||||
}
|
||||
@ -112,7 +92,7 @@ BPartition::MutableDelegate::PartitionData() const
|
||||
|
||||
// ChildAt
|
||||
BPartition::Delegate*
|
||||
BPartition::MutableDelegate::ChildAt(int32 index) const
|
||||
BPartition::Delegate::ChildAt(int32 index) const
|
||||
{
|
||||
BMutablePartition* child = fMutablePartition.ChildAt(index);
|
||||
return child ? child->GetDelegate() : NULL;
|
||||
@ -121,7 +101,7 @@ BPartition::MutableDelegate::ChildAt(int32 index) const
|
||||
|
||||
// CountChildren
|
||||
int32
|
||||
BPartition::MutableDelegate::CountChildren() const
|
||||
BPartition::Delegate::CountChildren() const
|
||||
{
|
||||
return fMutablePartition.CountChildren();
|
||||
}
|
||||
@ -129,7 +109,7 @@ BPartition::MutableDelegate::CountChildren() const
|
||||
|
||||
// SupportedOperations
|
||||
uint32
|
||||
BPartition::MutableDelegate::SupportedOperations(uint32 mask)
|
||||
BPartition::Delegate::SupportedOperations(uint32 mask)
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
return 0;
|
||||
@ -140,20 +120,20 @@ BPartition::MutableDelegate::SupportedOperations(uint32 mask)
|
||||
|
||||
// SupportedChildOperations
|
||||
uint32
|
||||
BPartition::MutableDelegate::SupportedChildOperations(Delegate* child,
|
||||
BPartition::Delegate::SupportedChildOperations(Delegate* child,
|
||||
uint32 mask)
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
return 0;
|
||||
|
||||
return fPartitionHandle->SupportedChildOperations(
|
||||
((MutableDelegate*)child)->MutablePartition(), mask);
|
||||
return fPartitionHandle->SupportedChildOperations(child->MutablePartition(),
|
||||
mask);
|
||||
}
|
||||
|
||||
|
||||
// Defragment
|
||||
status_t
|
||||
BPartition::MutableDelegate::Defragment()
|
||||
BPartition::Delegate::Defragment()
|
||||
{
|
||||
// TODO: Implement!
|
||||
return B_BAD_VALUE;
|
||||
@ -162,7 +142,7 @@ BPartition::MutableDelegate::Defragment()
|
||||
|
||||
// Repair
|
||||
status_t
|
||||
BPartition::MutableDelegate::Repair(bool checkOnly)
|
||||
BPartition::Delegate::Repair(bool checkOnly)
|
||||
{
|
||||
// TODO: Implement!
|
||||
return B_BAD_VALUE;
|
||||
@ -171,7 +151,7 @@ BPartition::MutableDelegate::Repair(bool checkOnly)
|
||||
|
||||
// ValidateResize
|
||||
status_t
|
||||
BPartition::MutableDelegate::ValidateResize(off_t* size) const
|
||||
BPartition::Delegate::ValidateResize(off_t* size) const
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
return B_NO_INIT;
|
||||
@ -182,11 +162,8 @@ BPartition::MutableDelegate::ValidateResize(off_t* size) const
|
||||
|
||||
// ValidateResizeChild
|
||||
status_t
|
||||
BPartition::MutableDelegate::ValidateResizeChild(Delegate* _child,
|
||||
off_t* size) const
|
||||
BPartition::Delegate::ValidateResizeChild(Delegate* child, off_t* size) const
|
||||
{
|
||||
MutableDelegate* child = dynamic_cast<MutableDelegate*>(_child);
|
||||
|
||||
if (!fPartitionHandle || !child)
|
||||
return B_NO_INIT;
|
||||
|
||||
@ -197,7 +174,7 @@ BPartition::MutableDelegate::ValidateResizeChild(Delegate* _child,
|
||||
|
||||
// Resize
|
||||
status_t
|
||||
BPartition::MutableDelegate::Resize(off_t size)
|
||||
BPartition::Delegate::Resize(off_t size)
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
return B_NO_INIT;
|
||||
@ -208,10 +185,8 @@ BPartition::MutableDelegate::Resize(off_t size)
|
||||
|
||||
// ResizeChild
|
||||
status_t
|
||||
BPartition::MutableDelegate::ResizeChild(Delegate* _child, off_t size)
|
||||
BPartition::Delegate::ResizeChild(Delegate* child, off_t size)
|
||||
{
|
||||
MutableDelegate* child = dynamic_cast<MutableDelegate*>(_child);
|
||||
|
||||
if (!fPartitionHandle || !child)
|
||||
return B_NO_INIT;
|
||||
|
||||
@ -221,7 +196,7 @@ BPartition::MutableDelegate::ResizeChild(Delegate* _child, off_t size)
|
||||
|
||||
// ValidateMove
|
||||
status_t
|
||||
BPartition::MutableDelegate::ValidateMove(off_t* offset) const
|
||||
BPartition::Delegate::ValidateMove(off_t* offset) const
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
return B_NO_INIT;
|
||||
@ -232,11 +207,8 @@ BPartition::MutableDelegate::ValidateMove(off_t* offset) const
|
||||
|
||||
// ValidateMoveChild
|
||||
status_t
|
||||
BPartition::MutableDelegate::ValidateMoveChild(Delegate* _child,
|
||||
off_t* offset) const
|
||||
BPartition::Delegate::ValidateMoveChild(Delegate* child, off_t* offset) const
|
||||
{
|
||||
MutableDelegate* child = dynamic_cast<MutableDelegate*>(_child);
|
||||
|
||||
if (!fPartitionHandle || !child)
|
||||
return B_NO_INIT;
|
||||
|
||||
@ -247,7 +219,7 @@ BPartition::MutableDelegate::ValidateMoveChild(Delegate* _child,
|
||||
|
||||
// Move
|
||||
status_t
|
||||
BPartition::MutableDelegate::Move(off_t offset)
|
||||
BPartition::Delegate::Move(off_t offset)
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
return B_NO_INIT;
|
||||
@ -258,10 +230,8 @@ BPartition::MutableDelegate::Move(off_t offset)
|
||||
|
||||
// MoveChild
|
||||
status_t
|
||||
BPartition::MutableDelegate::MoveChild(Delegate* _child, off_t offset)
|
||||
BPartition::Delegate::MoveChild(Delegate* child, off_t offset)
|
||||
{
|
||||
MutableDelegate* child = dynamic_cast<MutableDelegate*>(_child);
|
||||
|
||||
if (!fPartitionHandle || !child)
|
||||
return B_NO_INIT;
|
||||
|
||||
@ -271,7 +241,7 @@ BPartition::MutableDelegate::MoveChild(Delegate* _child, off_t offset)
|
||||
|
||||
// ValidateSetContentName
|
||||
status_t
|
||||
BPartition::MutableDelegate::ValidateSetContentName(BString* name) const
|
||||
BPartition::Delegate::ValidateSetContentName(BString* name) const
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
return B_NO_INIT;
|
||||
@ -282,11 +252,8 @@ BPartition::MutableDelegate::ValidateSetContentName(BString* name) const
|
||||
|
||||
// ValidateSetName
|
||||
status_t
|
||||
BPartition::MutableDelegate::ValidateSetName(Delegate* _child,
|
||||
BString* name) const
|
||||
BPartition::Delegate::ValidateSetName(Delegate* child, BString* name) const
|
||||
{
|
||||
MutableDelegate* child = dynamic_cast<MutableDelegate*>(_child);
|
||||
|
||||
if (!fPartitionHandle || !child)
|
||||
return B_NO_INIT;
|
||||
|
||||
@ -296,7 +263,7 @@ BPartition::MutableDelegate::ValidateSetName(Delegate* _child,
|
||||
|
||||
// SetContentName
|
||||
status_t
|
||||
BPartition::MutableDelegate::SetContentName(const char* name)
|
||||
BPartition::Delegate::SetContentName(const char* name)
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
return B_NO_INIT;
|
||||
@ -307,10 +274,8 @@ BPartition::MutableDelegate::SetContentName(const char* name)
|
||||
|
||||
// SetName
|
||||
status_t
|
||||
BPartition::MutableDelegate::SetName(Delegate* _child, const char* name)
|
||||
BPartition::Delegate::SetName(Delegate* child, const char* name)
|
||||
{
|
||||
MutableDelegate* child = dynamic_cast<MutableDelegate*>(_child);
|
||||
|
||||
if (!fPartitionHandle || !child)
|
||||
return B_NO_INIT;
|
||||
|
||||
@ -320,11 +285,8 @@ BPartition::MutableDelegate::SetName(Delegate* _child, const char* name)
|
||||
|
||||
// ValidateSetType
|
||||
status_t
|
||||
BPartition::MutableDelegate::ValidateSetType(Delegate* _child,
|
||||
const char* type) const
|
||||
BPartition::Delegate::ValidateSetType(Delegate* child, const char* type) const
|
||||
{
|
||||
MutableDelegate* child = dynamic_cast<MutableDelegate*>(_child);
|
||||
|
||||
if (!fPartitionHandle || !child)
|
||||
return B_NO_INIT;
|
||||
|
||||
@ -334,10 +296,8 @@ BPartition::MutableDelegate::ValidateSetType(Delegate* _child,
|
||||
|
||||
// SetType
|
||||
status_t
|
||||
BPartition::MutableDelegate::SetType(Delegate* _child, const char* type)
|
||||
BPartition::Delegate::SetType(Delegate* child, const char* type)
|
||||
{
|
||||
MutableDelegate* child = dynamic_cast<MutableDelegate*>(_child);
|
||||
|
||||
if (!fPartitionHandle || !child)
|
||||
return B_NO_INIT;
|
||||
|
||||
@ -347,7 +307,7 @@ BPartition::MutableDelegate::SetType(Delegate* _child, const char* type)
|
||||
|
||||
// GetContentParameterEditor
|
||||
status_t
|
||||
BPartition::MutableDelegate::GetContentParameterEditor(
|
||||
BPartition::Delegate::GetContentParameterEditor(
|
||||
BDiskDeviceParameterEditor** editor) const
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
@ -359,11 +319,9 @@ BPartition::MutableDelegate::GetContentParameterEditor(
|
||||
|
||||
// GetParameterEditor
|
||||
status_t
|
||||
BPartition::MutableDelegate::GetParameterEditor(Delegate* _child,
|
||||
BPartition::Delegate::GetParameterEditor(Delegate* child,
|
||||
BDiskDeviceParameterEditor** editor) const
|
||||
{
|
||||
MutableDelegate* child = dynamic_cast<MutableDelegate*>(_child);
|
||||
|
||||
if (!fPartitionHandle || !child)
|
||||
return B_NO_INIT;
|
||||
|
||||
@ -374,7 +332,7 @@ BPartition::MutableDelegate::GetParameterEditor(Delegate* _child,
|
||||
|
||||
// SetContentParameters
|
||||
status_t
|
||||
BPartition::MutableDelegate::SetContentParameters(const char* parameters)
|
||||
BPartition::Delegate::SetContentParameters(const char* parameters)
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
return B_NO_INIT;
|
||||
@ -385,11 +343,8 @@ BPartition::MutableDelegate::SetContentParameters(const char* parameters)
|
||||
|
||||
// SetParameters
|
||||
status_t
|
||||
BPartition::MutableDelegate::SetParameters(Delegate* _child,
|
||||
const char* parameters)
|
||||
BPartition::Delegate::SetParameters(Delegate* child, const char* parameters)
|
||||
{
|
||||
MutableDelegate* child = dynamic_cast<MutableDelegate*>(_child);
|
||||
|
||||
if (!fPartitionHandle || !child)
|
||||
return B_NO_INIT;
|
||||
|
||||
@ -400,7 +355,7 @@ BPartition::MutableDelegate::SetParameters(Delegate* _child,
|
||||
|
||||
// CanInitialize
|
||||
bool
|
||||
BPartition::MutableDelegate::CanInitialize(const char* diskSystem) const
|
||||
BPartition::Delegate::CanInitialize(const char* diskSystem) const
|
||||
{
|
||||
// get the disk system add-on
|
||||
DiskSystemAddOnManager* manager = DiskSystemAddOnManager::Default();
|
||||
@ -419,7 +374,7 @@ BPartition::MutableDelegate::CanInitialize(const char* diskSystem) const
|
||||
|
||||
// GetInitializationParameterEditor
|
||||
status_t
|
||||
BPartition::MutableDelegate::GetInitializationParameterEditor(
|
||||
BPartition::Delegate::GetInitializationParameterEditor(
|
||||
const char* diskSystem, BDiskDeviceParameterEditor** editor) const
|
||||
{
|
||||
// get the disk system add-on
|
||||
@ -440,7 +395,7 @@ BPartition::MutableDelegate::GetInitializationParameterEditor(
|
||||
|
||||
// ValidateInitialize
|
||||
status_t
|
||||
BPartition::MutableDelegate::ValidateInitialize(const char* diskSystem,
|
||||
BPartition::Delegate::ValidateInitialize(const char* diskSystem,
|
||||
BString* name, const char* parameters)
|
||||
{
|
||||
// get the disk system add-on
|
||||
@ -461,7 +416,7 @@ BPartition::MutableDelegate::ValidateInitialize(const char* diskSystem,
|
||||
|
||||
// Initialize
|
||||
status_t
|
||||
BPartition::MutableDelegate::Initialize(const char* diskSystem,
|
||||
BPartition::Delegate::Initialize(const char* diskSystem,
|
||||
const char* name, const char* parameters)
|
||||
{
|
||||
// get the disk system add-on
|
||||
@ -491,7 +446,7 @@ BPartition::MutableDelegate::Initialize(const char* diskSystem,
|
||||
|
||||
// Uninitialize
|
||||
status_t
|
||||
BPartition::MutableDelegate::Uninitialize()
|
||||
BPartition::Delegate::Uninitialize()
|
||||
{
|
||||
if (fPartitionHandle) {
|
||||
_FreeHandle();
|
||||
@ -505,7 +460,7 @@ BPartition::MutableDelegate::Uninitialize()
|
||||
|
||||
// GetChildCreationParameterEditor
|
||||
status_t
|
||||
BPartition::MutableDelegate::GetChildCreationParameterEditor(const char* type,
|
||||
BPartition::Delegate::GetChildCreationParameterEditor(const char* type,
|
||||
BDiskDeviceParameterEditor** editor) const
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
@ -517,7 +472,7 @@ BPartition::MutableDelegate::GetChildCreationParameterEditor(const char* type,
|
||||
|
||||
// ValidateCreateChild
|
||||
status_t
|
||||
BPartition::MutableDelegate::ValidateCreateChild(off_t* start, off_t* size,
|
||||
BPartition::Delegate::ValidateCreateChild(off_t* start, off_t* size,
|
||||
const char* type, BString* name, const char* parameters) const
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
@ -530,9 +485,8 @@ BPartition::MutableDelegate::ValidateCreateChild(off_t* start, off_t* size,
|
||||
|
||||
// CreateChild
|
||||
status_t
|
||||
BPartition::MutableDelegate::CreateChild(off_t start, off_t size,
|
||||
const char* type, const char* name, const char* parameters,
|
||||
BPartition** child)
|
||||
BPartition::Delegate::CreateChild(off_t start, off_t size, const char* type,
|
||||
const char* name, const char* parameters, BPartition** child)
|
||||
{
|
||||
if (!fPartitionHandle)
|
||||
return B_NO_INIT;
|
||||
@ -552,10 +506,8 @@ BPartition::MutableDelegate::CreateChild(off_t start, off_t size,
|
||||
|
||||
// DeleteChild
|
||||
status_t
|
||||
BPartition::MutableDelegate::DeleteChild(Delegate* _child)
|
||||
BPartition::Delegate::DeleteChild(Delegate* child)
|
||||
{
|
||||
MutableDelegate* child = dynamic_cast<MutableDelegate*>(_child);
|
||||
|
||||
if (!fPartitionHandle || !child)
|
||||
return B_NO_INIT;
|
||||
|
||||
@ -565,7 +517,7 @@ BPartition::MutableDelegate::DeleteChild(Delegate* _child)
|
||||
|
||||
// _FreeHandle
|
||||
void
|
||||
BPartition::MutableDelegate::_FreeHandle()
|
||||
BPartition::Delegate::_FreeHandle()
|
||||
{
|
||||
if (fPartitionHandle) {
|
||||
delete fPartitionHandle;
|
||||
|
@ -16,184 +16,92 @@ class BPartitionHandle;
|
||||
class BPartition::Delegate {
|
||||
public:
|
||||
Delegate(BPartition* partition);
|
||||
virtual ~Delegate();
|
||||
|
||||
virtual status_t InitHierarchy(
|
||||
const user_partition_data* partitionData,
|
||||
Delegate* parent) = 0;
|
||||
virtual status_t InitAfterHierarchy() = 0;
|
||||
~Delegate();
|
||||
|
||||
BPartition* Partition() const { return fPartition; }
|
||||
|
||||
virtual const user_partition_data* PartitionData() const = 0;
|
||||
|
||||
virtual Delegate* ChildAt(int32 index) const = 0;
|
||||
virtual int32 CountChildren() const = 0;
|
||||
|
||||
virtual uint32 SupportedOperations(uint32 mask) = 0;
|
||||
virtual uint32 SupportedChildOperations(Delegate* child,
|
||||
uint32 mask) = 0;
|
||||
|
||||
// Self Modification
|
||||
|
||||
virtual status_t Defragment() = 0;
|
||||
virtual status_t Repair(bool checkOnly) = 0;
|
||||
|
||||
virtual status_t ValidateResize(off_t* size) const = 0;
|
||||
virtual status_t ValidateResizeChild(Delegate* child,
|
||||
off_t* size) const = 0;
|
||||
virtual status_t Resize(off_t size) = 0;
|
||||
virtual status_t ResizeChild(Delegate* child, off_t size) = 0;
|
||||
|
||||
virtual status_t ValidateMove(off_t* offset) const = 0;
|
||||
virtual status_t ValidateMoveChild(Delegate* child,
|
||||
off_t* offset) const = 0;
|
||||
virtual status_t Move(off_t offset) = 0;
|
||||
virtual status_t MoveChild(Delegate* child, off_t offset) = 0;
|
||||
|
||||
virtual status_t ValidateSetContentName(BString* name) const = 0;
|
||||
virtual status_t ValidateSetName(Delegate* child,
|
||||
BString* name) const = 0;
|
||||
virtual status_t SetContentName(const char* name) = 0;
|
||||
virtual status_t SetName(Delegate* child, const char* name) = 0;
|
||||
|
||||
virtual status_t ValidateSetType(Delegate* child,
|
||||
const char* type) const = 0;
|
||||
virtual status_t SetType(Delegate* child, const char* type) = 0;
|
||||
|
||||
virtual status_t GetContentParameterEditor(
|
||||
BDiskDeviceParameterEditor** editor)
|
||||
const = 0;
|
||||
virtual status_t GetParameterEditor(Delegate* child,
|
||||
BDiskDeviceParameterEditor** editor)
|
||||
const = 0;
|
||||
virtual status_t SetContentParameters(
|
||||
const char* parameters) = 0;
|
||||
virtual status_t SetParameters(Delegate* child,
|
||||
const char* parameters) = 0;
|
||||
|
||||
virtual bool CanInitialize(const char* diskSystem) const = 0;
|
||||
virtual status_t GetInitializationParameterEditor(
|
||||
const char* system,
|
||||
BDiskDeviceParameterEditor** editor)
|
||||
const = 0;
|
||||
virtual status_t ValidateInitialize(const char* diskSystem,
|
||||
BString* name, const char* parameters) = 0;
|
||||
virtual status_t Initialize(const char* diskSystem,
|
||||
const char* name,
|
||||
const char* parameters) = 0;
|
||||
virtual status_t Uninitialize() = 0;
|
||||
|
||||
// Modification of child partitions
|
||||
|
||||
virtual status_t GetChildCreationParameterEditor(
|
||||
const char* system,
|
||||
BDiskDeviceParameterEditor** editor)
|
||||
const = 0;
|
||||
virtual status_t ValidateCreateChild(off_t* start, off_t* size,
|
||||
const char* type, BString* name,
|
||||
const char* parameters) const = 0;
|
||||
virtual status_t CreateChild(off_t start, off_t size,
|
||||
const char* type, const char* name,
|
||||
const char* parameters,
|
||||
BPartition** child) = 0;
|
||||
|
||||
virtual status_t DeleteChild(Delegate* child) = 0;
|
||||
|
||||
|
||||
protected:
|
||||
BPartition* fPartition;
|
||||
};
|
||||
|
||||
|
||||
class BPartition::MutableDelegate : public BPartition::Delegate {
|
||||
public:
|
||||
MutableDelegate(BPartition* partition);
|
||||
virtual ~MutableDelegate();
|
||||
|
||||
BMutablePartition* MutablePartition();
|
||||
const BMutablePartition* MutablePartition() const;
|
||||
|
||||
virtual status_t InitHierarchy(
|
||||
status_t InitHierarchy(
|
||||
const user_partition_data* partitionData,
|
||||
Delegate* parent);
|
||||
virtual status_t InitAfterHierarchy();
|
||||
status_t InitAfterHierarchy();
|
||||
|
||||
virtual const user_partition_data* PartitionData() const;
|
||||
const user_partition_data* PartitionData() const;
|
||||
|
||||
virtual Delegate* ChildAt(int32 index) const;
|
||||
virtual int32 CountChildren() const;
|
||||
Delegate* ChildAt(int32 index) const;
|
||||
int32 CountChildren() const;
|
||||
|
||||
virtual uint32 SupportedOperations(uint32 mask);
|
||||
virtual uint32 SupportedChildOperations(Delegate* child,
|
||||
uint32 SupportedOperations(uint32 mask);
|
||||
uint32 SupportedChildOperations(Delegate* child,
|
||||
uint32 mask);
|
||||
|
||||
// Self Modification
|
||||
|
||||
virtual status_t Defragment();
|
||||
virtual status_t Repair(bool checkOnly);
|
||||
status_t Defragment();
|
||||
status_t Repair(bool checkOnly);
|
||||
|
||||
virtual status_t ValidateResize(off_t* size) const;
|
||||
virtual status_t ValidateResizeChild(Delegate* child,
|
||||
status_t ValidateResize(off_t* size) const;
|
||||
status_t ValidateResizeChild(Delegate* child,
|
||||
off_t* size) const;
|
||||
virtual status_t Resize(off_t size);
|
||||
virtual status_t ResizeChild(Delegate* child, off_t size);
|
||||
status_t Resize(off_t size);
|
||||
status_t ResizeChild(Delegate* child, off_t size);
|
||||
|
||||
virtual status_t ValidateMove(off_t* offset) const;
|
||||
virtual status_t ValidateMoveChild(Delegate* child,
|
||||
status_t ValidateMove(off_t* offset) const;
|
||||
status_t ValidateMoveChild(Delegate* child,
|
||||
off_t* offset) const;
|
||||
virtual status_t Move(off_t offset);
|
||||
virtual status_t MoveChild(Delegate* child, off_t offset);
|
||||
status_t Move(off_t offset);
|
||||
status_t MoveChild(Delegate* child, off_t offset);
|
||||
|
||||
virtual status_t ValidateSetContentName(BString* name) const;
|
||||
virtual status_t ValidateSetName(Delegate* child,
|
||||
status_t ValidateSetContentName(BString* name) const;
|
||||
status_t ValidateSetName(Delegate* child,
|
||||
BString* name) const;
|
||||
virtual status_t SetContentName(const char* name);
|
||||
virtual status_t SetName(Delegate* child, const char* name);
|
||||
status_t SetContentName(const char* name);
|
||||
status_t SetName(Delegate* child, const char* name);
|
||||
|
||||
virtual status_t ValidateSetType(Delegate* child,
|
||||
status_t ValidateSetType(Delegate* child,
|
||||
const char* type) const;
|
||||
virtual status_t SetType(Delegate* child, const char* type);
|
||||
status_t SetType(Delegate* child, const char* type);
|
||||
|
||||
virtual status_t GetContentParameterEditor(
|
||||
status_t GetContentParameterEditor(
|
||||
BDiskDeviceParameterEditor** editor) const;
|
||||
virtual status_t GetParameterEditor(Delegate* child,
|
||||
status_t GetParameterEditor(Delegate* child,
|
||||
BDiskDeviceParameterEditor** editor) const;
|
||||
virtual status_t SetContentParameters(const char* parameters);
|
||||
virtual status_t SetParameters(Delegate* child,
|
||||
status_t SetContentParameters(const char* parameters);
|
||||
status_t SetParameters(Delegate* child,
|
||||
const char* parameters);
|
||||
|
||||
virtual bool CanInitialize(const char* diskSystem) const;
|
||||
virtual status_t GetInitializationParameterEditor(
|
||||
bool CanInitialize(const char* diskSystem) const;
|
||||
status_t GetInitializationParameterEditor(
|
||||
const char* system,
|
||||
BDiskDeviceParameterEditor** editor) const;
|
||||
virtual status_t ValidateInitialize(const char* diskSystem,
|
||||
status_t ValidateInitialize(const char* diskSystem,
|
||||
BString* name, const char* parameters);
|
||||
virtual status_t Initialize(const char* diskSystem,
|
||||
status_t Initialize(const char* diskSystem,
|
||||
const char* name,
|
||||
const char* parameters);
|
||||
virtual status_t Uninitialize();
|
||||
status_t Uninitialize();
|
||||
|
||||
// Modification of child partitions
|
||||
|
||||
virtual status_t GetChildCreationParameterEditor(
|
||||
status_t GetChildCreationParameterEditor(
|
||||
const char* system,
|
||||
BDiskDeviceParameterEditor** editor) const;
|
||||
virtual status_t ValidateCreateChild(off_t* start, off_t* size,
|
||||
status_t ValidateCreateChild(off_t* start, off_t* size,
|
||||
const char* type, BString* name,
|
||||
const char* parameters) const;
|
||||
virtual status_t CreateChild(off_t start, off_t size,
|
||||
status_t CreateChild(off_t start, off_t size,
|
||||
const char* type, const char* name,
|
||||
const char* parameters, BPartition** child);
|
||||
|
||||
virtual status_t DeleteChild(Delegate* child);
|
||||
status_t DeleteChild(Delegate* child);
|
||||
|
||||
private:
|
||||
void _FreeHandle();
|
||||
|
||||
private:
|
||||
// friend class BMutablePartition;
|
||||
|
||||
BPartition* fPartition;
|
||||
BMutablePartition fMutablePartition;
|
||||
BDiskSystemAddOn* fDiskSystem;
|
||||
BPartitionHandle* fPartitionHandle;
|
||||
|
Loading…
Reference in New Issue
Block a user