00001 #ifndef DMPART_H 00002 #define DMPART_H 00003 00004 #include "y2storage/Dm.h" 00005 #include "y2storage/Partition.h" 00006 00007 namespace storage 00008 { 00009 00010 class DmPartCo; 00011 class ProcPart; 00012 00013 class DmPart : public Dm 00014 { 00015 public: 00016 DmPart( const DmPartCo& d, unsigned nr, Partition* p=NULL ); 00017 DmPart( const DmPartCo& d, const DmPart& rd ); 00018 DmPart& operator=( const DmPart& ); 00019 00020 virtual ~DmPart(); 00021 friend std::ostream& operator<< (std::ostream& s, const DmPart &p ); 00022 virtual void print( std::ostream& s ) const { s << *this; } 00023 void getInfo( storage::DmPartInfo& info ) const; 00024 bool equalContent( const DmPart& rhs ) const; 00025 void logDifference( const DmPart& d ) const; 00026 void setPtr( Partition* pa ) { p=pa; }; 00027 Partition* getPtr() const { return p; }; 00028 unsigned id() const { return p?p->id():0; } 00029 void updateName(); 00030 void updateMinor(); 00031 void updateSize( ProcPart& pp ); 00032 void updateSize(); 00033 void getCommitActions( std::list<storage::commitAction*>& l ) const; 00034 void addUdevData(); 00035 virtual string setTypeText( bool doing=true ) const; 00036 static bool notDeleted( const DmPart& l ) { return( !l.deleted() ); } 00037 00038 protected: 00039 void init( const string& name ); 00040 void dataFromPart( const Partition* p ); 00041 virtual const string shortPrintedName() const { return( "DmPart" ); } 00042 const DmPartCo* co() const; 00043 void addAltUdevId( unsigned num ); 00044 Partition* p; 00045 00046 mutable storage::DmPartInfo info; 00047 }; 00048 00049 } 00050 00051 #endif
1.5.5