- Timestamp:
- 01/07/20 18:53:52 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp
r1784 r1848 205 205 { 206 206 // Account for extra header info 207 minimumSize += CEventClient::headerSize + getId Server().size() + sizeof(size_t);207 minimumSize += CEventClient::headerSize + getId().size() + sizeof(size_t); 208 208 209 209 const std::list<int>& ranks = client->getRanksServerLeader(); … … 241 241 { 242 242 CMessage msg; 243 msg<<this->getIdServer(); // pb with context attribute -> to check : for now seem to be never used for context... 243 msg<<this->getId(); 244 msg << attr.getName(); 245 msg << attr; 246 const std::list<int>& ranks = client->getRanksServerLeader(); 247 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 248 event.push(*itRank,1,msg); 249 client->sendEvent(event); 250 } 251 else client->sendEvent(event); 252 } 253 254 /* specialisation for context, because context Id on client is not the same on server, and no need to transfer context Id */ 255 template <> 256 void CObjectTemplate<CContext>::sendAttributToServer(CAttribute& attr, CContextClient* client) 257 { 258 CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE); 259 if (client->isServerLeader()) 260 { 261 CMessage msg; 244 262 msg << attr.getName(); 245 263 msg << attr; … … 296 314 } 297 315 316 /* specialisation for context, because context Id on client is not the same on server and no need to transfer context Id */ 317 template <> 318 void CObjectTemplate<CContext>::recvAttributFromClient(CEventServer& event) 319 { 320 321 CBufferIn* buffer=event.subEvents.begin()->buffer; 322 string attrId; 323 CAttributeMap & attrMap = *CContext::getCurrent(); 324 *buffer>>attrId; 325 CAttribute* attr=attrMap[attrId]; 326 info(50) << "attribut recu " << attrId << " "; 327 if (attr->isEmpty()) info(50) << "--> empty" << endl; 328 else info(50) /*<attr->getValue()*/ << endl; 329 *buffer>>*attr; 330 info(50) << "attribut recu " << attrId << " "; 331 if (attr->isEmpty()) info(50) << "--> empty" << endl; 332 else info(50) /*attr->getValue()*/ << endl; 333 } 334 335 298 336 template <class T> 299 337 bool CObjectTemplate<T>::dispatchEvent(CEventServer& event)
Note: See TracChangeset
for help on using the changeset viewer.