Changeset 771 for XIOS/trunk/src
- Timestamp:
- 10/30/15 16:33:49 (8 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/declare_ref_func.hpp
r770 r771 14 14 #define DECLARE_REF_FUNC(type, name_) \ 15 15 public: \ 16 void solveRefInheritance(bool apply = true); \ 17 void removeRefInheritance(); \ 16 18 bool hasDirect##type##Reference(void) const; \ 17 19 C##type* getDirect##type##Reference(void) const; \ 18 C##type* getBase##type##Reference(void) const; \19 void removeRefInheritance(); \20 const StdString& getBase##type##Id(void) const; \21 void solveRefInheritance(bool apply = true); \22 void solveBaseReference(void); \23 20 const StdString& get##type##OutputName(void) const; \ 24 \25 private: \26 C##type* baseRefObject; \27 21 28 22 // Definitions … … 57 51 } \ 58 52 \ 59 void C##type::solveBaseReference(void)\53 bool C##type::hasDirect##type##Reference(void) const \ 60 54 { \ 61 std::set<C##type*> refObjects; \ 62 baseRefObject = C##type::get(this); \ 63 \ 64 while (baseRefObject->hasDirect##type##Reference()) \ 65 { \ 66 refObjects.insert(baseRefObject); \ 67 \ 68 baseRefObject = baseRefObject->getDirect##type##Reference(); \ 69 \ 70 if (refObjects.end() != refObjects.find(baseRefObject)) \ 71 { \ 72 ERROR("void C" #type "::solveBaseReference(void)", \ 73 << "Circular dependency stopped for " #name_ " object " \ 74 << "with id = \"" << baseRefObject->getId() << "\"."); \ 75 } \ 76 } \ 55 return !this->name_##_ref.isEmpty(); \ 77 56 } \ 78 57 \ … … 80 59 { \ 81 60 if (this->name_##_ref.isEmpty()) \ 82 return this->getBase##type##Reference(); \ 61 ERROR("C" #type "* C" #type "::getDirect" #type "Reference(void)", \ 62 << "The " #name_ " with id = '" << getId() << "'" \ 63 << " has no " #name_ "_ref."); \ 83 64 \ 84 65 if (!C##type::has(this->name_##_ref)) \ … … 88 69 \ 89 70 return C##type::get(this->name_##_ref); \ 90 } \91 \92 C##type* C##type::getBase##type##Reference(void) const \93 { \94 return baseRefObject; \95 } \96 \97 const StdString& C##type::getBase##type##Id(void) const \98 { \99 return this->getBase##type##Reference()->getId(); \100 } \101 bool C##type::hasDirect##type##Reference(void) const \102 { \103 return !this->name_##_ref.isEmpty(); \104 71 } \ 105 72 \ -
XIOS/trunk/src/node/axis.cpp
r754 r771 23 23 CAxis::CAxis(void) 24 24 : CObjectTemplate<CAxis>() 25 , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(),areClientAttributesChecked_(false)25 , CAxisAttributes(), isChecked(false), relFiles(), areClientAttributesChecked_(false) 26 26 , isDistributed_(false), hasBounds_(false), isCompressible_(false) 27 27 , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) … … 32 32 CAxis::CAxis(const StdString & id) 33 33 : CObjectTemplate<CAxis>(id) 34 , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(),areClientAttributesChecked_(false)34 , CAxisAttributes(), isChecked(false), relFiles(), areClientAttributesChecked_(false) 35 35 , isDistributed_(false), hasBounds_(false), isCompressible_(false) 36 36 , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) -
XIOS/trunk/src/node/field.cpp
r770 r771 30 30 CField::CField(void) 31 31 : CObjectTemplate<CField>(), CFieldAttributes() 32 , baseRefObject()33 32 , grid(), file() 34 33 , written(false) … … 42 41 CField::CField(const StdString& id) 43 42 : CObjectTemplate<CField>(id), CFieldAttributes() 44 , baseRefObject()45 43 , grid(), file() 46 44 , written(false) … … 504 502 { 505 503 solveRefInheritance(true); 506 solveBaseReference();507 504 if (hasDirectFieldReference()) getDirectFieldReference()->solveAllReferenceEnabledField(false); 508 505 } -
XIOS/trunk/src/node/file.cpp
r770 r771 161 161 // Le champ est finalement actif, on y ajoute la référence au champ de base. 162 162 (*it)->setRelFile(CFile::get(this)); 163 // (*it)->baseRefObject->refObject.push_back(*it);164 // A faire, ajouter les references intermediaires...165 163 } 166 164 enabledFields = newEnabledFields; -
XIOS/trunk/src/node/grid.cpp
r764 r771 1221 1221 { 1222 1222 pDom->solveRefInheritance(apply); 1223 pDom->solveBaseReference();1224 1223 pDom->solveSrcInheritance(); 1225 1224 pDom->solveInheritanceTransformation(); … … 1235 1234 { 1236 1235 pAxis->solveRefInheritance(apply); 1237 pAxis->solveBaseReference();1238 1236 pAxis->solveInheritanceTransformation(); 1239 1237 }
Note: See TracChangeset
for help on using the changeset viewer.