Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

app-kersten/inputDomains.hh
Go to the documentation of this file.
00001 
00005 #ifndef inputDomains_hh
00006 #define inputDomains_hh
00007 
00008 #include "toolbox/inputParam.hh"
00009 
00010 namespace concepts {
00011 
00012   // ********************************************************** InputDomains **
00013 
00018   class InputDomains : public InputParameter {
00019   public:
00025     InputDomains(InOutParameters& input, uint noDomains = 2);
00029     virtual std::ostream& letters(std::ostream& os) const;
00031     virtual std::ostream& arguments(std::ostream& os) const;
00033     virtual std::ostream& description(std::ostream& os) const;
00038     virtual int input(int opt, const char* optarg);
00039   protected:
00040     virtual std::ostream& info(std::ostream& os) const;
00041   private:
00043     uint noDomains_;
00044   };
00045 
00046   InputDomains::InputDomains(InOutParameters& input, uint noDomains)
00047     :  InputParameter(input), noDomains_(noDomains) {
00048     input_.addInt("noDomains", noDomains);
00049   }
00050 
00051   std::ostream& InputDomains::letters(std::ostream& os) const {
00052     return os << "O:";
00053   }
00054 
00055   std::ostream& InputDomains::arguments(std::ostream& os) const {
00056     return os << "[-O DOMAINS] ";
00057   }
00058 
00059   std::ostream& InputDomains::description(std::ostream& os) const {
00060     return os << "DOMAINS       : number of domains (" << noDomains_ << ")"
00061         << std::endl;
00062   }
00063 
00064   int InputDomains::input(int opt, const char* optarg) {
00065     int info = 0;
00066     switch(opt) {
00067     case 'O':
00068       if (atoi(optarg) > 0) input_.addInt("noDomains", atoi(optarg));
00069       else info = 2; break;
00070     default: info = 1; break;
00071     }
00072     return info;
00073   }
00074 
00075   std::ostream& InputDomains::info(std::ostream& os) const {
00076     os << "InputDomains(";
00077     return arguments(os) << ")";
00078   }
00079 
00080 } // namespace concepts
00081 
00082 #endif // inputDomains_hh

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)