nis-util  1.0.D108
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
space_automap Class Reference

#include <automap.h>

Inheritance diagram for space_automap:
space

Public Types

typedef boost::shared_ptr
< space_automap
pointer
typedef std::list< mount_pointkeys_t

Public Member Functions

virtual ~space_automap ()
void read_and_process (void)
void read_and_process (space_automap_functor &func, const space_hosts_slurp *hosts)
void insert (const space_automap_row::pointer &rp)
void insert_sub (const space_automap_row::pointer &rp)
void walk (space_automap_functor &func)
space_automap_row::pointer query (const rcstring &key) const
space_automap_row::pointer query_sub (const rcstring &key) const
keys_t get_keys (void) const
void print (void) const
void print (const rcstring &filename) const
int yak_lex (void)
bool empty (void) const

Static Public Member Functions

static pointer create (const rcstring &filename)
static void grammar_debug (void)

Private Types

typedef std::map< rcstring,
space_automap_row::pointer
content_t

Private Member Functions

 space_automap (const rcstring &filename)
void parse (space_automap_functor &saver, const space_hosts_slurp *hosts)
 space_automap ()
 space_automap (const space_automap &rhs)
space_automapoperator= (const space_automap &rhs)

Private Attributes

content_t content
content_t content_sub

Detailed Description

The space_automap class is used to represent the processing required to parse and pretty print automap files.

Definition at line 36 of file automap.h.


Member Typedef Documentation

Definition at line 160 of file automap.h.

typedef std::list<mount_point> space_automap::keys_t

Definition at line 111 of file automap.h.

typedef boost::shared_ptr<space_automap> space_automap::pointer

Definition at line 40 of file automap.h.


Constructor & Destructor Documentation

The destructor.

Definition at line 26 of file automap.cc.

space_automap::space_automap ( const rcstring filename) [private]

The constructor. It is private on purpose, use the create class method instead.

Definition at line 31 of file automap.cc.

The default constructor. Do not use.

space_automap::space_automap ( const space_automap rhs) [private]

The copy constructor. Do not use.

Parameters:
rhsThe right hand side of the initialization.

Member Function Documentation

space_automap::pointer space_automap::create ( const rcstring filename) [static]

The create class method is used to create new dynamically allocated instances of this class.

Definition at line 41 of file automap.cc.

bool space_automap::empty ( void  ) const

The empty method is used to determoien whether or not this map is empty.

Definition at line 184 of file automap.cc.

The get_keys method is used to obtain a list of the keys of all the rows of this map.

Definition at line 192 of file automap.cc.

static void space_automap::grammar_debug ( void  ) [static]

The grammar_debug class method is used to turn on grammar (yacc) debug messages. Usually only of interest to developers.

The insert method is used to append another row to the ordered list of rows in the file.

Definition at line 81 of file automap.cc.

The insert_sub method is used to append another row to the ordered list of (sub)rows in the file.

Definition at line 119 of file automap.cc.

space_automap& space_automap::operator= ( const space_automap rhs) [private]

The assignment operator. Do not use.

Parameters:
rhsThe right hand side of the assignment.
void space_automap::parse ( space_automap_functor saver,
const space_hosts_slurp hosts 
) [private]
void space_automap::print ( void  ) const

The print method is used to print a representation of this map on the standard output.

Definition at line 157 of file automap.cc.

void space_automap::print ( const rcstring filename) const

The print method is used to pretty print a representation of this automap file.

Parameters:
filenameThe name of the file to write to, or "-" for the standard output.

Definition at line 165 of file automap.cc.

The query method is used to examine this map, and return the row corresponding to the given key.

Parameters:
keythe key for this row
Returns:
a pointer to the rwo, or the NULL pointer if no such row

Definition at line 108 of file automap.cc.

The query_sub method is used to examine this map, with its sub-mount-points fully expanded, and return the row corresponding to the given key. Mostly used for error checking.

Parameters:
keythe key for this row
Returns:
a pointer to the rwo, or the NULL pointer if no such row

Definition at line 146 of file automap.cc.

The read method is used to read the given file and retain each of the rows.

Definition at line 48 of file automap.cc.

The read method is used to read the given file and retain each of the rows, passing each row to the fiven functor for checking or processing.

Definition at line 56 of file automap.cc.

The walk method is used to visit the given functor on every row in the map.

Parameters:
funcThe functor to be presented with each row in turn.

Definition at line 66 of file automap.cc.

int space_automap::yak_lex ( void  )

The yac_lex method is used to convert the results of space::lex into whet yacc (bison) expects. It would not be public except for the need for yacc (bison) to call it.


Field Documentation

The content instance variable is used to remember the row (contents) of this map.

Definition at line 168 of file automap.h.

The content-sub instance variable is used to remember the contents of this map, with sub-mount-points fully expanded. This is used for checking.

Definition at line 175 of file automap.h.


The documentation for this class was generated from the following files: