#include <clothe.h>
Public Member Functions | |
~Clothe () | |
Clothe (xmlpp::Element *xml, std::map< std::string, Member * > &members_lst) | |
Clothe (Clothe *c, std::map< std::string, Member * > &members_lst) | |
Public Attributes | |
std::string | name |
std::vector< Member * > | layers |
Definition at line 32 of file clothe.h.
Clothe::~Clothe | ( | ) |
Clothe::Clothe | ( | xmlpp::Element * | xml, | |
std::map< std::string, Member * > & | members_lst | |||
) |
Definition at line 28 of file clothe.cpp.
00029 { 00030 XmlReader::ReadStringAttr( xml, "name", name); 00031 00032 xmlpp::Node::NodeList nodes = xml -> get_children("member"); 00033 xmlpp::Node::NodeList::iterator 00034 it=nodes.begin(), 00035 end=nodes.end(); 00036 00037 for (; it != end; ++it) 00038 { 00039 xmlpp::Element *elem = dynamic_cast<xmlpp::Element*> (*it); 00040 assert (elem != NULL); 00041 std::string att; 00042 if (!XmlReader::ReadStringAttr(elem, "name", att)) 00043 { 00044 std::cerr << "Malformed attached member definition" << std::endl; 00045 continue; 00046 } 00047 00048 Member* member = NULL; 00049 if(members_lst.find(att) != members_lst.end()) 00050 { 00051 member = members_lst.find(att)->second; 00052 } 00053 else 00054 { 00055 std::cerr << "Undefined member \"" << att << "\"" << std::endl; 00056 } 00057 00058 int lay=0; 00059 if(XmlReader::ReadIntAttr(elem, "layer", lay)) 00060 { 00061 if((uint)lay >= layers.size()) 00062 layers.resize( lay+1, (Member*)NULL); 00063 layers[lay] = member; 00064 } 00065 } 00066 00067 std::vector<Member*>::iterator i = layers.begin(); 00068 while( i != layers.end()) 00069 if(*i!=NULL) 00070 i++; 00071 else 00072 i=layers.erase(i); 00073 }
Here is the call graph for this function:
std::vector<Member*> Clothe::layers |
std::string Clothe::name |