00001 /* 00002 * Copyright (c) [2004-2009] Novell, Inc. 00003 * 00004 * All Rights Reserved. 00005 * 00006 * This program is free software; you can redistribute it and/or modify it 00007 * under the terms of version 2 of the GNU General Public License as published 00008 * by the Free Software Foundation. 00009 * 00010 * This program is distributed in the hope that it will be useful, but WITHOUT 00011 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00013 * more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, contact Novell, Inc. 00017 * 00018 * To contact Novell about this file by physical or electronic mail, you may 00019 * find current contact information at www.novell.com. 00020 */ 00021 00022 00023 #ifndef DM_PART_H 00024 #define DM_PART_H 00025 00026 #include "storage/Dm.h" 00027 #include "storage/Partition.h" 00028 00029 namespace storage 00030 { 00031 00032 class DmPartCo; 00033 class ProcParts; 00034 00035 00036 class DmPart : public Dm 00037 { 00038 public: 00039 00040 DmPart(const DmPartCo& c, const string& name, const string& device, unsigned nr, 00041 Partition* p); 00042 DmPart(const DmPartCo& c, const DmPart& v); 00043 virtual ~DmPart(); 00044 00045 friend std::ostream& operator<< (std::ostream& s, const DmPart &p ); 00046 virtual void print( std::ostream& s ) const { s << *this; } 00047 void getInfo( storage::DmPartInfo& info ) const; 00048 bool equalContent( const DmPart& rhs ) const; 00049 00050 void logDifference(std::ostream& log, const DmPart& rhs) const; 00051 00052 void setPtr( Partition* pa ) { p=pa; }; 00053 Partition* getPtr() const { return p; }; 00054 unsigned id() const { return p?p->id():0; } 00055 void updateName(); 00056 void updateMinor(); 00057 void updateSize(const ProcParts& parts); 00058 void updateSize(); 00059 void getCommitActions(list<commitAction>& l) const; 00060 void addUdevData(); 00061 virtual list<string> getUsing() const; 00062 virtual list<string> udevId() const; 00063 virtual Text setTypeText(bool doing) const; 00064 static bool notDeleted( const DmPart& l ) { return( !l.deleted() ); } 00065 00066 protected: 00067 00068 virtual const string shortPrintedName() const { return( "DmPart" ); } 00069 const DmPartCo* co() const; 00070 void addAltUdevId( unsigned num ); 00071 Partition* p; 00072 00073 mutable storage::DmPartInfo info; // workaround for broken ycp bindings 00074 00075 private: 00076 00077 DmPart(const DmPart&); // disallow 00078 DmPart& operator=(const DmPart&); // disallow 00079 00080 }; 00081 00082 } 00083 00084 #endif
1.5.6