00001 #ifndef SYSTEM_H
00002 #define SYSTEM_H
00003
00007 #include <list>
00008 #include <string>
00009
00010 #include "object.h"
00011 namespace dynamic
00012 {
00016 class System:public Object
00017 {
00018 private:
00019
00020 protected:
00024 std::list<Object*> m_list;
00025 void set_boundary_conditions();
00026 void set_elements();
00027 double set_absolut_x(int position,double value);
00028 double set_absolut_dx(int position,double value);
00032 void time_next(double time_max=0) throw(std::runtime_error,std::invalid_argument);
00033 void calculation() throw(std::runtime_error,std::invalid_argument);
00037 virtual void resize();
00038 unsigned matrix_rows();
00039 unsigned elements();
00040
00041 public:
00042 System();
00043 ~System();
00044
00045
00046
00052 class SystemEmpty: public std::invalid_argument {
00053 public:
00058 SystemEmpty(const std::string& msg = "dynamic system") : std::invalid_argument("The " + msg + " is empty."){}
00059 };
00063 void push_back(Object* p_Object);
00067 void push_front(Object* p_Object);
00071 void time_to(double time_to) throw(std::runtime_error,std::invalid_argument);
00072
00073 };
00074 }
00075 #endif //SYSTEM_H