nis-util  1.0.D108
lib/space/auto_master/row.h
Go to the documentation of this file.
00001 //
00002 // nis-util - NIS Administration Utilities
00003 // Copyright (C) 2012 Peter Miller
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 2 of the License, or (at
00008 // your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License along
00016 // with this program. If not, see <http://www.gnu.org/licenses/>.
00017 //
00018 
00019 #ifndef LIB_SPACE_AUTO_MASTER_ROW_H
00020 #define LIB_SPACE_AUTO_MASTER_ROW_H
00021 
00022 #include <boost/shared_ptr.hpp>
00023 #include <list>
00024 
00025 #include <lib/mount_point.h>
00026 #include <lib/space/hosts/slurp.h>
00027 
00028 class output; // forward
00029 
00035 class space_auto_master_row
00036 {
00037 public:
00038     typedef boost::shared_ptr<space_auto_master_row> pointer;
00039     typedef boost::shared_ptr<output> output_pointer;
00040 
00044     virtual ~space_auto_master_row();
00045 
00050     virtual void print(const output_pointer &op) const = 0;
00051 
00056     const mount_point &get_mount_point(void) const { return key; }
00057 
00067     virtual void load_map(const rcstring &filename,
00068         const space_hosts_slurp::pointer &hosts) = 0;
00069 
00074     virtual bool has_associated_file(void) const;
00075 
00083     virtual rcstring get_filename(void) const;
00084 
00085     typedef std::list<mount_point> keys_t;
00086 
00092     virtual keys_t get_keys(void) const;
00093 
00098     static rcstring extract_maptype(const rcstring &text);
00099 
00104     static rcstring extract_mapname(const rcstring &text);
00105 
00106 protected:
00111     space_auto_master_row(const mount_point &mount_point,
00112         const rcstring &options);
00113 
00118     rcstring get_options(void) const { return options; }
00119 
00120 private:
00126     mount_point key;
00127 
00132     rcstring options;
00133 
00138     space_auto_master_row();
00139 
00147     space_auto_master_row(const space_auto_master_row &rhs);
00148 
00156     space_auto_master_row &operator=(const space_auto_master_row &rhs);
00157 };
00158 
00159 // vim: set ts=8 sw=4 et :
00160 #endif // LIB_SPACE_AUTO_MASTER_ROW_H