change_identifier Class Reference

#include <identifier.h>


Public Member Functions

 ~change_identifier ()
 change_identifier ()
bool set () const
bool project_set () const
void command_line_parse (void(*usage)(void))
void command_line_parse_rest (void(*usage)(void))
bool get_devdir ()
void command_line_check (void(*usage)(void))
void set_baseline ()
bool get_baseline ()
file_revision get_file_revision (const nstring &filename, change_functor &bad_state)
file_revision get_file_revision (fstate_src_ty *src, change_functor &bad_state)
void get_project_file_names (nstring_list &results)
fstate_src_tyget_project_file (const nstring &file_name)
project_file_roll_forwardget_historian ()
nstring get_change_version_string ()
project_tyget_pp ()
user_ty::pointer get_up ()
void set_user_by_name (nstring &login)
change::pointer get_cp ()
long get_change_number ()
void error_if_no_explicit_change_number ()
void invalidate_change_meta_data ()

Private Member Functions

 change_identifier (const change_identifier &)
change_identifieroperator= (const change_identifier &)

Private Attributes

project_identifier_subset_plain project_id
project_identifier_subset_branch branch_id
change_identifier_subset change_id


Detailed Description

The change_identifier class is used to represent a change and its context, as identified by all the different command line options used to specify a change set.

This class is a compound of the change_identifier_subset class and the project_identifier_subset class, because they are most commonly used together. The various methods are proxied to the appropriate instance variables.

Definition at line 38 of file identifier.h.


Constructor & Destructor Documentation

change_identifier::~change_identifier (  ) 

The destructor. It isn't virtual; thou shalt not derive from this class.

change_identifier::change_identifier (  ) 

The default constructor.

change_identifier::change_identifier ( const change_identifier  )  [private]

The copy constructor. Do not use.


Member Function Documentation

bool change_identifier::set (  )  const [inline]

The set method is used to determine if this change ID has been set yet (via any of several command line options).

Definition at line 56 of file identifier.h.

bool change_identifier::project_set (  )  const [inline]

The project_set method is used to determine if the project name has been set yet (via any of several command line options).

Definition at line 62 of file identifier.h.

void change_identifier::command_line_parse ( void(*)(void)  usage  )  [inline]

The command_line_parse method is used to parse command line options (via the arglex() function) to set the change ID. The current token is expected to be meaningful for identifying a change. The position will be advanced past all relevant tokens.

It understands all of the following command line options: -BaseLine [ -Change] number -BRanch number -TRunk -GrandParent -DELta number -DELta name -DELta_Date when -Developmen_Directory [ -Project ] string

Note:
There is no need to pass all of these command line options to this function for processing. Only pass those options which make sense. If is often the case that there are actually *two* changes being identified, and they will split the arguments between them.

Definition at line 90 of file identifier.h.

void change_identifier::command_line_parse_rest ( void(*)(void)  usage  ) 

The command_line_parse_rest method is used to parse the rest of the command line. It will call arglex(), command_line_parse, command_line_check, and generic_argument() to perform this processing.

bool change_identifier::get_devdir (  )  [inline]

Definition at line 103 of file identifier.h.

void change_identifier::command_line_check ( void(*)(void)  usage  )  [inline]

The command_line_check method is used to verify that sensible command line options have been specified, once the parse has completed.

Definition at line 111 of file identifier.h.

void change_identifier::set_baseline (  )  [inline]

The set_baseline method is used to specify that the baseline is the change being identified.

Definition at line 120 of file identifier.h.

bool change_identifier::get_baseline (  )  [inline]

The get_baseline method is used to determine whether the --baseline option has been specified.

Definition at line 126 of file identifier.h.

file_revision change_identifier::get_file_revision ( const nstring filename,
change_functor bad_state 
) [inline]

The get_file_revision is used to determine the path to the given file at the time specified by the change ID. It must be called after the set_change method has been called.

Parameters:
filename the name of the file of interest
bad_state what to do if the change is not in an appropriate state

Definition at line 139 of file identifier.h.

file_revision change_identifier::get_file_revision ( fstate_src_ty src,
change_functor bad_state 
) [inline]

The get_file_revision is used to determine the path to the given file at the time specified by the change ID. It must be called after the set_change method has been called.

Parameters:
src The meta data identifying the file (revison data, if set, will be ignored)
bad_state what to do if the change is not in an appropriate state

Definition at line 156 of file identifier.h.

void change_identifier::get_project_file_names ( nstring_list results  )  [inline]

The get_project_file_names method is used to obtain the list of project file names, taking into account and --delta* options.

Definition at line 166 of file identifier.h.

fstate_src_ty* change_identifier::get_project_file ( const nstring file_name  )  [inline]

The get_project_file method is used to obtain the details about a named file, taking any --delta* options into account.

Parameters:
file_name The name of the file of interest.
Returns:
pointer to file details, or NULL of the file does not exist.

Definition at line 181 of file identifier.h.

project_file_roll_forward* change_identifier::get_historian (  )  [inline]

The get_historian method is used to obtain the location of the historical file records reconstruction.

Note:
This function is a failure of the API to conceal this. Eventually it would be nice if all the users of this could be refactored to hide it again.

Definition at line 196 of file identifier.h.

nstring change_identifier::get_change_version_string (  )  [inline]

The get_change_version_string method is used to get the version string for the change.

Definition at line 206 of file identifier.h.

project_ty* change_identifier::get_pp (  )  [inline]

The get_pp method is used to get the project pointer for the change identified.

Definition at line 216 of file identifier.h.

user_ty::pointer change_identifier::get_up (  )  [inline]

The get_up method is used to get the user pointer for the change identified.

Definition at line 226 of file identifier.h.

void change_identifier::set_user_by_name ( nstring login  )  [inline]

The set_user_by_name method is used to set the user name by name. This is useful for the small set of command which accept a user name on the command line.

Parameters:
login The login name of the user.

Definition at line 239 of file identifier.h.

change::pointer change_identifier::get_cp (  )  [inline]

The get_cp method is used to get the change pointer for the change identified.

Definition at line 246 of file identifier.h.

long change_identifier::get_change_number (  )  [inline]

The get_change_number method is used to obtain the change number for the identified change.

Note:
There is no need to call magic_zero_decode().

Definition at line 259 of file identifier.h.

void change_identifier::error_if_no_explicit_change_number (  )  [inline]

The error_if_no_explicit_change_number is used to emit a fatal_intl error if no change number was specified on the command line.

Definition at line 270 of file identifier.h.

void change_identifier::invalidate_change_meta_data (  )  [inline]

The invalidate_change_meta_data method is used to discard cached information about the change. This is usually necessary when a sub-command is run and that subcommand would update the change meta-data.

Definition at line 281 of file identifier.h.

change_identifier& change_identifier::operator= ( const change_identifier  )  [private]

The assignment operator. Do not use.


Field Documentation

The branch_id instance variable is used to remember the project subset of identifying a change.

Definition at line 288 of file identifier.h.

The branch_id instance variable is used to remember the branch subset of identifying a change.

Definition at line 294 of file identifier.h.

The change_id instance variable is used to remember the change subset of identifying a change.

Definition at line 300 of file identifier.h.


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

Generated on Wed Mar 12 23:37:39 2008 for Aegis by  doxygen 1.5.5