23 typedef std::pair<StdString, CAttribute*> StdStrAttPair;
24 SuperClassMap::const_iterator it = SuperClassMap::begin(), end = SuperClassMap::end();
25 for (; it != end; it++)
27 const StdStrAttPair& att = *it;
40 typedef std::pair<StdString, CAttribute*> StdStrAttPair;
41 auto it = SuperClassMap::begin(), end = SuperClassMap::end();
42 for (; it != end; it++)
44 const StdStrAttPair& att = *it;
45 if (!att.second->isEmpty())
47 if (str.length() < maxNbChar)
49 str.append(att.second->dump());
52 else if (str.length() == maxNbChar)
82 ERROR(
"CAttributeMap::setAttribute(key, attr)",
83 <<
"[ key = " << key <<
"] key not found !");
85 ERROR(
"CAttributeMap::setAttribute(key, attr)",
86 <<
"[ key = " << key <<
"] attr is null !");
87 this->find(key)->second->set(*attr);
99 ERROR(
"CAttributeMap::operator[](const StdString& key)",
100 <<
"[ key = " << key <<
"] key not found !");
101 return SuperClassMap::operator[](key);
108 typedef std::pair<StdString, CAttribute*> StdStrAttPair;
111 SuperClassMap::const_iterator it = SuperClassMap::begin(), end = SuperClassMap::end();
112 for (; it != end; it++)
114 const StdStrAttPair& att = *it;
115 if (!att.second->isEmpty())
116 oss << *att.second <<
" ";
125 ERROR(
"CAttributeMap::fromString(const StdString& str)",
126 <<
"[ str = " << str <<
"] Not implemented yet !");
138 for (xml::THashAttributes::const_iterator it = attributes.begin();
139 it != attributes.end();
142 if ((*it).first.compare(
StdString(
"id")) != 0 && (*it).first.compare(
StdString(
"src")) != 0)
158 SuperClassMap::const_iterator itb = another.begin(), ite = another.end(), it;
159 for (it = itb; it !=ite; ++it)
161 bool excluded =
false;
162 for (
int idx = 0; idx < excludedAttrs.size(); ++idx)
164 if (0 == (*it).first.compare(excludedAttrs[idx]))
173 if ((*it).first.compare(
StdString(
"id")) != 0 && (*it).first.compare(
StdString(
"src")) != 0)
177 if (!((*it).second->isEqual(*(*
this)[it->first])))
205 typedef std::pair<StdString, CAttribute*> StdStrAttPair;
207 SuperClassMap::const_iterator it = _parent->begin(), end = _parent->end();
208 for (; it != end; it++)
210 const StdStrAttPair& el = *it;
234 typedef std::pair<StdString, CAttribute*> StdStrAttPair;
236 SuperClassMap::const_iterator it = srcAttr->begin(), end = srcAttr->end();
237 for (; it != end; it++)
239 const StdStrAttPair& el = *it;
242 if (!el.second->isEmpty())
312 SuperClassMap::const_iterator it = SuperClassMap::begin(), end = SuperClassMap::end();
313 for (; it != end; it++)
315 if (it->second->isPublic())
317 oss << std::endl <<
iendl;
318 it->second->generateCInterface(oss, className);
320 it->second->generateCInterfaceIsDefined(oss, className);
327 SuperClassMap::const_iterator it = SuperClassMap::begin(), end = SuperClassMap::end();
328 for (; it != end; it++)
330 if (it->second->isPublic())
332 oss << std::endl <<
iendl;
333 it->second->generateFortran2003Interface(oss, className);
335 it->second->generateFortran2003InterfaceIsDefined(oss, className);
344 oss <<
"SUBROUTINE xios(set_" << className <<
"_attr_hdl_) &" <<
iendl++;
345 SuperClassMap::const_iterator it;
346 SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
348 long startPos = oss.tellp();
350 oss <<
"( " << className <<
"_hdl";
351 for (it = begin; it != end; it++)
353 if (it->second->isPublic())
355 oss <<
", " << it->second->getName() <<
"_";
356 if (oss.tellp() - startPos > 90)
358 oss <<
" &" <<
iendl;
359 startPos = oss.tellp();
367 oss <<
"IMPLICIT NONE" << iendl++;
368 oss <<
"TYPE(txios(" << className <<
")) , INTENT(IN) :: " << className <<
"_hdl";
370 for (it = begin; it != end; it++)
372 if (it->second->isPublic())
375 it->second->generateFortranInterfaceDeclaration_(oss, className);
379 for (it = begin; it != end; it++)
381 if (it->second->isPublic())
383 oss << std::endl <<
iendl;
384 it->second->generateFortranInterfaceBody_(oss, className);
388 oss << std::endl << (iendl -= 2);
389 oss <<
"END SUBROUTINE xios(set_" << className <<
"_attr_hdl_)" << std::endl;
394 oss <<
"SUBROUTINE xios(get_" << className <<
"_attr_hdl_) &" <<
iendl++;
395 SuperClassMap::const_iterator it;
396 SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
398 long startPos = oss.tellp();
400 oss <<
"( " << className <<
"_hdl";
401 for (it = begin; it != end; it++)
403 if (it->second->isPublic())
405 oss <<
", " << it->second->getName() <<
"_";
406 if (oss.tellp() - startPos > 90)
408 oss <<
" &" <<
iendl;
409 startPos = oss.tellp();
417 oss <<
"IMPLICIT NONE" << iendl++;
418 oss <<
"TYPE(txios(" << className <<
")) , INTENT(IN) :: " << className <<
"_hdl";
420 for (it = begin; it != end; it++)
422 if (it->second->isPublic())
425 it->second->generateFortranInterfaceGetDeclaration_(oss, className);
429 for (it = begin; it != end; it++)
431 if (it->second->isPublic())
433 oss << std::endl <<
iendl;
434 it->second->generateFortranInterfaceGetBody_(oss, className);
438 oss << std::endl << (iendl -= 2);
439 oss <<
"END SUBROUTINE xios(get_" << className <<
"_attr_hdl_)" << std::endl;
444 oss <<
"SUBROUTINE xios(is_defined_" << className <<
"_attr_hdl_) &" <<
iendl++;
445 SuperClassMap::const_iterator it;
446 SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
448 long startPos = oss.tellp();
450 oss <<
"( " << className <<
"_hdl";
451 for (it = begin; it != end; it++)
453 if (it->second->isPublic())
455 oss <<
", " << it->second->getName() <<
"_";
456 if (oss.tellp() - startPos > 90)
458 oss <<
" &" <<
iendl;
459 startPos = oss.tellp();
467 oss <<
"IMPLICIT NONE" << iendl++;
468 oss <<
"TYPE(txios(" << className <<
")) , INTENT(IN) :: " << className <<
"_hdl";
470 for (it = begin; it != end; it++)
472 if (it->second->isPublic())
475 it->second->generateFortranInterfaceIsDefinedDeclaration_(oss, className);
479 for (it = begin; it != end; it++)
481 if (it->second->isPublic())
483 oss << std::endl <<
iendl;
484 it->second->generateFortranInterfaceIsDefinedBody_(oss, className);
488 oss << std::endl << (iendl -= 2);
489 oss <<
"END SUBROUTINE xios(is_defined_" << className <<
"_attr_hdl_)" << std::endl;
494 oss <<
"SUBROUTINE xios(set_" << className <<
"_attr_hdl) &" <<
iendl++;
495 SuperClassMap::const_iterator it;
496 SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
498 long startPos = oss.tellp();
500 oss <<
"( " << className <<
"_hdl";
501 for (it = begin; it != end; it++)
503 if (it->second->isPublic())
505 oss <<
", " << it->second->getName();
506 if (oss.tellp() - startPos > 90)
508 oss <<
" &" <<
iendl;
509 startPos = oss.tellp();
517 oss <<
"IMPLICIT NONE" << iendl++;
518 oss <<
"TYPE(txios(" << className <<
")) , INTENT(IN) :: " << className <<
"_hdl";
520 for (it = begin; it != end; it++)
522 if (it->second->isPublic())
525 it->second->generateFortranInterfaceDeclaration(oss, className);
529 oss << std::endl <<
iendl;
531 oss <<
"CALL xios(set_" << className <<
"_attr_hdl_) &" <<
iendl;
533 startPos = oss.tellp();
535 oss <<
"( " << className <<
"_hdl";
536 for (it = begin; it != end; it++)
538 if (it->second->isPublic())
540 oss <<
", " << it->second->getName();
541 if (oss.tellp() - startPos > 90)
543 oss <<
" &" <<
iendl;
544 startPos = oss.tellp();
550 oss << std::endl << (iendl -= 2);
551 oss <<
"END SUBROUTINE xios(set_" << className <<
"_attr_hdl)" << std::endl;
556 oss <<
"SUBROUTINE xios(get_" << className <<
"_attr_hdl) &" <<
iendl++;
557 SuperClassMap::const_iterator it;
558 SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
560 long startPos = oss.tellp();
562 oss <<
"( " << className <<
"_hdl";
563 for (it = begin; it != end; it++)
565 if (it->second->isPublic())
567 oss <<
", " << it->second->getName();
568 if (oss.tellp() - startPos > 90)
570 oss <<
" &" <<
iendl;
571 startPos = oss.tellp();
579 oss <<
"IMPLICIT NONE" << iendl++;
580 oss <<
"TYPE(txios(" << className <<
")) , INTENT(IN) :: " << className <<
"_hdl";
582 for (it = begin; it != end; it++)
584 if (it->second->isPublic())
587 it->second->generateFortranInterfaceGetDeclaration(oss, className);
591 oss << std::endl <<
iendl;
593 oss <<
"CALL xios(get_" << className <<
"_attr_hdl_) &" <<
iendl;
595 startPos = oss.tellp();
597 oss <<
"( " << className <<
"_hdl";
598 for (it = begin; it != end; it++)
600 if (it->second->isPublic())
602 oss <<
", " << it->second->getName();
603 if (oss.tellp() - startPos > 90)
605 oss <<
" &" <<
iendl;
606 startPos = oss.tellp();
612 oss << std::endl << (iendl -= 2);
613 oss <<
"END SUBROUTINE xios(get_" << className <<
"_attr_hdl)" << std::endl;
618 oss <<
"SUBROUTINE xios(is_defined_" << className <<
"_attr_hdl) &" <<
iendl++;
619 SuperClassMap::const_iterator it;
620 SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
622 long startPos = oss.tellp();
624 oss <<
"( " << className <<
"_hdl";
625 for (it = begin; it != end; it++)
627 if (it->second->isPublic())
629 oss <<
", " << it->second->getName();
630 if (oss.tellp() - startPos > 90)
632 oss <<
" &" <<
iendl;
633 startPos = oss.tellp();
641 oss <<
"IMPLICIT NONE" << iendl++;
642 oss <<
"TYPE(txios(" << className <<
")) , INTENT(IN) :: " << className <<
"_hdl";
644 for (it = begin; it != end; it++)
646 if (it->second->isPublic())
649 it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className);
653 oss << std::endl <<
iendl;
655 oss <<
"CALL xios(is_defined_" << className <<
"_attr_hdl_) &" <<
iendl;
657 startPos = oss.tellp();
659 oss <<
"( " << className <<
"_hdl";
660 for (it = begin; it != end; it++)
662 if (it->second->isPublic())
664 oss <<
", " << it->second->getName();
665 if (oss.tellp() - startPos > 90)
667 oss <<
" &" <<
iendl;
668 startPos = oss.tellp();
674 oss << std::endl << (iendl -= 2);
675 oss <<
"END SUBROUTINE xios(is_defined_" << className <<
"_attr_hdl)" << std::endl;
680 oss <<
"SUBROUTINE xios(set_" << className <<
"_attr) &" <<
iendl++;
681 SuperClassMap::const_iterator it;
682 SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
684 long startPos = oss.tellp();
686 oss <<
"( " << className <<
"_id";
687 for (it = begin; it != end; it++)
689 if (it->second->isPublic())
691 oss <<
", " << it->second->getName();
692 if (oss.tellp() - startPos > 90)
694 oss <<
" &" <<
iendl;
695 startPos = oss.tellp();
703 oss <<
"IMPLICIT NONE" << iendl++;
705 oss <<
"TYPE(txios(" << className <<
")) :: " << className <<
"_hdl" <<
iendl;
706 oss <<
"CHARACTER(LEN=*), INTENT(IN) ::" << className <<
"_id";
708 for (it = begin; it != end; it++)
710 if (it->second->isPublic())
713 it->second->generateFortranInterfaceDeclaration(oss, className);
717 oss << std::endl <<
iendl;
718 oss <<
"CALL xios(get_" << className <<
"_handle) &" <<
iendl;
719 oss <<
"(" << className <<
"_id," << className <<
"_hdl)" <<
iendl;
720 oss <<
"CALL xios(set_" << className <<
"_attr_hdl_) &" <<
iendl;
722 startPos = oss.tellp();
724 oss <<
"( " << className <<
"_hdl";
725 for (it = begin; it != end; it++)
727 if (it->second->isPublic())
729 oss <<
", " << it->second->getName();
730 if (oss.tellp() - startPos > 90)
732 oss <<
" &" <<
iendl;
733 startPos = oss.tellp();
739 oss << std::endl << (iendl -= 2);
740 oss <<
"END SUBROUTINE xios(set_" << className <<
"_attr)" << std::endl;
745 oss <<
"SUBROUTINE xios(get_" << className <<
"_attr) &" <<
iendl++;
746 SuperClassMap::const_iterator it;
747 SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
749 long startPos = oss.tellp();
751 oss <<
"( " << className <<
"_id";
752 for (it = begin; it != end; it++)
754 if (it->second->isPublic())
756 oss <<
", " << it->second->getName();
757 if (oss.tellp() - startPos > 90)
759 oss <<
" &" <<
iendl;
760 startPos = oss.tellp();
768 oss <<
"IMPLICIT NONE" << iendl++;
770 oss <<
"TYPE(txios(" << className <<
")) :: " << className <<
"_hdl" <<
iendl;
771 oss <<
"CHARACTER(LEN=*), INTENT(IN) ::" << className <<
"_id";
773 for (it = begin; it != end; it++)
775 if (it->second->isPublic())
778 it->second->generateFortranInterfaceGetDeclaration(oss, className);
782 oss << std::endl <<
iendl;
783 oss <<
"CALL xios(get_" << className <<
"_handle) &" <<
iendl;
784 oss <<
"(" << className <<
"_id," << className <<
"_hdl)" <<
iendl;
785 oss <<
"CALL xios(get_" << className <<
"_attr_hdl_) &" <<
iendl;
787 startPos = oss.tellp();
789 oss <<
"( " << className <<
"_hdl";
790 for (it = begin; it != end; it++)
792 if (it->second->isPublic())
794 oss <<
", " << it->second->getName();
795 if (oss.tellp() - startPos > 90)
797 oss <<
" &" <<
iendl;
798 startPos = oss.tellp();
804 oss << std::endl << (iendl -= 2);
805 oss <<
"END SUBROUTINE xios(get_" << className <<
"_attr)" << std::endl;
810 oss <<
"SUBROUTINE xios(is_defined_" << className <<
"_attr) &" <<
iendl++;
811 SuperClassMap::const_iterator it;
812 SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end();
814 long startPos = oss.tellp();
816 oss <<
"( " << className <<
"_id";
817 for (it = begin; it != end; it++)
819 if (it->second->isPublic())
821 oss <<
", " << it->second->getName();
822 if (oss.tellp() - startPos > 90)
824 oss <<
" &" <<
iendl;
825 startPos = oss.tellp();
833 oss <<
"IMPLICIT NONE" << iendl++;
835 oss <<
"TYPE(txios(" << className <<
")) :: " << className <<
"_hdl" <<
iendl;
836 oss <<
"CHARACTER(LEN=*), INTENT(IN) ::" << className <<
"_id";
838 for (it = begin; it != end; it++)
840 if (it->second->isPublic())
843 it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className);
847 oss << std::endl <<
iendl;
848 oss <<
"CALL xios(get_" << className <<
"_handle) &" <<
iendl;
849 oss <<
"(" << className <<
"_id," << className <<
"_hdl)" <<
iendl;
850 oss <<
"CALL xios(is_defined_" << className <<
"_attr_hdl_) &" <<
iendl;
852 startPos = oss.tellp();
854 oss <<
"( " << className <<
"_hdl";
855 for (it = begin; it != end; it++)
857 if (it->second->isPublic())
859 oss <<
", " << it->second->getName();
860 if (oss.tellp() - startPos > 90)
862 oss <<
" &" <<
iendl;
863 startPos = oss.tellp();
869 oss << std::endl << (iendl -= 2);
870 oss <<
"END SUBROUTINE xios(is_defined_" << className <<
"_attr)" << std::endl;
virtual bool isEmpty(void) const =0
void setAttributes(const xml::THashAttributes &attributes)
virtual void generateCInterface(ostream &oss, const string &className)
virtual void generateFortranInterfaceGet_hdl(ostream &oss, const string &className)
bool isEqual(const CAttributeMap &another, const vector< StdString > &excludedAttrs)
Compare two attribute maps.
virtual void setInheritedValue(const CAttribute &)=0
#define xios_map
standard C++ headers ///
virtual void generateFortranInterfaceIsDefined_hdl(ostream &oss, const string &className)
virtual ~CAttributeMap(void)
Destructeur ///.
virtual void generateFortranInterfaceGet_id(ostream &oss, const string &className)
virtual void generateFortranInterface_hdl_(ostream &oss, const string &className)
virtual void generateFortranInterface_hdl(ostream &oss, const string &className)
virtual void generateFortran2003Interface(ostream &oss, const string &className)
////////////////////// Déclarations ////////////////////// ///
virtual void generateFortranInterfaceGet_hdl_(ostream &oss, const string &className)
static CAttributeMap * Current
Propriété statique ///.
StdString dumpXiosAttributes(void) const
CATCH CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar *scalarDestination, CScalar *scalarSource, CReduceScalarToScalar *algo ERROR)("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)",<< "Operation must be defined."<< "Scalar source "<< scalarSource->getId()<< std::endl<< "Scalar destination "<< scalarDestination->getId())
std::map< StdString, StdString > THashAttributes
////////////////////// Déclarations ////////////////////// ///
void setAttribute(const StdString &key, CAttribute *const attr)
Mutateurs ///.
virtual void fromString(const StdString &str)=0
void clearAttribute(const StdString &key)
virtual void generateFortranInterfaceIsDefined_id(ostream &oss, const string &className)
virtual StdString toString(void) const
Flux ///.
virtual void fromString(const StdString &str)
virtual void generateFortranInterfaceIsDefined_hdl_(ostream &oss, const string &className)
void clearAllAttributes(void)
CAttribute * operator[](const StdString &key)
Accesseurs ///.
CAttributeMap(void)
Constructeurs ///.
////////////////////// Déclarations ////////////////////// ///
std::ostringstream StdOStringStream
Définition de types (issus de la bibliothèque standard)///.
void duplicateAttributes(const CAttributeMap *const _parent)
Duplicate attribute map with a specific attribute map.
virtual void generateFortranInterface_id(ostream &oss, const string &className)
bool hasAttribute(const StdString &key) const
Tests ///.