MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / ReadXML

Method ReadXML

cpp/src/command_classes/Association.cpp:71–107  ·  view source on GitHub ↗

----------------------------------------------------------------------------- Read the saved association data -----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

69// Read the saved association data
70//-----------------------------------------------------------------------------
71void Association::ReadXML
72(
73 TiXmlElement const* _ccElement
74)
75{
76 CommandClass::ReadXML( _ccElement );
77
78 TiXmlElement const* associationsElement = _ccElement->FirstChildElement();
79 while( associationsElement )
80 {
81 char const* str = associationsElement->Value();
82 if( str && !strcmp( str, "Associations" ) )
83 {
84 int intVal;
85 if( TIXML_SUCCESS == associationsElement->QueryIntAttribute( "num_groups", &intVal ) )
86 {
87 m_numGroups = (uint8)intVal;
88 }
89
90 TiXmlElement const* groupElement = associationsElement->FirstChildElement();
91 while( groupElement )
92 {
93 if( Node* node = GetNodeUnsafe() )
94 {
95 Group* group = new Group( GetHomeId(), GetNodeId(), groupElement );
96 node->AddGroup( group );
97 }
98
99 groupElement = groupElement->NextSiblingElement();
100 }
101
102 break;
103 }
104
105 associationsElement = associationsElement->NextSiblingElement();
106 }
107}
108
109//-----------------------------------------------------------------------------
110// <Association::WriteXML>

Callers

nothing calls this directly

Calls 7

QueryIntAttributeMethod · 0.80
AddGroupMethod · 0.80
GetHomeIdFunction · 0.70
GetNodeIdFunction · 0.70
FirstChildElementMethod · 0.45
ValueMethod · 0.45
NextSiblingElementMethod · 0.45

Tested by

no test coverage detected