]> git.donarmstrong.com Git - mothur.git/blob - readsharedcommand.cpp
added read.shared, broke up globaldata a bit
[mothur.git] / readsharedcommand.cpp
1 /*
2  *  readsharedcommand.cpp
3  *  Mothur
4  *
5  *  Created by Sarah Westcott on 2/12/09.
6  *  Copyright 2009 Schloss Lab UMASS Amherst. All rights reserved.
7  *
8  */
9
10 #include "readsharedcommand.h"
11
12 //**********************************************************************************************************************
13 ReadSharedCommand::ReadSharedCommand(){
14         try {
15                 globaldata = GlobalData::getInstance();
16                 filename = globaldata->inputFileName;
17                 read = new ReadPhilFile(filename);
18         }
19         catch(exception& e) {
20                 cout << "Standard Error: " << e.what() << " has occurred in the ReadSharedCommand class Function ReadSharedCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
21                 exit(1);
22         }
23         catch(...) {
24                 cout << "An unknown error has occurred in the ReadSharedCommand class function ReadSharedCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
25                 exit(1);
26         }
27 }
28
29 //**********************************************************************************************************************
30
31 ReadSharedCommand::~ReadSharedCommand(){
32         delete read;
33 }
34
35 //**********************************************************************************************************************
36
37 int ReadSharedCommand::execute(){
38         try {
39                 read->read(&*globaldata); 
40         
41                 return 0;
42         }
43         catch(exception& e) {
44                 cout << "Standard Error: " << e.what() << " has occurred in the ReadSharedCommand class Function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
45                 exit(1);
46         }
47         catch(...) {
48                 cout << "An unknown error has occurred in the ReadSharedCommand class function execute. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
49                 exit(1);
50         }
51 }
52 //**********************************************************************************************************************