Changeset 770 for XIOS/trunk/src/declare_ref_func.hpp
- Timestamp:
- 10/30/15 16:33:48 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/declare_ref_func.hpp
r768 r770 12 12 // Declarations 13 13 14 #define DECLARE_REF_FUNC(type, name )\14 #define DECLARE_REF_FUNC(type, name_) \ 15 15 public: \ 16 16 bool hasDirect##type##Reference(void) const; \ … … 21 21 void solveRefInheritance(bool apply = true); \ 22 22 void solveBaseReference(void); \ 23 const StdString& get##type##OutputName(void) const; \ 23 24 \ 24 25 private: \ … … 27 28 // Definitions 28 29 29 #define DEFINE_REF_FUNC(type, name )\30 #define DEFINE_REF_FUNC(type, name_) \ 30 31 void C##type::solveRefInheritance(bool apply) \ 31 32 { \ … … 42 43 { \ 43 44 ERROR("void C" #type "::solveRefInheritance(bool apply)", \ 44 << "Circular dependency stopped for " #name " object "\45 << "Circular dependency stopped for " #name_ " object " \ 45 46 << "with id = \"" << refer_ptr->getId() << "\"."); \ 46 47 } \ … … 52 53 void C##type::removeRefInheritance() \ 53 54 { \ 54 if (!this->name ##_ref.isEmpty())\55 this->name ##_ref.reset();\55 if (!this->name_##_ref.isEmpty()) \ 56 this->name_##_ref.reset(); \ 56 57 } \ 57 58 \ … … 70 71 { \ 71 72 ERROR("void C" #type "::solveBaseReference(void)", \ 72 << "Circular dependency stopped for " #name " object "\73 << "Circular dependency stopped for " #name_ " object " \ 73 74 << "with id = \"" << baseRefObject->getId() << "\"."); \ 74 75 } \ … … 78 79 C##type* C##type::getDirect##type##Reference(void) const \ 79 80 { \ 80 if (this->name ##_ref.isEmpty())\81 if (this->name_##_ref.isEmpty()) \ 81 82 return this->getBase##type##Reference(); \ 82 83 \ 83 if (!C##type::has(this->name ##_ref))\84 if (!C##type::has(this->name_##_ref)) \ 84 85 ERROR("C" #type "* C" #type "::getDirect" #type "Reference(void)", \ 85 << this->name ##_ref\86 << " refers to an unknown " #name " id.");\86 << this->name_##_ref \ 87 << " refers to an unknown " #name_ " id."); \ 87 88 \ 88 return C##type::get(this->name ##_ref);\89 return C##type::get(this->name_##_ref); \ 89 90 } \ 90 91 \ … … 98 99 return this->getBase##type##Reference()->getId(); \ 99 100 } \ 100 \101 101 bool C##type::hasDirect##type##Reference(void) const \ 102 102 { \ 103 return !this->name##_ref.isEmpty(); \ 103 return !this->name_##_ref.isEmpty(); \ 104 } \ 105 \ 106 const StdString& C##type::get##type##OutputName(void) const \ 107 { \ 108 if (!this->name.isEmpty()) \ 109 return this->name; \ 110 else if (hasAutoGeneratedId() && hasDirect##type##Reference()) \ 111 return this->name_##_ref; \ 112 else \ 113 return getId(); \ 104 114 } \ 105 115
Note: See TracChangeset
for help on using the changeset viewer.