00001 00004 #ifndef inputParam_hh 00005 #define inputParam_hh 00006 00007 #include <iostream> 00008 #include "basics/outputOperator.hh" 00009 #include "inputOutput.hh" 00010 #include "sequence.hh" 00011 00012 namespace concepts { 00013 00014 // ******************************************************** InputParameter ** 00015 00021 class InputParameter : public OutputOperator { 00022 public: 00027 InputParameter(InOutParameters& input); 00031 virtual std::ostream& letters(std::ostream& os) const = 0; 00033 virtual std::ostream& arguments(std::ostream& os) const = 0; 00035 virtual std::ostream& description(std::ostream& os) const = 0; 00040 virtual int input(int opt, const char* optarg) = 0; 00042 const InOutParameters parameters() const { return input_; } 00043 InOutParameters& parameters() { return input_; } 00044 protected: 00045 virtual std::ostream& info(std::ostream& os) const; 00047 InOutParameters& input_; 00048 }; 00049 00050 // ************************************************************* InputFile ** 00051 00056 class InputFile : public InputParameter { 00057 public: 00059 InputFile(InOutParameters& input); 00060 00061 virtual std::ostream& letters(std::ostream& os) const; 00062 virtual std::ostream& arguments(std::ostream& os) const; 00063 virtual std::ostream& description(std::ostream& os) const; 00064 virtual int input(int opt, const char* optarg); 00065 protected: 00066 virtual std::ostream& info(std::ostream& os) const; 00067 }; 00068 00069 // ****************************************************** ProcessParameter ** 00070 00078 class ProcessParameter : public OutputOperator { 00079 public: 00081 ProcessParameter(InputParameter& input); 00083 ProcessParameter(InOutParameters& input); 00085 void add(InputParameter& input) { inputs_.push_back(&input); } 00090 bool apply(int argc, char** argv); 00091 protected: 00092 virtual std::ostream& info(std::ostream& os) const; 00093 private: 00095 std::auto_ptr<InputFile> inputfile_; 00097 Sequence<InputParameter*> inputs_; 00098 00099 }; 00100 00101 } // namespace concepts 00102 00103 #endif // inputParam_hh