Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

basic-merge-main.cc File Reference

#include "Basic_Consumer.hh"

Go to the source code of this file.

Functions

int main (const unsigned int argc, const char **const argv)
 The entry point.


Function Documentation

int main const unsigned int    argc,
const char **const    argv
 

The entry point.

Parameters:
argc  The number of arguments given at the command line.
argv  The vector of argument strings passed at the command line.
Returns :
An execution result code.
Parse the command line arguments to obtain the type of merge requested and the pathnames of the input traces. Create and invoke an object that will perform the requested type of merge.

Definition at line 28 of file basic-merge-main.cc.

References Consumer::merge().

00028                                                         {
00029 
00030   // Were the correct number of arguments passed?
00031   if (argc != 3) {
00032 
00033     // No.  Emit usage and exit.
00034     fprintf(stderr, "Usage: %s\n", argv[0]);
00035     fprintf(stderr, "       <reference trace pathname>\n");
00036     fprintf(stderr, "       <kernel trace pathname>\n");
00037     return 1;
00038 
00039   }
00040 
00041   // Create the trace consumer object.
00042   Basic_Consumer* consumer = new Basic_Consumer(argv[1], argv[2]);
00043   if (consumer == 0) {
00044     fprintf(stderr, "main(): Failed allocation of Basic_Consumer\n");
00045     return 1;
00046   }
00047 
00048   // Merge the traces.
00049   consumer->merge();
00050 
00051   // Eliminate the consumer object.
00052   delete consumer;
00053   consumer = 0;
00054 
00055   // Exit successfully.
00056   return 0;
00057 
00058 } // main


Generated on Sun Nov 3 12:11:09 2002 for Laplace-merge by doxygen1.2.17