Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

Dm.h

Go to the documentation of this file.
00001 #ifndef DM_H
00002 #define DM_H
00003 
00004 #include <map>
00005 
00006 #include "y2storage/Volume.h"
00007 
00008 class PeContainer;
00009 
00010 class Dm : public Volume
00011     {
00012     public:
00013         Dm( const PeContainer& d, const string& tn );
00014         Dm( const PeContainer& d, const string& tn, unsigned mnum );
00015         Dm( const PeContainer& d, const Dm& d );
00016         Dm& operator=( const Dm& );
00017 
00018         virtual ~Dm();
00019         const string& getTableName() const { return( tname ); }
00020         const string& getTargetName() const { return( target ); }
00021         void setTableName( const string& name ) { tname=name; }
00022         unsigned long getLe() const { return num_le; }
00023         void setLe( unsigned long le );
00024         void calcSize();
00025         const std::map<string,unsigned long>& getPeMap() const { return( pe_map ); }
00026         void setPeMap( const std::map<string,unsigned long>& m ) { pe_map = m; }
00027         unsigned long usingPe( const string& dev ) const;
00028         void getTableInfo();
00029         virtual bool checkConsistency() const;
00030         unsigned stripes() const { return stripe; }
00031         unsigned long long stripeSize() const { return stripe_size; }
00032         void setStripeSize( unsigned long long val ) { stripe_size=val; }
00033         friend std::ostream& operator<< (std::ostream& s, const Dm &p );
00034         virtual void print( std::ostream& s ) const { s << *this; }
00035         virtual string removeText( bool doing ) const;
00036         virtual string formatText( bool doing ) const;
00037         void getInfo( storage::DmInfo& info ) const;
00038 
00039         static bool notDeleted( const Dm& l ) { return( !l.deleted() ); }
00040 
00041         static void activate( bool val=true );
00042         bool equalContent( const Dm& rhs ) const;
00043         void logDifference( const Dm& d ) const;
00044         string stringDifference( const Dm& d ) const;
00045 
00046     protected:
00047         void init();
00048         const PeContainer* const pec() const;
00049         virtual const string shortPrintedName() const { return( "Dm" ); }
00050         string getDevice( const string& majmin );
00051         static void getDmMajor();
00052 
00053         string tname;
00054         string target;
00055         unsigned long num_le;
00056         unsigned stripe;
00057         unsigned long long stripe_size;
00058         std::map<string,unsigned long> pe_map;
00059         static bool active;
00060         static unsigned dm_major;
00061         mutable storage::DmInfo info;
00062     };
00063 
00064 #endif

Generated on Wed Sep 14 11:27:07 2005 for yast2-storage by  doxygen 1.4.4