00001 #ifndef CCIRCUIT_HH 00002 #define CCIRCUIT_HH 00003 00004 #include <vector> 00005 #include <xml/Parser.hh> 00006 #include <electro/CElement.hh> 00007 00008 00009 00010 00011 namespace RLC{ 00012 class CNetworksArea; 00013 } 00014 00021 class CCircuit { 00022 friend class CElement; 00023 friend class CVoltage; 00024 friend class CCurent; 00025 friend class CResistor; 00026 friend class CCapasistor; 00027 friend class CInductor; 00028 friend class CCurent_u; 00029 friend class CCurent_i; 00030 friend class CVoltage_u; 00031 friend class CVoltage_i; 00032 friend class CNode; 00033 00034 public: 00039 CCircuit() { m_ParentDrawingArea = 0; } 00044 ~CCircuit(); 00049 std::vector<CElement *>::iterator items_pos; 00054 void add_item(CElement * x){items.push_back(x);} 00062 void conect_items(std::string nameA,unsigned int pinA,std::string nameB,unsigned int pinB); 00066 void print_items(); 00071 void load(const std::string & we); 00075 void clear(); 00079 void draw(); 00086 void setParent(RLC::CNetworksArea* parent); 00088 std::vector<CElement *> items; 00089 protected: 00091 void throwError(const string& inMessage) const; 00093 int count_items(){return items.size();} 00095 CElement * get_item(std::string s); 00100 RLC::CNetworksArea* m_ParentDrawingArea; 00101 private: 00103 std::string filein; 00104 }; 00105 00106 #endif // CCIRCUIT_HH