[219] | 1 | #include "file.hpp" |
---|
| 2 | |
---|
[352] | 3 | #include "attribute_template.hpp" |
---|
| 4 | #include "object_template.hpp" |
---|
| 5 | #include "group_template.hpp" |
---|
[219] | 6 | #include "object_factory.hpp" |
---|
[300] | 7 | #include "data_output.hpp" |
---|
| 8 | #include "context.hpp" |
---|
| 9 | #include "context_server.hpp" |
---|
| 10 | #include "nc4_data_output.hpp" |
---|
[318] | 11 | #include "calendar_util.hpp" |
---|
| 12 | #include "date.hpp" |
---|
[352] | 13 | #include "message.hpp" |
---|
| 14 | #include "type.hpp" |
---|
| 15 | #include "xmlioserver_spl.hpp" |
---|
| 16 | #include "context_client.hpp" |
---|
[219] | 17 | |
---|
[335] | 18 | namespace xios { |
---|
[219] | 19 | |
---|
| 20 | /// ////////////////////// Définitions ////////////////////// /// |
---|
| 21 | |
---|
| 22 | CFile::CFile(void) |
---|
| 23 | : CObjectTemplate<CFile>(), CFileAttributes() |
---|
| 24 | , vFieldGroup(), data_out(), enabledFields() |
---|
[300] | 25 | { setVirtualFieldGroup() ;} |
---|
[219] | 26 | |
---|
| 27 | CFile::CFile(const StdString & id) |
---|
| 28 | : CObjectTemplate<CFile>(id), CFileAttributes() |
---|
| 29 | , vFieldGroup(), data_out(), enabledFields() |
---|
[300] | 30 | { setVirtualFieldGroup() ;} |
---|
[219] | 31 | |
---|
| 32 | CFile::~CFile(void) |
---|
| 33 | { /* Ne rien faire de plus */ } |
---|
| 34 | |
---|
| 35 | ///--------------------------------------------------------------- |
---|
| 36 | |
---|
| 37 | StdString CFile::GetName(void) { return (StdString("file")); } |
---|
| 38 | StdString CFile::GetDefName(void){ return (CFile::GetName()); } |
---|
| 39 | ENodeType CFile::GetType(void) { return (eFile); } |
---|
| 40 | |
---|
| 41 | //---------------------------------------------------------------- |
---|
| 42 | |
---|
[337] | 43 | boost::shared_ptr<CDataOutput> CFile::getDataOutput(void) const |
---|
[219] | 44 | { |
---|
| 45 | return (data_out); |
---|
| 46 | } |
---|
| 47 | |
---|
[347] | 48 | CFieldGroup* CFile::getVirtualFieldGroup(void) const |
---|
[219] | 49 | { |
---|
| 50 | return (this->vFieldGroup); |
---|
| 51 | } |
---|
| 52 | |
---|
[347] | 53 | std::vector<CField*> CFile::getAllFields(void) const |
---|
[219] | 54 | { |
---|
| 55 | return (this->vFieldGroup->getAllChildren()); |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | //---------------------------------------------------------------- |
---|
| 59 | |
---|
[347] | 60 | std::vector<CField*> CFile::getEnabledFields(int default_outputlevel, |
---|
| 61 | int default_level, |
---|
| 62 | bool default_enabled) |
---|
[219] | 63 | { |
---|
| 64 | if (!this->enabledFields.empty()) |
---|
| 65 | return (this->enabledFields); |
---|
| 66 | |
---|
| 67 | const int _outputlevel = |
---|
| 68 | (!output_level.isEmpty()) ? output_level.getValue() : default_outputlevel; |
---|
[347] | 69 | std::vector<CField*>::iterator it; |
---|
[219] | 70 | this->enabledFields = this->getAllFields(); |
---|
| 71 | |
---|
[347] | 72 | std::vector<CField*> newEnabledFields; |
---|
[300] | 73 | |
---|
[219] | 74 | for ( it = this->enabledFields.begin() ; it != this->enabledFields.end(); it++ ) |
---|
| 75 | { |
---|
| 76 | if (!(*it)->enabled.isEmpty()) // Si l'attribut 'enabled' est défini ... |
---|
| 77 | { |
---|
[300] | 78 | if (! (*it)->enabled.getValue()) continue; |
---|
| 79 | // { it--; this->enabledFields.erase(it+1); continue; } |
---|
[219] | 80 | } |
---|
| 81 | else // Si l'attribut 'enabled' n'est pas défini ... |
---|
| 82 | { |
---|
[300] | 83 | if (!default_enabled) continue ; |
---|
| 84 | // { it--; this->enabledFields.erase(it+1); continue; } |
---|
[219] | 85 | } |
---|
| 86 | |
---|
| 87 | if (!(*it)->level.isEmpty()) // Si l'attribut 'level' est défini ... |
---|
| 88 | { |
---|
[300] | 89 | if ((*it)->level.getValue() > _outputlevel) continue ; |
---|
| 90 | // { it--; this->enabledFields.erase(it+1); continue; } |
---|
[219] | 91 | } |
---|
| 92 | else // Si l'attribut 'level' n'est pas défini ... |
---|
| 93 | { |
---|
[300] | 94 | if (default_level > _outputlevel) continue ; |
---|
| 95 | // { it--; this->enabledFields.erase(it+1); continue; } |
---|
[219] | 96 | } |
---|
[300] | 97 | |
---|
| 98 | // CField* field_tmp=(*it).get() ; |
---|
| 99 | // shared_ptr<CField> sptfield=*it ; |
---|
| 100 | // field_tmp->refObject.push_back(sptfield) ; |
---|
| 101 | newEnabledFields.push_back(*it) ; |
---|
[286] | 102 | // Le champ est finalement actif, on y ajoute sa propre reference. |
---|
| 103 | (*it)->refObject.push_back(*it); |
---|
| 104 | // Le champ est finalement actif, on y ajoute la référence au champ de base. |
---|
[346] | 105 | (*it)->setRelFile(CFile::get(this)); |
---|
[219] | 106 | (*it)->baseRefObject->refObject.push_back(*it); |
---|
[286] | 107 | // A faire, ajouter les references intermediaires... |
---|
[219] | 108 | } |
---|
[300] | 109 | enabledFields=newEnabledFields ; |
---|
[219] | 110 | |
---|
| 111 | return (this->enabledFields); |
---|
| 112 | } |
---|
| 113 | |
---|
| 114 | //---------------------------------------------------------------- |
---|
| 115 | |
---|
[347] | 116 | void CFile::setVirtualFieldGroup(CFieldGroup* newVFieldGroup) |
---|
[219] | 117 | { |
---|
| 118 | this->vFieldGroup = newVFieldGroup; |
---|
| 119 | } |
---|
| 120 | |
---|
| 121 | //---------------------------------------------------------------- |
---|
| 122 | |
---|
[300] | 123 | void CFile::setVirtualFieldGroup(void) |
---|
[219] | 124 | { |
---|
[346] | 125 | this->setVirtualFieldGroup(CFieldGroup::create()); |
---|
[219] | 126 | } |
---|
| 127 | |
---|
| 128 | //---------------------------------------------------------------- |
---|
[318] | 129 | bool CFile::isSyncTime(void) |
---|
| 130 | { |
---|
[347] | 131 | CContext* context = CContext::getCurrent() ; |
---|
[343] | 132 | CDate& currentDate=context->calendar->getCurrentDate() ; |
---|
[318] | 133 | if (! sync_freq.isEmpty()) |
---|
| 134 | { |
---|
| 135 | if (*lastSync+syncFreq < currentDate) |
---|
| 136 | { |
---|
| 137 | *lastSync=currentDate ; |
---|
| 138 | return true ; |
---|
| 139 | } |
---|
| 140 | } |
---|
| 141 | return false ; |
---|
| 142 | } |
---|
[321] | 143 | |
---|
| 144 | void CFile::initFile(void) |
---|
| 145 | { |
---|
[347] | 146 | CContext* context = CContext::getCurrent() ; |
---|
[343] | 147 | CDate& currentDate=context->calendar->getCurrentDate() ; |
---|
[318] | 148 | |
---|
[343] | 149 | if (! sync_freq.isEmpty()) syncFreq = CDuration::FromString(sync_freq.getValue()); |
---|
| 150 | if (! split_freq.isEmpty()) splitFreq = CDuration::FromString(split_freq.getValue()); |
---|
| 151 | if (! output_freq.isEmpty()) outputFreq = CDuration::FromString(output_freq.getValue()); |
---|
| 152 | lastSync=new CDate(currentDate) ; |
---|
| 153 | lastSplit=new CDate(currentDate) ; |
---|
[321] | 154 | isOpen=false ; |
---|
| 155 | } |
---|
| 156 | |
---|
| 157 | void CFile::checkFile(void) |
---|
| 158 | { |
---|
| 159 | if (!isOpen) createHeader() ; |
---|
| 160 | checkSync() ; |
---|
| 161 | checkSplit() ; |
---|
| 162 | } |
---|
| 163 | |
---|
| 164 | |
---|
| 165 | bool CFile::checkSync(void) |
---|
| 166 | { |
---|
[347] | 167 | CContext* context = CContext::getCurrent() ; |
---|
[343] | 168 | CDate& currentDate=context->calendar->getCurrentDate() ; |
---|
[321] | 169 | if (! sync_freq.isEmpty()) |
---|
| 170 | { |
---|
| 171 | if (*lastSync+syncFreq < currentDate) |
---|
| 172 | { |
---|
| 173 | *lastSync=currentDate ; |
---|
| 174 | data_out->syncFile() ; |
---|
| 175 | return true ; |
---|
| 176 | } |
---|
| 177 | } |
---|
| 178 | return false ; |
---|
| 179 | } |
---|
| 180 | |
---|
| 181 | |
---|
| 182 | bool CFile::checkSplit(void) |
---|
| 183 | { |
---|
[347] | 184 | CContext* context = CContext::getCurrent() ; |
---|
[343] | 185 | CDate& currentDate=context->calendar->getCurrentDate() ; |
---|
[321] | 186 | if (! split_freq.isEmpty()) |
---|
| 187 | { |
---|
| 188 | if (*lastSplit+splitFreq < currentDate) |
---|
| 189 | { |
---|
| 190 | *lastSplit=currentDate-outputFreq ; |
---|
| 191 | |
---|
[347] | 192 | std::vector<CField*>::iterator it, end = this->enabledFields.end(); |
---|
[321] | 193 | for (it = this->enabledFields.begin() ;it != end; it++) (*it)->resetNStep() ; |
---|
| 194 | createHeader() ; |
---|
| 195 | return true ; |
---|
| 196 | } |
---|
| 197 | } |
---|
| 198 | return false ; |
---|
| 199 | } |
---|
| 200 | |
---|
[300] | 201 | void CFile::createHeader(void) |
---|
[219] | 202 | { |
---|
[347] | 203 | CContext* context = CContext::getCurrent() ; |
---|
[343] | 204 | CDate& currentDate=context->calendar->getCurrentDate() ; |
---|
[318] | 205 | |
---|
[347] | 206 | std::vector<CField*>::iterator it, end = this->enabledFields.end(); |
---|
[219] | 207 | |
---|
[300] | 208 | AllDomainEmpty=true ; |
---|
[318] | 209 | set<CDomain*> setDomain ; |
---|
[219] | 210 | for (it = this->enabledFields.begin() ;it != end; it++) |
---|
| 211 | { |
---|
[347] | 212 | CField* field = *it; |
---|
[300] | 213 | AllDomainEmpty&=field->grid->domain->isEmpty() ; |
---|
[347] | 214 | setDomain.insert(field->grid->domain) ; |
---|
[219] | 215 | } |
---|
[318] | 216 | nbDomain=setDomain.size() ; |
---|
| 217 | |
---|
[369] | 218 | if (!AllDomainEmpty || type == type_attr::one_file) |
---|
[300] | 219 | { |
---|
| 220 | StdString filename = (!name.isEmpty()) ? name.getValue() : getId(); |
---|
| 221 | StdOStringStream oss; |
---|
| 222 | // if (! output_dir.isEmpty()) oss << output_dir.getValue(); |
---|
| 223 | oss << filename; |
---|
| 224 | if (!name_suffix.isEmpty()) oss << name_suffix.getValue(); |
---|
[321] | 225 | // if (!split_freq.isEmpty()) oss<<"-["<<currentDate.toString()<<"]" ; |
---|
[343] | 226 | if (!split_freq.isEmpty()) oss<<"_"<<lastSplit->getStryyyymmdd()<<"-"<< (*lastSplit+(splitFreq-1*Second)).getStryyyymmdd(); |
---|
[300] | 227 | bool multifile=true ; |
---|
| 228 | if (!type.isEmpty()) |
---|
| 229 | { |
---|
[369] | 230 | if (type==type_attr::one_file) multifile=false ; |
---|
| 231 | else if (type==type_attr::multiple_file) multifile=true ; |
---|
[300] | 232 | else ERROR("void Context::createDataOutput(void)", |
---|
| 233 | "incorrect file <type> attribut : must be <multi_file> or <one_file>, " |
---|
| 234 | <<"having : <"<<type.getValue()<<">") ; |
---|
| 235 | } |
---|
[219] | 236 | |
---|
[300] | 237 | CContextServer* server=context->server ; |
---|
| 238 | |
---|
| 239 | if (multifile) |
---|
| 240 | { |
---|
| 241 | if (server->intraCommSize > 1) oss << "_" << server->intraCommRank; |
---|
| 242 | } |
---|
| 243 | oss << ".nc"; |
---|
| 244 | |
---|
[321] | 245 | if (isOpen) data_out->closeFile() ; |
---|
[335] | 246 | bool isCollective=true ; |
---|
| 247 | if (!par_access.isEmpty()) |
---|
| 248 | { |
---|
| 249 | if (par_access.getValue()=="independent") isCollective=false ; |
---|
| 250 | else if (par_access.getValue()=="collective") isCollective=true ; |
---|
| 251 | else |
---|
| 252 | { |
---|
| 253 | ERROR("void Context::createDataOutput(void)", |
---|
| 254 | "incorrect file <par_access> attribut : must be <collective> or <indepedent>, " |
---|
| 255 | <<"having : <"<<type.getValue()<<">") ; |
---|
| 256 | } |
---|
| 257 | } |
---|
[337] | 258 | data_out=shared_ptr<CDataOutput>(new CNc4DataOutput(oss.str(), false,server->intraComm,multifile, isCollective)); |
---|
[321] | 259 | isOpen=true ; |
---|
[300] | 260 | |
---|
[346] | 261 | data_out->writeFile(CFile::get(this)); |
---|
[300] | 262 | for (it = this->enabledFields.begin() ;it != end; it++) |
---|
| 263 | { |
---|
[347] | 264 | CField* field = *it; |
---|
[300] | 265 | this->data_out->writeFieldGrid(field); |
---|
| 266 | } |
---|
| 267 | |
---|
| 268 | for (it = this->enabledFields.begin() ;it != end; it++) |
---|
| 269 | { |
---|
[347] | 270 | CField* field = *it; |
---|
[300] | 271 | this->data_out->writeField(field); |
---|
| 272 | } |
---|
| 273 | |
---|
| 274 | this->data_out->definition_end(); |
---|
[219] | 275 | } |
---|
| 276 | } |
---|
| 277 | |
---|
[286] | 278 | void CFile::close(void) |
---|
| 279 | { |
---|
[321] | 280 | delete lastSync ; |
---|
| 281 | delete lastSplit ; |
---|
[369] | 282 | if (!AllDomainEmpty || type==type_attr::one_file) |
---|
[321] | 283 | if (isOpen) |
---|
| 284 | { |
---|
| 285 | this->data_out->closeFile(); |
---|
| 286 | } |
---|
[286] | 287 | } |
---|
[219] | 288 | //---------------------------------------------------------------- |
---|
| 289 | |
---|
| 290 | void CFile::parse(xml::CXMLNode & node) |
---|
| 291 | { |
---|
| 292 | SuperClass::parse(node); |
---|
| 293 | if (node.goToChildElement() & this->hasId()) |
---|
| 294 | { // Si la définition du fichier intégre des champs et si le fichier est identifié. |
---|
| 295 | node.goToParentElement(); |
---|
[300] | 296 | // this->setVirtualFieldGroup(this->getId()); |
---|
[219] | 297 | this->getVirtualFieldGroup()->parse(node, false); |
---|
| 298 | } |
---|
| 299 | } |
---|
| 300 | //---------------------------------------------------------------- |
---|
| 301 | |
---|
| 302 | StdString CFile::toString(void) const |
---|
| 303 | { |
---|
| 304 | StdOStringStream oss; |
---|
| 305 | |
---|
| 306 | oss << "<" << CFile::GetName() << " "; |
---|
| 307 | if (this->hasId()) |
---|
| 308 | oss << " id=\"" << this->getId() << "\" "; |
---|
| 309 | oss << SuperClassAttribute::toString() << ">" << std::endl; |
---|
[347] | 310 | if (this->getVirtualFieldGroup() != NULL) |
---|
[219] | 311 | oss << *this->getVirtualFieldGroup() << std::endl; |
---|
| 312 | oss << "</" << CFile::GetName() << " >"; |
---|
| 313 | return (oss.str()); |
---|
| 314 | } |
---|
| 315 | |
---|
| 316 | //---------------------------------------------------------------- |
---|
| 317 | |
---|
| 318 | void CFile::solveDescInheritance(const CAttributeMap * const parent) |
---|
| 319 | { |
---|
| 320 | SuperClassAttribute::setAttributes(parent); |
---|
| 321 | this->getVirtualFieldGroup()->solveDescInheritance(NULL); |
---|
| 322 | } |
---|
| 323 | |
---|
| 324 | //---------------------------------------------------------------- |
---|
| 325 | |
---|
| 326 | void CFile::solveFieldRefInheritance(void) |
---|
| 327 | { |
---|
| 328 | // Résolution des héritages par référence de chacun des champs contenus dans le fichier. |
---|
[347] | 329 | std::vector<CField*> allF = this->getAllFields(); |
---|
[219] | 330 | for (unsigned int i = 0; i < allF.size(); i++) |
---|
| 331 | allF[i]->solveRefInheritance(); |
---|
| 332 | } |
---|
| 333 | |
---|
| 334 | //---------------------------------------------------------------- |
---|
| 335 | |
---|
| 336 | void CFile::solveEFGridRef(void) |
---|
| 337 | { |
---|
| 338 | for (unsigned int i = 0; i < this->enabledFields.size(); i++) |
---|
| 339 | this->enabledFields[i]->solveGridReference(); |
---|
| 340 | } |
---|
| 341 | |
---|
| 342 | //---------------------------------------------------------------- |
---|
| 343 | |
---|
| 344 | void CFile::solveEFOperation(void) |
---|
| 345 | { |
---|
| 346 | for (unsigned int i = 0; i < this->enabledFields.size(); i++) |
---|
| 347 | this->enabledFields[i]->solveOperation(); |
---|
| 348 | } |
---|
| 349 | |
---|
| 350 | //--------------------------------------------------------------- |
---|
[369] | 351 | /* |
---|
[219] | 352 | void CFile::toBinary (StdOStream & os) const |
---|
| 353 | { |
---|
| 354 | ENodeType genum = CFileGroup::GetType(); |
---|
[347] | 355 | bool hasVFG = (this->getVirtualFieldGroup() != NULL); |
---|
[219] | 356 | SuperClass::toBinary(os); |
---|
| 357 | |
---|
| 358 | os.write (reinterpret_cast<const char*>(&genum) , sizeof(ENodeType)); |
---|
| 359 | os.write (reinterpret_cast<const char*>(&hasVFG) , sizeof(bool)); |
---|
| 360 | |
---|
| 361 | if (hasVFG)this->getVirtualFieldGroup()->toBinary(os); |
---|
| 362 | |
---|
| 363 | } |
---|
| 364 | |
---|
| 365 | //---------------------------------------------------------------- |
---|
| 366 | |
---|
| 367 | void CFile::fromBinary(StdIStream & is) |
---|
| 368 | { |
---|
| 369 | ENodeType renum = Unknown; |
---|
| 370 | bool hasVFG = false; |
---|
| 371 | SuperClass::fromBinary(is); |
---|
| 372 | |
---|
| 373 | is.read (reinterpret_cast<char*>(&renum), sizeof(ENodeType)); |
---|
| 374 | is.read (reinterpret_cast<char*>(&hasVFG), sizeof(bool)); |
---|
| 375 | |
---|
| 376 | if (renum != CFileGroup::GetType()) |
---|
| 377 | ERROR("CFile::fromBinary(StdIStream & is)", |
---|
| 378 | << "[ renum = " << renum << "] Bad type !"); |
---|
| 379 | |
---|
[300] | 380 | // this->setVirtualFieldGroup(this->getId()); |
---|
[219] | 381 | if (hasVFG)this->getVirtualFieldGroup()->fromBinary(is); |
---|
| 382 | |
---|
| 383 | } |
---|
[369] | 384 | */ |
---|
| 385 | |
---|
[347] | 386 | CField* CFile::addField(const string& id) |
---|
[300] | 387 | { |
---|
| 388 | return vFieldGroup->createChild(id) ; |
---|
| 389 | } |
---|
[219] | 390 | |
---|
[347] | 391 | CFieldGroup* CFile::addFieldGroup(const string& id) |
---|
[300] | 392 | { |
---|
| 393 | return vFieldGroup->createChildGroup(id) ; |
---|
| 394 | } |
---|
| 395 | |
---|
| 396 | |
---|
| 397 | void CFile::sendAddField(const string& id) |
---|
| 398 | { |
---|
[347] | 399 | CContext* context=CContext::getCurrent() ; |
---|
[300] | 400 | |
---|
| 401 | if (! context->hasServer ) |
---|
| 402 | { |
---|
| 403 | CContextClient* client=context->client ; |
---|
| 404 | |
---|
| 405 | CEventClient event(this->getType(),EVENT_ID_ADD_FIELD) ; |
---|
| 406 | if (client->isServerLeader()) |
---|
| 407 | { |
---|
| 408 | CMessage msg ; |
---|
| 409 | msg<<this->getId() ; |
---|
| 410 | msg<<id ; |
---|
| 411 | event.push(client->getServerLeader(),1,msg) ; |
---|
| 412 | client->sendEvent(event) ; |
---|
| 413 | } |
---|
| 414 | else client->sendEvent(event) ; |
---|
| 415 | } |
---|
| 416 | |
---|
| 417 | } |
---|
| 418 | |
---|
| 419 | void CFile::sendAddFieldGroup(const string& id) |
---|
| 420 | { |
---|
[347] | 421 | CContext* context=CContext::getCurrent() ; |
---|
[300] | 422 | if (! context->hasServer ) |
---|
| 423 | { |
---|
| 424 | CContextClient* client=context->client ; |
---|
| 425 | |
---|
| 426 | CEventClient event(this->getType(),EVENT_ID_ADD_FIELD_GROUP) ; |
---|
| 427 | if (client->isServerLeader()) |
---|
| 428 | { |
---|
| 429 | CMessage msg ; |
---|
| 430 | msg<<this->getId() ; |
---|
| 431 | msg<<id ; |
---|
| 432 | event.push(client->getServerLeader(),1,msg) ; |
---|
| 433 | client->sendEvent(event) ; |
---|
| 434 | } |
---|
| 435 | else client->sendEvent(event) ; |
---|
| 436 | } |
---|
| 437 | |
---|
| 438 | } |
---|
| 439 | |
---|
| 440 | void CFile::recvAddField(CEventServer& event) |
---|
| 441 | { |
---|
| 442 | |
---|
| 443 | CBufferIn* buffer=event.subEvents.begin()->buffer; |
---|
| 444 | string id; |
---|
| 445 | *buffer>>id ; |
---|
| 446 | get(id)->recvAddField(*buffer) ; |
---|
| 447 | } |
---|
| 448 | |
---|
| 449 | |
---|
| 450 | void CFile::recvAddField(CBufferIn& buffer) |
---|
| 451 | { |
---|
| 452 | string id ; |
---|
| 453 | buffer>>id ; |
---|
| 454 | addField(id) ; |
---|
| 455 | } |
---|
| 456 | |
---|
| 457 | void CFile::recvAddFieldGroup(CEventServer& event) |
---|
| 458 | { |
---|
| 459 | |
---|
| 460 | CBufferIn* buffer=event.subEvents.begin()->buffer; |
---|
| 461 | string id; |
---|
| 462 | *buffer>>id ; |
---|
| 463 | get(id)->recvAddFieldGroup(*buffer) ; |
---|
| 464 | } |
---|
| 465 | |
---|
| 466 | |
---|
| 467 | void CFile::recvAddFieldGroup(CBufferIn& buffer) |
---|
| 468 | { |
---|
| 469 | string id ; |
---|
| 470 | buffer>>id ; |
---|
| 471 | addFieldGroup(id) ; |
---|
| 472 | } |
---|
| 473 | |
---|
| 474 | |
---|
| 475 | bool CFile::dispatchEvent(CEventServer& event) |
---|
| 476 | { |
---|
| 477 | if (SuperClass::dispatchEvent(event)) return true ; |
---|
| 478 | else |
---|
| 479 | { |
---|
| 480 | switch(event.type) |
---|
| 481 | { |
---|
| 482 | case EVENT_ID_ADD_FIELD : |
---|
| 483 | recvAddField(event) ; |
---|
| 484 | return true ; |
---|
| 485 | break ; |
---|
| 486 | |
---|
| 487 | case EVENT_ID_ADD_FIELD_GROUP : |
---|
| 488 | recvAddFieldGroup(event) ; |
---|
| 489 | return true ; |
---|
| 490 | break ; |
---|
| 491 | |
---|
| 492 | default : |
---|
| 493 | ERROR("bool CFile::dispatchEvent(CEventServer& event)", <<"Unknown Event") ; |
---|
| 494 | return false ; |
---|
| 495 | } |
---|
| 496 | } |
---|
| 497 | } |
---|
| 498 | |
---|
| 499 | |
---|
| 500 | |
---|
| 501 | |
---|
[219] | 502 | ///--------------------------------------------------------------- |
---|
| 503 | |
---|
[335] | 504 | } // namespace xios |
---|