aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenji Hosokawa <khosokawa@jp.adit-jv.com>2020-08-24 21:58:42 +0900
committerKenji Hosokawa <khosokawa@jp.adit-jv.com>2020-08-24 21:58:42 +0900
commit2b4ae7fde370bc3316ab30cc38b74d23e785b360 (patch)
tree41b6eb70b3419c2fbd192ed133c5890a985eddec /src
parent6694a4d2952ebd171564932200cac00d6e5792f4 (diff)
Signed-off-by: Kenji Hosokawa <khosokawa@jp.adit-jv.com> Change-Id: I381abb0a6521f5349768a76ef7ceecbce4b2d701
Diffstat (limited to 'src')
-rw-r--r--src/BUILD.md75
-rw-r--r--src/CMakeLists.txt109
-rw-r--r--src/CMakeSettings.json56
-rw-r--r--src/LICENSE180
-rw-r--r--src/README.md4
-rw-r--r--src/core/expression/RBAActionOperator.cpp35
-rw-r--r--src/core/expression/RBAActionOperator.hpp48
-rw-r--r--src/core/expression/RBAActiveContents.cpp108
-rw-r--r--src/core/expression/RBAActiveContents.hpp54
-rw-r--r--src/core/expression/RBAActiveContentsMaker.cpp38
-rw-r--r--src/core/expression/RBAActiveContentsMaker.hpp50
-rw-r--r--src/core/expression/RBAActiveState.cpp83
-rw-r--r--src/core/expression/RBAActiveState.hpp50
-rw-r--r--src/core/expression/RBAActiveStateMaker.cpp37
-rw-r--r--src/core/expression/RBAActiveStateMaker.hpp50
-rw-r--r--src/core/expression/RBAAllocatableOperator.cpp39
-rw-r--r--src/core/expression/RBAAllocatableOperator.hpp49
-rw-r--r--src/core/expression/RBAAllocatedContent.cpp118
-rw-r--r--src/core/expression/RBAAllocatedContent.hpp54
-rw-r--r--src/core/expression/RBAAllocatedContentMaker.cpp37
-rw-r--r--src/core/expression/RBAAllocatedContentMaker.hpp49
-rw-r--r--src/core/expression/RBAAndOperator.cpp113
-rw-r--r--src/core/expression/RBAAndOperator.hpp53
-rw-r--r--src/core/expression/RBAAndOperatorMaker.cpp37
-rw-r--r--src/core/expression/RBAAndOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBAArithmeticOperator.cpp26
-rw-r--r--src/core/expression/RBAArithmeticOperator.hpp42
-rw-r--r--src/core/expression/RBAContentOperator.cpp40
-rw-r--r--src/core/expression/RBAContentOperator.hpp49
-rw-r--r--src/core/expression/RBAContentValue.cpp116
-rw-r--r--src/core/expression/RBAContentValue.hpp54
-rw-r--r--src/core/expression/RBAContentValueMaker.cpp38
-rw-r--r--src/core/expression/RBAContentValueMaker.hpp49
-rw-r--r--src/core/expression/RBAExecuteResult.hpp40
-rw-r--r--src/core/expression/RBAExistsOperator.cpp175
-rw-r--r--src/core/expression/RBAExistsOperator.hpp56
-rw-r--r--src/core/expression/RBAExistsOperatorMaker.cpp58
-rw-r--r--src/core/expression/RBAExistsOperatorMaker.hpp63
-rw-r--r--src/core/expression/RBAExpression.cpp156
-rw-r--r--src/core/expression/RBAExpression.hpp91
-rw-r--r--src/core/expression/RBAExpressionMaker.cpp55
-rw-r--r--src/core/expression/RBAExpressionMaker.hpp57
-rw-r--r--src/core/expression/RBAExpressionType.hpp56
-rw-r--r--src/core/expression/RBAExpressionVisitor.hpp168
-rw-r--r--src/core/expression/RBAForAllOperator.cpp173
-rw-r--r--src/core/expression/RBAForAllOperator.hpp56
-rw-r--r--src/core/expression/RBAForAllOperatorMaker.cpp58
-rw-r--r--src/core/expression/RBAForAllOperatorMaker.hpp63
-rw-r--r--src/core/expression/RBAGetAllocatables.cpp95
-rw-r--r--src/core/expression/RBAGetAllocatables.hpp56
-rw-r--r--src/core/expression/RBAGetAllocatablesMaker.cpp37
-rw-r--r--src/core/expression/RBAGetAllocatablesMaker.hpp49
-rw-r--r--src/core/expression/RBAGetContentsList.cpp86
-rw-r--r--src/core/expression/RBAGetContentsList.hpp54
-rw-r--r--src/core/expression/RBAGetContentsListMaker.cpp37
-rw-r--r--src/core/expression/RBAGetContentsListMaker.hpp49
-rw-r--r--src/core/expression/RBAGetProperty.cpp101
-rw-r--r--src/core/expression/RBAGetProperty.hpp57
-rw-r--r--src/core/expression/RBAGetPropertyMaker.cpp37
-rw-r--r--src/core/expression/RBAGetPropertyMaker.hpp49
-rw-r--r--src/core/expression/RBAHasBeenDisplayed.cpp102
-rw-r--r--src/core/expression/RBAHasBeenDisplayed.hpp52
-rw-r--r--src/core/expression/RBAHasBeenDisplayedMaker.cpp37
-rw-r--r--src/core/expression/RBAHasBeenDisplayedMaker.hpp49
-rw-r--r--src/core/expression/RBAHasComeEarlierThan.cpp151
-rw-r--r--src/core/expression/RBAHasComeEarlierThan.hpp56
-rw-r--r--src/core/expression/RBAHasComeEarlierThanMaker.cpp37
-rw-r--r--src/core/expression/RBAHasComeEarlierThanMaker.hpp49
-rw-r--r--src/core/expression/RBAHasComeLaterThan.cpp153
-rw-r--r--src/core/expression/RBAHasComeLaterThan.hpp55
-rw-r--r--src/core/expression/RBAHasComeLaterThanMaker.cpp37
-rw-r--r--src/core/expression/RBAHasComeLaterThanMaker.hpp49
-rw-r--r--src/core/expression/RBAIfStatement.cpp268
-rw-r--r--src/core/expression/RBAIfStatement.hpp73
-rw-r--r--src/core/expression/RBAIfStatementMaker.cpp78
-rw-r--r--src/core/expression/RBAIfStatementMaker.hpp58
-rw-r--r--src/core/expression/RBAImpliesOperator.cpp145
-rw-r--r--src/core/expression/RBAImpliesOperator.hpp54
-rw-r--r--src/core/expression/RBAImpliesOperatorMaker.cpp37
-rw-r--r--src/core/expression/RBAImpliesOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBAIntegerValue.cpp79
-rw-r--r--src/core/expression/RBAIntegerValue.hpp62
-rw-r--r--src/core/expression/RBAIntegerValueMaker.cpp64
-rw-r--r--src/core/expression/RBAIntegerValueMaker.hpp58
-rw-r--r--src/core/expression/RBAIsActive.cpp113
-rw-r--r--src/core/expression/RBAIsActive.hpp54
-rw-r--r--src/core/expression/RBAIsActiveMaker.cpp37
-rw-r--r--src/core/expression/RBAIsActiveMaker.hpp49
-rw-r--r--src/core/expression/RBAIsEqualToOperator.cpp105
-rw-r--r--src/core/expression/RBAIsEqualToOperator.hpp52
-rw-r--r--src/core/expression/RBAIsEqualToOperatorMaker.cpp37
-rw-r--r--src/core/expression/RBAIsEqualToOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBAIsGreaterThanEqualOperator.cpp105
-rw-r--r--src/core/expression/RBAIsGreaterThanEqualOperator.hpp52
-rw-r--r--src/core/expression/RBAIsGreaterThanEqualOperatorMaker.cpp37
-rw-r--r--src/core/expression/RBAIsGreaterThanEqualOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBAIsGreaterThanOperator.cpp105
-rw-r--r--src/core/expression/RBAIsGreaterThanOperator.hpp52
-rw-r--r--src/core/expression/RBAIsGreaterThanOperatorMaker.cpp37
-rw-r--r--src/core/expression/RBAIsGreaterThanOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBAIsLowerThanEqualOperator.cpp106
-rw-r--r--src/core/expression/RBAIsLowerThanEqualOperator.hpp52
-rw-r--r--src/core/expression/RBAIsLowerThanEqualOperatorMaker.cpp37
-rw-r--r--src/core/expression/RBAIsLowerThanEqualOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBAIsLowerThanOperator.cpp105
-rw-r--r--src/core/expression/RBAIsLowerThanOperator.hpp52
-rw-r--r--src/core/expression/RBAIsLowerThanOperatorMaker.cpp36
-rw-r--r--src/core/expression/RBAIsLowerThanOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBAIsOn.cpp132
-rw-r--r--src/core/expression/RBAIsOn.hpp56
-rw-r--r--src/core/expression/RBAIsOnMaker.cpp37
-rw-r--r--src/core/expression/RBAIsOnMaker.hpp50
-rw-r--r--src/core/expression/RBAIsTypeOfOperator.cpp102
-rw-r--r--src/core/expression/RBAIsTypeOfOperator.hpp66
-rw-r--r--src/core/expression/RBAIsTypeOfOperatorMaker.cpp70
-rw-r--r--src/core/expression/RBAIsTypeOfOperatorMaker.hpp58
-rw-r--r--src/core/expression/RBALambdaContext.cpp92
-rw-r--r--src/core/expression/RBALambdaContext.hpp57
-rw-r--r--src/core/expression/RBALambdaContextMaker.cpp65
-rw-r--r--src/core/expression/RBALambdaContextMaker.hpp60
-rw-r--r--src/core/expression/RBALambdaExpression.cpp139
-rw-r--r--src/core/expression/RBALambdaExpression.hpp77
-rw-r--r--src/core/expression/RBALambdaExpressionMaker.cpp75
-rw-r--r--src/core/expression/RBALambdaExpressionMaker.hpp58
-rw-r--r--src/core/expression/RBALetStatement.cpp68
-rw-r--r--src/core/expression/RBALetStatement.hpp54
-rw-r--r--src/core/expression/RBALetStatementMaker.cpp67
-rw-r--r--src/core/expression/RBALetStatementMaker.hpp58
-rw-r--r--src/core/expression/RBALogicalOperator.cpp73
-rw-r--r--src/core/expression/RBALogicalOperator.hpp50
-rw-r--r--src/core/expression/RBAMaxOperator.cpp135
-rw-r--r--src/core/expression/RBAMaxOperator.hpp53
-rw-r--r--src/core/expression/RBAMaxOperatorMaker.cpp60
-rw-r--r--src/core/expression/RBAMaxOperatorMaker.hpp63
-rw-r--r--src/core/expression/RBAMemberFeatureReferenceMaker.cpp94
-rw-r--r--src/core/expression/RBAMemberFeatureReferenceMaker.hpp62
-rw-r--r--src/core/expression/RBAMinOperator.cpp135
-rw-r--r--src/core/expression/RBAMinOperator.hpp51
-rw-r--r--src/core/expression/RBAMinOperatorMaker.cpp60
-rw-r--r--src/core/expression/RBAMinOperatorMaker.hpp63
-rw-r--r--src/core/expression/RBANotOperator.cpp99
-rw-r--r--src/core/expression/RBANotOperator.hpp55
-rw-r--r--src/core/expression/RBANotOperatorMaker.cpp37
-rw-r--r--src/core/expression/RBANotOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBAObjectCompare.cpp165
-rw-r--r--src/core/expression/RBAObjectCompare.hpp57
-rw-r--r--src/core/expression/RBAObjectCompareMaker.cpp37
-rw-r--r--src/core/expression/RBAObjectCompareMaker.hpp49
-rw-r--r--src/core/expression/RBAObjectReference.cpp133
-rw-r--r--src/core/expression/RBAObjectReference.hpp63
-rw-r--r--src/core/expression/RBAObjectReferenceMaker.cpp77
-rw-r--r--src/core/expression/RBAObjectReferenceMaker.hpp58
-rw-r--r--src/core/expression/RBAOperator.cpp99
-rw-r--r--src/core/expression/RBAOperator.hpp67
-rw-r--r--src/core/expression/RBAOperatorMaker.cpp61
-rw-r--r--src/core/expression/RBAOperatorMaker.hpp53
-rw-r--r--src/core/expression/RBAOrOperator.cpp100
-rw-r--r--src/core/expression/RBAOrOperator.hpp53
-rw-r--r--src/core/expression/RBAOrOperatorMaker.cpp37
-rw-r--r--src/core/expression/RBAOrOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBAPlusOperator.cpp33
-rw-r--r--src/core/expression/RBAPlusOperator.hpp46
-rw-r--r--src/core/expression/RBAPlusOperatorMaker.cpp37
-rw-r--r--src/core/expression/RBAPlusOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBAPreviousModifier.cpp97
-rw-r--r--src/core/expression/RBAPreviousModifier.hpp75
-rw-r--r--src/core/expression/RBAPreviousModifierMaker.cpp67
-rw-r--r--src/core/expression/RBAPreviousModifierMaker.hpp58
-rw-r--r--src/core/expression/RBAPreviousObjectWrapper.cpp45
-rw-r--r--src/core/expression/RBAPreviousObjectWrapper.hpp52
-rw-r--r--src/core/expression/RBAPropertyOperator.hpp46
-rw-r--r--src/core/expression/RBASceneCondition.hpp44
-rw-r--r--src/core/expression/RBASceneOperator.hpp45
-rw-r--r--src/core/expression/RBASelectOperator.cpp140
-rw-r--r--src/core/expression/RBASelectOperator.hpp59
-rw-r--r--src/core/expression/RBASelectOperatorMaker.cpp60
-rw-r--r--src/core/expression/RBASelectOperatorMaker.hpp63
-rw-r--r--src/core/expression/RBASetExpression.hpp44
-rw-r--r--src/core/expression/RBASetOfOperator.cpp194
-rw-r--r--src/core/expression/RBASetOfOperator.hpp73
-rw-r--r--src/core/expression/RBASetOfOperatorMaker.cpp39
-rw-r--r--src/core/expression/RBASetOfOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBASetOperator.hpp44
-rw-r--r--src/core/expression/RBASizeOperator.cpp84
-rw-r--r--src/core/expression/RBASizeOperator.hpp51
-rw-r--r--src/core/expression/RBASizeOperatorMaker.cpp37
-rw-r--r--src/core/expression/RBASizeOperatorMaker.hpp49
-rw-r--r--src/core/expression/RBAStateValue.cpp107
-rw-r--r--src/core/expression/RBAStateValue.hpp53
-rw-r--r--src/core/expression/RBAStateValueMaker.cpp37
-rw-r--r--src/core/expression/RBAStateValueMaker.hpp49
-rw-r--r--src/core/expression/RBAValueExpression.hpp44
-rw-r--r--src/core/expression/RBAVariable.cpp79
-rw-r--r--src/core/expression/RBAVariable.hpp65
-rw-r--r--src/core/expression/RBAVariableMaker.cpp64
-rw-r--r--src/core/expression/RBAVariableMaker.hpp70
-rw-r--r--src/core/logic/RBAAffectInfo.cpp67
-rw-r--r--src/core/logic/RBAAffectInfo.hpp58
-rw-r--r--src/core/logic/RBAArbitrator.cpp1987
-rw-r--r--src/core/logic/RBABackUpAllocatable.cpp33
-rw-r--r--src/core/logic/RBABackUpAllocatable.hpp42
-rw-r--r--src/core/logic/RBACommonMakerTable.cpp126
-rw-r--r--src/core/logic/RBACommonMakerTable.hpp52
-rw-r--r--src/core/logic/RBAConstraintInfo.cpp695
-rw-r--r--src/core/logic/RBAConstraintInfo.hpp119
-rw-r--r--src/core/logic/RBAConstraintMap.hpp38
-rw-r--r--src/core/logic/RBAContentStatus.cpp72
-rw-r--r--src/core/logic/RBAContentStatus.hpp58
-rw-r--r--src/core/logic/RBARequest.cpp44
-rw-r--r--src/core/logic/RBARequest.hpp59
-rw-r--r--src/core/logic/RBARequestQueMember.cpp48
-rw-r--r--src/core/logic/RBARequestQueMember.hpp64
-rw-r--r--src/core/logic/RBAResultImpl.cpp1088
-rw-r--r--src/core/logic/RBAResultImpl.hpp343
-rw-r--r--src/core/logic/RBAResultSet.cpp996
-rw-r--r--src/core/logic/RBAResultSet.hpp246
-rw-r--r--src/core/logic/RBARollbacker.cpp95
-rw-r--r--src/core/logic/RBARollbacker.hpp84
-rw-r--r--src/core/logic/RBAViewAction.cpp88
-rw-r--r--src/core/logic/RBAViewMove.cpp89
-rw-r--r--src/core/logic/RBAViewMove.hpp62
-rw-r--r--src/core/logic/RBAViewTransition.cpp137
-rw-r--r--src/core/logic/RBAViewTransition.hpp64
-rw-r--r--src/core/model/RBAAbstractAllocatable.cpp56
-rw-r--r--src/core/model/RBAAbstractAllocatable.hpp65
-rw-r--r--src/core/model/RBAAbstractAllocatableMaker.cpp52
-rw-r--r--src/core/model/RBAAbstractAllocatableMaker.hpp53
-rw-r--r--src/core/model/RBAAbstractConstraint.cpp81
-rw-r--r--src/core/model/RBAAbstractConstraint.hpp71
-rw-r--r--src/core/model/RBAAbstractConstraintMaker.cpp52
-rw-r--r--src/core/model/RBAAbstractConstraintMaker.hpp54
-rw-r--r--src/core/model/RBAAbstractContent.cpp31
-rw-r--r--src/core/model/RBAAbstractContent.hpp45
-rw-r--r--src/core/model/RBAAbstractContentMaker.cpp53
-rw-r--r--src/core/model/RBAAbstractContentMaker.hpp53
-rw-r--r--src/core/model/RBAAbstractProperty.cpp46
-rw-r--r--src/core/model/RBAAbstractProperty.hpp61
-rw-r--r--src/core/model/RBAAllocatable.cpp387
-rw-r--r--src/core/model/RBAAllocatable.hpp131
-rw-r--r--src/core/model/RBAAllocatableMaker.cpp82
-rw-r--r--src/core/model/RBAAllocatableMaker.hpp54
-rw-r--r--src/core/model/RBAAllocatableSet.cpp65
-rw-r--r--src/core/model/RBAAllocatableSet.hpp59
-rw-r--r--src/core/model/RBAAllocatableSetMaker.cpp57
-rw-r--r--src/core/model/RBAAllocatableSetMaker.hpp53
-rw-r--r--src/core/model/RBAConstraint.hpp45
-rw-r--r--src/core/model/RBAConstraintImpl.cpp96
-rw-r--r--src/core/model/RBAConstraintImpl.hpp56
-rw-r--r--src/core/model/RBAConstraintMaker.cpp63
-rw-r--r--src/core/model/RBAConstraintMaker.hpp58
-rw-r--r--src/core/model/RBAContent.cpp107
-rw-r--r--src/core/model/RBAContent.hpp87
-rw-r--r--src/core/model/RBAContentMaker.cpp126
-rw-r--r--src/core/model/RBAContentMaker.hpp53
-rw-r--r--src/core/model/RBAContentSet.cpp66
-rw-r--r--src/core/model/RBAContentSet.hpp61
-rw-r--r--src/core/model/RBAContentSetMaker.cpp55
-rw-r--r--src/core/model/RBAContentSetMaker.hpp52
-rw-r--r--src/core/model/RBAContentState.cpp133
-rw-r--r--src/core/model/RBAContentState.hpp74
-rw-r--r--src/core/model/RBAContentStateMaker.cpp79
-rw-r--r--src/core/model/RBAContentStateMaker.hpp58
-rw-r--r--src/core/model/RBAContentStatusType.hpp36
-rw-r--r--src/core/model/RBAIntegerProperty.cpp48
-rw-r--r--src/core/model/RBAIntegerProperty.hpp53
-rw-r--r--src/core/model/RBAModelElement.cpp47
-rw-r--r--src/core/model/RBAModelElement.hpp52
-rw-r--r--src/core/model/RBAModelElementMaker.cpp122
-rw-r--r--src/core/model/RBAModelElementMaker.hpp135
-rw-r--r--src/core/model/RBAModelElementType.hpp116
-rw-r--r--src/core/model/RBAModelImpl.cpp823
-rw-r--r--src/core/model/RBAModelImpl.hpp221
-rw-r--r--src/core/model/RBANamedElement.cpp54
-rw-r--r--src/core/model/RBANamedElement.hpp60
-rw-r--r--src/core/model/RBARuleObject.cpp105
-rw-r--r--src/core/model/RBARuleObject.hpp73
-rw-r--r--src/core/model/RBARuleObjectMaker.cpp62
-rw-r--r--src/core/model/RBARuleObjectMaker.hpp52
-rw-r--r--src/core/model/RBASceneImpl.cpp113
-rw-r--r--src/core/model/RBASceneImpl.hpp65
-rw-r--r--src/core/model/RBASceneMaker.cpp74
-rw-r--r--src/core/model/RBASceneMaker.hpp57
-rw-r--r--src/doc/ArbitrationFW.md99
-rwxr-xr-xsrc/doc/Doxygen2473
-rw-r--r--src/doc/RBA_IF_Specification.md2721
-rw-r--r--src/doc/images/ArbitrationFW.pngbin0 -> 80336 bytes
-rw-r--r--src/doc/images/ArbitrationFW.pu80
-rw-r--r--src/doc/images/JSON_configuration1.pngbin0 -> 91233 bytes
-rw-r--r--src/doc/images/JSON_configuration2.pngbin0 -> 127114 bytes
-rw-r--r--src/doc/images/JSON_configuration3.pngbin0 -> 54932 bytes
-rw-r--r--src/doc/images/JSON_configuration4.pngbin0 -> 50846 bytes
-rw-r--r--src/doc/images/JSON_configuration5.pngbin0 -> 37281 bytes
-rw-r--r--src/doc/images/JSON_configuration6.pngbin0 -> 66644 bytes
-rwxr-xr-xsrc/doc/mkdoc.sh36
-rw-r--r--src/factory/RBAAbstractMakerTable.cpp38
-rw-r--r--src/factory/RBAAbstractMakerTable.hpp60
-rw-r--r--src/factory/RBAJsonElement.cpp271
-rw-r--r--src/factory/RBAJsonElement.hpp148
-rw-r--r--src/factory/RBAJsonParser.cpp48
-rw-r--r--src/factory/RBAJsonParserImpl.cpp315
-rw-r--r--src/factory/RBAJsonParserImpl.hpp70
-rw-r--r--src/factory/RBAModelFactory.cpp201
-rw-r--r--src/factory/RBAModelFactory.hpp101
-rw-r--r--src/include/rba/RBAArbitrationPolicy.hpp48
-rw-r--r--src/include/rba/RBAArbitrator.hpp600
-rw-r--r--src/include/rba/RBAArea.hpp92
-rw-r--r--src/include/rba/RBABasePoint.hpp75
-rw-r--r--src/include/rba/RBAContentLoserType.hpp36
-rw-r--r--src/include/rba/RBADisplay.hpp56
-rw-r--r--src/include/rba/RBAJsonParser.hpp85
-rw-r--r--src/include/rba/RBAModel.hpp241
-rw-r--r--src/include/rba/RBAPositionContainer.hpp72
-rw-r--r--src/include/rba/RBAResult.hpp861
-rw-r--r--src/include/rba/RBAResultStatusType.hpp42
-rw-r--r--src/include/rba/RBAScene.hpp74
-rw-r--r--src/include/rba/RBASize.hpp74
-rw-r--r--src/include/rba/RBASoundContent.hpp83
-rw-r--r--src/include/rba/RBASoundContentState.hpp119
-rw-r--r--src/include/rba/RBAViewAction.hpp147
-rw-r--r--src/include/rba/RBAViewActionType.hpp41
-rw-r--r--src/include/rba/RBAViewContent.hpp89
-rw-r--r--src/include/rba/RBAViewContentState.hpp119
-rw-r--r--src/include/rba/RBAZone.hpp72
-rw-r--r--src/lib/.gitkeep0
-rw-r--r--src/log/RBACoverageLog.cpp357
-rw-r--r--src/log/RBACoverageLog.hpp118
-rw-r--r--src/log/RBAILogCollector.cpp26
-rw-r--r--src/log/RBAILogCollector.hpp47
-rw-r--r--src/log/RBALog.cpp43
-rw-r--r--src/log/RBALog.hpp51
-rw-r--r--src/log/RBALogManager.cpp863
-rw-r--r--src/log/RBALogManager.hpp232
-rw-r--r--src/optimize/RBAAbstractCollector.cpp598
-rw-r--r--src/optimize/RBAAbstractCollector.hpp160
-rw-r--r--src/optimize/RBAAllwaysCheckConstraintCollector.cpp52
-rw-r--r--src/optimize/RBAAllwaysCheckConstraintCollector.hpp51
-rw-r--r--src/project/msvc/rba.sln31
-rw-r--r--src/project/msvc/rba/rba.vcxproj352
-rw-r--r--src/public/RBAArea.cpp26
-rw-r--r--src/public/RBADisplay.cpp26
-rw-r--r--src/public/RBADllExport.hpp35
-rw-r--r--src/public/RBAModel.cpp26
-rw-r--r--src/public/RBAPositionContainer.cpp26
-rw-r--r--src/public/RBAResult.cpp25
-rw-r--r--src/public/RBAScene.cpp26
-rw-r--r--src/public/RBASize.cpp26
-rw-r--r--src/public/RBAZone.cpp26
-rw-r--r--src/script/conv_release.py23
-rw-r--r--src/script/make_dll_x64.bat50
-rw-r--r--src/script/make_dll_x64_log.bat50
-rw-r--r--src/script/make_dll_x86.bat50
-rw-r--r--src/script/make_dll_x86_log.bat50
-rw-r--r--src/script/make_release.sh98
-rw-r--r--src/script/remove_comment.py23
-rw-r--r--src/script/remove_internal.py23
-rw-r--r--src/sound/RBAAllInstanceOfSoundContent.cpp76
-rw-r--r--src/sound/RBAAllInstanceOfSoundContent.hpp59
-rw-r--r--src/sound/RBAAllInstanceOfSoundContentMaker.cpp56
-rw-r--r--src/sound/RBAAllInstanceOfSoundContentMaker.hpp60
-rw-r--r--src/sound/RBAAllInstanceOfZone.cpp76
-rw-r--r--src/sound/RBAAllInstanceOfZone.hpp60
-rw-r--r--src/sound/RBAAllInstanceOfZoneMaker.cpp56
-rw-r--r--src/sound/RBAAllInstanceOfZoneMaker.hpp61
-rw-r--r--src/sound/RBAIsAttenuated.cpp135
-rw-r--r--src/sound/RBAIsAttenuated.hpp55
-rw-r--r--src/sound/RBAIsAttenuatedMaker.cpp41
-rw-r--r--src/sound/RBAIsAttenuatedMaker.hpp52
-rw-r--r--src/sound/RBAIsMuted.cpp124
-rw-r--r--src/sound/RBAIsMuted.hpp56
-rw-r--r--src/sound/RBAIsMutedMaker.cpp40
-rw-r--r--src/sound/RBAIsMutedMaker.hpp52
-rw-r--r--src/sound/RBAIsOutputted.cpp144
-rw-r--r--src/sound/RBAIsOutputted.hpp56
-rw-r--r--src/sound/RBAIsOutputtedMaker.cpp42
-rw-r--r--src/sound/RBAIsOutputtedMaker.hpp52
-rw-r--r--src/sound/RBAIsSounding.cpp161
-rw-r--r--src/sound/RBAIsSounding.hpp52
-rw-r--r--src/sound/RBAIsSoundingMaker.cpp40
-rw-r--r--src/sound/RBAIsSoundingMaker.hpp52
-rw-r--r--src/sound/RBAOutputtingSound.cpp139
-rw-r--r--src/sound/RBAOutputtingSound.hpp56
-rw-r--r--src/sound/RBAOutputtingSoundMaker.cpp40
-rw-r--r--src/sound/RBAOutputtingSoundMaker.hpp52
-rw-r--r--src/sound/RBASoundContent.cpp25
-rw-r--r--src/sound/RBASoundContentImpl.cpp95
-rw-r--r--src/sound/RBASoundContentImpl.hpp75
-rw-r--r--src/sound/RBASoundContentMaker.cpp58
-rw-r--r--src/sound/RBASoundContentMaker.hpp61
-rw-r--r--src/sound/RBASoundContentOperator.cpp26
-rw-r--r--src/sound/RBASoundContentOperator.hpp45
-rw-r--r--src/sound/RBASoundContentSet.cpp60
-rw-r--r--src/sound/RBASoundContentSet.hpp62
-rw-r--r--src/sound/RBASoundContentSetMaker.cpp56
-rw-r--r--src/sound/RBASoundContentSetMaker.hpp57
-rw-r--r--src/sound/RBASoundContentState.cpp50
-rw-r--r--src/sound/RBASoundContentStateImpl.cpp77
-rw-r--r--src/sound/RBASoundContentStateImpl.hpp55
-rw-r--r--src/sound/RBASoundContentStateMaker.cpp59
-rw-r--r--src/sound/RBASoundContentStateMaker.hpp61
-rw-r--r--src/sound/RBASoundMakerTable.cpp70
-rw-r--r--src/sound/RBASoundMakerTable.hpp45
-rw-r--r--src/sound/RBAZoneImpl.cpp96
-rw-r--r--src/sound/RBAZoneImpl.hpp74
-rw-r--r--src/sound/RBAZoneMaker.cpp58
-rw-r--r--src/sound/RBAZoneMaker.hpp57
-rw-r--r--src/sound/RBAZoneOperator.cpp25
-rw-r--r--src/sound/RBAZoneOperator.hpp44
-rw-r--r--src/sound/RBAZoneSet.cpp60
-rw-r--r--src/sound/RBAZoneSet.hpp61
-rw-r--r--src/sound/RBAZoneSetMaker.cpp56
-rw-r--r--src/sound/RBAZoneSetMaker.hpp57
-rw-r--r--src/view/RBAAllInstanceOfArea.cpp75
-rw-r--r--src/view/RBAAllInstanceOfArea.hpp57
-rw-r--r--src/view/RBAAllInstanceOfAreaMaker.cpp55
-rw-r--r--src/view/RBAAllInstanceOfAreaMaker.hpp62
-rw-r--r--src/view/RBAAllInstanceOfViewContent.cpp74
-rw-r--r--src/view/RBAAllInstanceOfViewContent.hpp58
-rw-r--r--src/view/RBAAllInstanceOfViewContentMaker.cpp55
-rw-r--r--src/view/RBAAllInstanceOfViewContentMaker.hpp61
-rw-r--r--src/view/RBAAreaImpl.cpp222
-rw-r--r--src/view/RBAAreaImpl.hpp96
-rw-r--r--src/view/RBAAreaMaker.cpp90
-rw-r--r--src/view/RBAAreaMaker.hpp58
-rw-r--r--src/view/RBAAreaOperator.cpp25
-rw-r--r--src/view/RBAAreaOperator.hpp41
-rw-r--r--src/view/RBAAreaSet.cpp60
-rw-r--r--src/view/RBAAreaSet.hpp61
-rw-r--r--src/view/RBAAreaSetMaker.cpp56
-rw-r--r--src/view/RBAAreaSetMaker.hpp57
-rw-r--r--src/view/RBADisplayImpl.cpp69
-rw-r--r--src/view/RBADisplayImpl.hpp59
-rw-r--r--src/view/RBADisplayMaker.cpp72
-rw-r--r--src/view/RBADisplayMaker.hpp61
-rw-r--r--src/view/RBADisplayingContent.cpp138
-rw-r--r--src/view/RBADisplayingContent.hpp56
-rw-r--r--src/view/RBADisplayingContentMaker.cpp41
-rw-r--r--src/view/RBADisplayingContentMaker.hpp52
-rw-r--r--src/view/RBAIsDisplayed.cpp146
-rw-r--r--src/view/RBAIsDisplayed.hpp53
-rw-r--r--src/view/RBAIsDisplayedMaker.cpp41
-rw-r--r--src/view/RBAIsDisplayedMaker.hpp52
-rw-r--r--src/view/RBAIsHidden.cpp124
-rw-r--r--src/view/RBAIsHidden.hpp54
-rw-r--r--src/view/RBAIsHiddenMaker.cpp41
-rw-r--r--src/view/RBAIsHiddenMaker.hpp52
-rw-r--r--src/view/RBAIsVisible.cpp157
-rw-r--r--src/view/RBAIsVisible.hpp54
-rw-r--r--src/view/RBAIsVisibleMaker.cpp41
-rw-r--r--src/view/RBAIsVisibleMaker.hpp52
-rw-r--r--src/view/RBAPositionContainerImpl.cpp103
-rw-r--r--src/view/RBAPositionContainerImpl.hpp70
-rw-r--r--src/view/RBAPositionContainerMaker.cpp125
-rw-r--r--src/view/RBAPositionContainerMaker.hpp61
-rw-r--r--src/view/RBASizeImpl.cpp76
-rw-r--r--src/view/RBASizeImpl.hpp57
-rw-r--r--src/view/RBASizeMaker.cpp69
-rw-r--r--src/view/RBASizeMaker.hpp72
-rw-r--r--src/view/RBAViewContent.cpp25
-rw-r--r--src/view/RBAViewContentImpl.cpp112
-rw-r--r--src/view/RBAViewContentImpl.hpp78
-rw-r--r--src/view/RBAViewContentMaker.cpp67
-rw-r--r--src/view/RBAViewContentMaker.hpp57
-rw-r--r--src/view/RBAViewContentOperator.cpp26
-rw-r--r--src/view/RBAViewContentOperator.hpp45
-rw-r--r--src/view/RBAViewContentSet.cpp60
-rw-r--r--src/view/RBAViewContentSet.hpp62
-rw-r--r--src/view/RBAViewContentSetMaker.cpp56
-rw-r--r--src/view/RBAViewContentSetMaker.hpp57
-rw-r--r--src/view/RBAViewContentState.cpp50
-rw-r--r--src/view/RBAViewContentStateImpl.cpp75
-rw-r--r--src/view/RBAViewContentStateImpl.hpp56
-rw-r--r--src/view/RBAViewContentStateMaker.cpp41
-rw-r--r--src/view/RBAViewContentStateMaker.hpp52
-rw-r--r--src/view/RBAViewMakerTable.cpp75
-rw-r--r--src/view/RBAViewMakerTable.hpp52
475 files changed, 46683 insertions, 0 deletions
diff --git a/src/BUILD.md b/src/BUILD.md
new file mode 100644
index 0000000..b47b9ac
--- /dev/null
+++ b/src/BUILD.md
@@ -0,0 +1,75 @@
+# Biuld of aribrator
+
+## 1. Overview
+
+This document describes build of Rule Based Arbitrator
+
+## 2. Directory structure and library
+
+|Path|Contents|
+|:---|:---|
+| rba/include/ | header files |
+| rba/src/ | source code files |
+| rba/lib/ | libraries |
+| rba/lib/librba.a | Arbitrator staticl lib<br>(on Linux) |
+| rba/lib/librba.so | Arbitrator shared lib<br>(on Linux) |
+| rba/lib/rba.dll | Arbitrator DLL<br>(on Windows) |
+| rba/unittest/ | for unit test |
+| rba/doc/ | Documents |
+| rba/script/ | include script file |
+| rba/script/make_dll_x64.bat | for creation of DLL |
+
+
+## 3. Build step
+
+### 3-1. Linux
+
+#### 3-1-1. Environment
+
+* OS
+ - Ubuntu 16.04
+ - Ubuntu 18.04
+ - Windows Subsystem for Linux (Ubuntu 16.04.5 LTS)
+* Development env.
+ - g++ 5.4.0
+ - make 4.1
+ - CMake 3.5.1
+
+#### 3-1-2. Build
+
+```
+$ cd rba
+$ mkdir build
+$ cd build
+$ cmake ..
+$ make
+$ ls -F ../lib
+librba.a librba.so
+```
+If build will be succeed,you can get **librba.a** and **librba.so**.
+
+### 3-2. Windows
+
+#### 3-2-1. Environment
+
+* OS
+ - Microsoft Windows 7 Professional 64bit
+ - Microsoft Windows 10 Pro 64bit
+* Development Env
+ - Visual Studio Professional 2017
+ - Desktop for C++
+ - include Visual C++ tool of CMake
+
+#### 3-2-2. Build
+
+Execute command prompt for VS 2017, then executer bat file like below.
+
+```
+> cd rba
+> script¥make_dll_x64.bat
+> dir lib /w
+[.] [..] rba.dll rba.exp rba.lib
+```
+
+If build will be succeed,you can get ```rba.dll```.
+
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..4ccfe4b
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,109 @@
+cmake_minimum_required(VERSION 3.1)
+enable_language(CXX)
+set(CMAKE_CXX_STANDARD 14) # C++14
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+
+set(PROJECT_NAME "rba")
+project(${PROJECT_NAME})
+
+if(USE_GCOV)
+ set(LIB_NAME ${PROJECT_NAME}_gcov)
+else()
+ set(LIB_NAME ${PROJECT_NAME})
+endif(USE_GCOV)
+
+set(SRC_DIR src)
+set(INCLUDE_DIR include)
+file(GLOB_RECURSE SRC ${SRC_DIR}/*.cpp)
+include_directories(
+ ${INCLUDE_DIR}/rba
+ ${SRC_DIR}/core/logic
+ ${SRC_DIR}/core/model
+ ${SRC_DIR}/core/expression
+ ${SRC_DIR}/factory
+ ${SRC_DIR}/log
+ ${SRC_DIR}/optimize
+ ${SRC_DIR}/public
+ ${SRC_DIR}/sound
+ ${SRC_DIR}/view
+ ${SRC_DIR}/animation
+ )
+
+if(NOLOG)
+ # compile without log
+else()
+ add_definitions(-DRBA_USE_LOG)
+endif(NOLOG)
+
+if(WIN32)
+ # for Windows
+ add_definitions(-D_WINDLL)
+ add_definitions(-D_USRDLL)
+ add_definitions(-DNDEBUG)
+ add_definitions(-DRBA_EXPORTS)
+ add_definitions(/source-charset:utf-8)
+ add_definitions(/MP9)
+ set(CMAKE_SHARED_LINKER_FLAGS "/SUBSYSTEM:WINDOWS")
+ set(rba_BINARY_DIR ${PROJECT_SOURCE_DIR})
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+
+else()
+ # for Linux
+ add_definitions("-Wall")
+
+ if(RELEASE)
+ add_definitions("-O2")
+ else()
+ if(USE_GPROF)
+ add_definitions("-pg")
+ else()
+ add_definitions("-g")
+ endif(USE_GPROF)
+ endif(RELEASE)
+
+ if(USE_GCOV)
+ add_definitions(-fprofile-arcs -ftest-coverage -fno-exceptions)
+ set(CMAKE_SHARED_LINKER_FLAGS "--coverage")
+ else()
+ if(USE_GPROF)
+ set(CMAKE_SHARED_LINKER_FLAGS "-pg")
+ endif(USE_GPROF)
+ endif(USE_GCOV)
+
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib)
+
+endif(WIN32)
+
+add_library(rba_shared SHARED ${SRC})
+set_target_properties(rba_shared PROPERTIES OUTPUT_NAME ${LIB_NAME})
+
+if(WIN32)
+else()
+ add_library(rba_static STATIC ${SRC})
+ set_target_properties(rba_static PROPERTIES OUTPUT_NAME ${LIB_NAME})
+endif(WIN32)
+
+if(WIN32)
+ target_link_libraries(rba_shared
+ kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
+ shell32.lib ole32.lib oleaut32.lib uuid.lib
+ )
+endif(WIN32)
+
+if(DEBUG_CMAKE)
+message(STATUS "*** dump start cmake variables ***")
+get_cmake_property(_variableNames VARIABLES)
+foreach(_variableName ${_variableNames})
+ message(STATUS "${_variableName}=${${_variableName}}")
+endforeach()
+message(STATUS "*** dump end ***")
+endif(DEBUG_CMAKE)
+
+# end of file
diff --git a/src/CMakeSettings.json b/src/CMakeSettings.json
new file mode 100644
index 0000000..ed9cc6c
--- /dev/null
+++ b/src/CMakeSettings.json
@@ -0,0 +1,56 @@
+{
+ "configurations": [
+ {
+ "buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
+ "configurationType": "Release",
+ "generator": "Visual Studio 15 2017 Win64",
+ "inheritEnvironments": [
+ "msvc_x64_x64"
+ ],
+ "installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
+ "name": "x64-Release"
+ },
+ {
+ "name": "x64-Debug",
+ "generator": "Visual Studio 15 2017 Win64",
+ "configurationType": "Debug",
+ "inheritEnvironments": [
+ "msvc_x64_x64"
+ ],
+ "buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
+ "installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}"
+ },
+ {
+ "name": "x64-Debug-NOLOG",
+ "generator": "Visual Studio 15 2017 Win64",
+ "configurationType": "Debug",
+ "inheritEnvironments": [
+ "msvc_x64_x64"
+ ],
+ "variables": [
+ {
+ "name": "NOLOG",
+ "value": "1"
+ }
+ ],
+ "buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
+ "installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}"
+ },
+ {
+ "name": "x64-Release-NOLOG",
+ "generator": "Visual Studio 15 2017 Win64",
+ "configurationType": "Release",
+ "inheritEnvironments": [
+ "msvc_x64_x64"
+ ],
+ "variables": [
+ {
+ "name": "NOLOG",
+ "value": "1"
+ }
+ ],
+ "buildRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
+ "installRoot": "${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}"
+ }
+ ]
+} \ No newline at end of file
diff --git a/src/LICENSE b/src/LICENSE
new file mode 100644
index 0000000..eb21216
--- /dev/null
+++ b/src/LICENSE
@@ -0,0 +1,180 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized
+ by the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code,
+ documentation source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship.
+ For the purposes of this License, Derivative Works shall not include
+ works that remain separable from, or merely link (or bind by name)
+ to the interfaces of, the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition,
+ "submitted" means any form of electronic, verbal,
+ or written communication sent to the Licensor or its representatives,
+ including but not limited to communication on electronic mailing lists,
+ source code control systems, and issue tracking systems
+ that are managed by, or on behalf of, the Licensor for the
+ purpose of discussing and improving the Work, but excluding communication
+ that is conspicuously marked or otherwise designated in
+ writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor
+ and subsequently incorporated within the Work.
+
+2. Grant of Copyright License.
+ Subject to the terms and conditions of this License,
+ each Contributor hereby grants to You a perpetual, worldwide,
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license
+ to reproduce, prepare Derivative Works of, publicly display,
+ publicly perform, sublicense, and distribute the Work
+ and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+ Subject to the terms and conditions of this License,
+ each Contributor hereby grants to You a perpetual, worldwide,
+ non-exclusive, no-charge, royalty-free,
+ irrevocable (except as stated in this section) patent license to make,
+ have made, use, offer to sell, sell, import,
+ and otherwise transfer the Work, where such license applies only to
+ those patent claims licensable by such Contributor that are necessarily
+ infringed by their Contribution(s) alone or by combination of
+ their Contribution(s) with the Work to which such Contribution(s)
+ was submitted. If You institute patent litigation against any entity
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
+ the Work or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses granted to
+ You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution.
+You may reproduce and distribute copies of the Work or
+Derivative Works thereof in any medium, with or without modifications,
+and in Source or Object form, provided that You meet the following conditions:
+
+ a. You must give any other recipients of the Work or Derivative Works
+ a copy of this License; and
+ b. You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+ c. You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark,
+ and attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain
+ to any part of the Derivative Works; and
+ d. If the Work includes a "NOTICE" text file as part of its distribution,
+ then any Derivative Works that You distribute must include
+ a readable copy of the attribution notices contained within
+ such NOTICE file, excluding those notices that do not pertain t
+ o any part of the Derivative Works, in at least one of
+ the following places: within a NOTICE text file distributed as part of
+ the Derivative Works; within the Source form or documentation,
+ if provided along with the Derivative Works; or, within a display
+ generated by the Derivative Works, if and wherever such third-party
+ notices normally appear. The contents of the NOTICE file are for
+ informational purposes only and do not modify the License.
+ You may add Your own attribution notices within Derivative Works that
+ You distribute, alongside or as an addendum to the NOTICE text
+ from the Work, provided that such additional attribution notices
+ cannot be construed as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and
+ conditions for use, reproduction, or distribution of Your modifications,
+ or for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies
+ with the conditions stated in this License.
+
+5. Submission of Contributions.
+ Unless You explicitly state otherwise, any Contribution intentionally
+ submitted for inclusion in the Work by You to the Licensor shall be under
+ the terms and conditions of this License, without any additional terms or
+ conditions. Notwithstanding the above, nothing herein shall supersede or
+ modify the terms of any separate license agreement
+ you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks.
+ This License does not grant permission to use the trade names,
+ trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing
+ the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+ Unless required by applicable law or agreed to in writing,
+ Licensor provides the Work (and each Contributor provides its Contributions)
+ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ either express or implied, including, without limitation, any warranties or
+ conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
+ FITNESS FOR A PARTICULAR PURPOSE.
+ You are solely responsible for determining the appropriateness of using or
+ redistributing the Work and assume any risks associated with
+ Your exercise of permissions under this License.
+
+8. Limitation of Liability.
+ In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and
+ grossly negligent acts) or agreed to in writing,
+ shall any Contributor be liable to You for damages, including any direct,
+ indirect, special, incidental, or consequential damages of
+ any character arising as a result of this License or out of the use or
+ inability to use the Work (including but not limited to damages for
+ loss of goodwill, work stoppage, computer failure or malfunction,
+ or any and all other commercial damages or losses),
+ even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+ While redistributing the Work or Derivative Works thereof,
+ You may choose to offer, and charge a fee for, acceptance of support,
+ warranty, indemnity, or other liability obligations and/or
+ rights consistent with this License.
+ However, in accepting such obligations,
+ You may act only on Your own behalf and on Your sole responsibility,
+ not on behalf of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability incurred by,
+ or claims asserted against, such Contributor by reason of your accepting
+ any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
diff --git a/src/README.md b/src/README.md
new file mode 100644
index 0000000..d61540e
--- /dev/null
+++ b/src/README.md
@@ -0,0 +1,4 @@
+# rba
+Rule Based Arbitrator.
+
+Rule Based Arbitrator decides which of the content to display when a large number of contents to be displayed on the cockpit display device (CID, meter, HUD, etc.) occur simultaneously under a certain rule (arbitration. ).
diff --git a/src/core/expression/RBAActionOperator.cpp b/src/core/expression/RBAActionOperator.cpp
new file mode 100644
index 0000000..7cd38ec
--- /dev/null
+++ b/src/core/expression/RBAActionOperator.cpp
@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Action operator class definition
+ */
+
+#include "RBAActionOperator.hpp"
+#include "RBAExpressionType.hpp"
+
+namespace rba
+{
+
+#ifdef RBA_USE_LOG
+RBAExpressionType
+RBAActionOperator::getUnderlyingType() const
+{
+ return RBAExpressionType::ACTION;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAActionOperator.hpp b/src/core/expression/RBAActionOperator.hpp
new file mode 100644
index 0000000..677f699
--- /dev/null
+++ b/src/core/expression/RBAActionOperator.hpp
@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Action operator class
+ */
+
+#ifndef RBAACTIONOPERATOR_HPP
+#define RBAACTIONOPERATOR_HPP
+
+#include "RBAOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAActionOperator : public RBAOperator
+{
+protected:
+ RBAActionOperator()=default;
+ RBAActionOperator(const RBAActionOperator&)=delete;
+ RBAActionOperator(const RBAActionOperator&&)=delete;
+ RBAActionOperator& operator=(const RBAActionOperator&)=delete;
+ RBAActionOperator& operator=(const RBAActionOperator&&)=delete;
+
+public:
+ // Log
+#ifdef RBA_USE_LOG
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAActiveContents.cpp b/src/core/expression/RBAActiveContents.cpp
new file mode 100644
index 0000000..b5d88a7
--- /dev/null
+++ b/src/core/expression/RBAActiveContents.cpp
@@ -0,0 +1,108 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Select operator class definition
+ */
+
+#include <memory>
+#include "RBAActiveContents.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBAActiveContents::RBAActiveContents()
+: RBAAllocatableOperator(),
+ contentSet_{std::make_unique<RBAContentSet>()}
+{
+}
+
+void
+RBAActiveContents::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAActiveContents::getModelElementType() const
+{
+ return RBAModelElementType::ActiveContents;
+}
+
+const RBARuleObject*
+RBAActiveContents::getReferenceObjectCore(RBAConstraintInfo* info, RBAArbitrator* arb) const
+{
+ LOG_addHierarchy(LOG_getSymbol());
+ const RBARuleObject* returnObj {nullptr};
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const lhsObj {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ else if (lhsObj != nullptr) {
+ contentSet_->clear();
+ const RBAAllocatable* const alloc {dynamic_cast<const RBAAllocatable*>(lhsObj->getRawObject())};
+#ifdef RBA_USE_LOG
+ if (arb == nullptr) {
+ // Follow this path when called from createHierarchy()
+ returnObj = alloc->getContentSet();
+ } else {
+#endif
+ for (auto& content : alloc->getInternalContents()) {
+ if (alloc->isPrevious()) {
+ if (arb->getResult()->isPreActive(content)) {
+ contentSet_->addTarget(content);
+ }
+ } else {
+ if (arb->getResult()->isActive(content)) {
+ contentSet_->addTarget(content);
+ }
+ }
+ }
+ returnObj = contentSet_.get();
+#ifdef RBA_USE_LOG
+ }
+#endif
+ } else {
+ ;
+ }
+#ifdef RBA_USE_LOG
+ std::string objName = "NULL";
+ if (returnObj != nullptr) {
+ objName = returnObj->getElementName();
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + LOG_getExpressionText() + " is " + objName);
+#endif
+ LOG_removeHierarchy();
+ return returnObj;
+}
+#ifdef RBA_USE_LOG
+const std::string
+RBAActiveContents::getSymbol() const
+{
+ return ".activeContents()";
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAActiveContents.hpp b/src/core/expression/RBAActiveContents.hpp
new file mode 100644
index 0000000..3ee9f7d
--- /dev/null
+++ b/src/core/expression/RBAActiveContents.hpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ActiveContents operator
+ */
+
+#ifndef RBAACTIVECONTENTS_HPP
+#define RBAACTIVECONTENTS_HPP
+
+#include "RBAAllocatableOperator.hpp"
+#include "RBAContentSet.hpp"
+
+namespace rba
+{
+
+class RBAActiveContents : public RBAAllocatableOperator
+{
+ public:
+ RBAActiveContents();
+ RBAActiveContents(const RBAActiveContents&)=delete;
+ RBAActiveContents(const RBAActiveContents&&)=delete;
+ RBAActiveContents& operator=(const RBAActiveContents&)=delete;
+ RBAActiveContents& operator=(const RBAActiveContents&&)=delete;
+ virtual ~RBAActiveContents()=default;
+
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+#endif
+ private:
+ std::unique_ptr<RBAContentSet> contentSet_;
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAActiveContentsMaker.cpp b/src/core/expression/RBAActiveContentsMaker.cpp
new file mode 100644
index 0000000..f883fee
--- /dev/null
+++ b/src/core/expression/RBAActiveContentsMaker.cpp
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAActiveContentsMaker.cpp
+/// @brief ActiveContents object creation class defintion
+///
+
+#include "RBAActiveContentsMaker.hpp"
+#include "RBAActiveContents.hpp"
+
+namespace rba
+{
+
+RBAActiveContentsMaker::RBAActiveContentsMaker()
+ : RBAOperatorMaker{"ActiveContents"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAActiveContentsMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAActiveContents>();
+}
+
+}
diff --git a/src/core/expression/RBAActiveContentsMaker.hpp b/src/core/expression/RBAActiveContentsMaker.hpp
new file mode 100644
index 0000000..493e569
--- /dev/null
+++ b/src/core/expression/RBAActiveContentsMaker.hpp
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAActiveContentsMaker.hpp
+/// @brief ActiveContents object creation class header
+///
+
+#ifndef RBAACTIVECONTENTSMAKER_HPP
+#define RBAACTIVECONTENTSMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ActiveContents object creation class
+class RBAActiveContentsMaker : public RBAOperatorMaker
+{
+public:
+ RBAActiveContentsMaker();
+ RBAActiveContentsMaker(const RBAActiveContentsMaker&)=delete;
+ RBAActiveContentsMaker(const RBAActiveContentsMaker&&)=delete;
+ RBAActiveContentsMaker& operator=(const RBAActiveContentsMaker&)=delete;
+ RBAActiveContentsMaker& operator=(const RBAActiveContentsMaker&&)=delete;
+ virtual ~RBAActiveContentsMaker()=default;
+
+public:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAActiveState.cpp b/src/core/expression/RBAActiveState.cpp
new file mode 100644
index 0000000..1e0f6b3
--- /dev/null
+++ b/src/core/expression/RBAActiveState.cpp
@@ -0,0 +1,83 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * activeState definition
+ */
+
+#include "RBAActiveState.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentState.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBALogManager.hpp"
+
+namespace rba
+{
+
+void RBAActiveState::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+RBAModelElementType RBAActiveState::getModelElementType() const
+{
+ return RBAModelElementType::ActiveState;
+}
+const RBARuleObject* RBAActiveState::getReferenceObjectCore(
+ RBAConstraintInfo* info, RBAArbitrator* arb) const
+{
+ LOG_addHierarchy(LOG_getSymbol());
+ const RBARuleObject* returnObj {nullptr};
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj {getLhsOperand()->getReferenceObject(leftInfo,
+ arb)};
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (ruleObj != nullptr) {
+ const RBAContent* const c {
+ dynamic_cast<const RBAContent*>(ruleObj->getRawObject())};
+ if (ruleObj->isPrevious()) {
+ returnObj = arb->getResult()->getPreActiveState(c);
+ } else {
+ returnObj = arb->getResult()->getActiveState(c);
+ }
+ } else {
+ ;
+ }
+#ifdef RBA_USE_LOG
+ std::string str;
+ if (info->isExceptionBeforeArbitrate()) {
+ str = " is before arbitrate skip";
+ } else if (ruleObj == nullptr) {
+ str = " no Content";
+ } else if (returnObj == nullptr) {
+ str = " has no Active State";
+ } else {
+ str = " is " + returnObj->getElementName();
+ }
+ LOG_arbitrateConstraintLogicLogLine(" " + getExpressionText() + str);
+#endif
+ LOG_removeHierarchy();
+ return returnObj;
+}
+#ifdef RBA_USE_LOG
+const std::string RBAActiveState::getSymbol() const
+{
+ return ".activeState()";
+}
+#endif
+} /* namespace rba */
diff --git a/src/core/expression/RBAActiveState.hpp b/src/core/expression/RBAActiveState.hpp
new file mode 100644
index 0000000..3876c78
--- /dev/null
+++ b/src/core/expression/RBAActiveState.hpp
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// activeState header
+//
+
+#ifndef RBAACTIVESTATE_HPP
+#define RBAACTIVESTATE_HPP
+
+#include "RBAContentOperator.hpp"
+
+namespace rba
+{
+
+class RBAActiveState : public RBAContentOperator
+{
+ public:
+ RBAActiveState()=default;
+ RBAActiveState(const RBAActiveState&)=delete;
+ RBAActiveState(const RBAActiveState&&)=delete;
+ RBAActiveState& operator=(const RBAActiveState&)=delete;
+ RBAActiveState& operator=(const RBAActiveState&&)=delete;
+ virtual ~RBAActiveState()=default;
+
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+#endif
+};
+
+} /* namespace rba */
+
+#endif /* RBAACTIVESTATE_HPP */
diff --git a/src/core/expression/RBAActiveStateMaker.cpp b/src/core/expression/RBAActiveStateMaker.cpp
new file mode 100644
index 0000000..16d8f4c
--- /dev/null
+++ b/src/core/expression/RBAActiveStateMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAActiveStateMaker.cpp
+/// @brief ActiveState objeckt maker class definition
+
+#include "RBAActiveStateMaker.hpp"
+#include "RBAActiveState.hpp"
+
+namespace rba
+{
+
+RBAActiveStateMaker::RBAActiveStateMaker()
+ : RBAOperatorMaker{"ActiveState"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAActiveStateMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAActiveState>();
+}
+
+}
diff --git a/src/core/expression/RBAActiveStateMaker.hpp b/src/core/expression/RBAActiveStateMaker.hpp
new file mode 100644
index 0000000..7d42cbe
--- /dev/null
+++ b/src/core/expression/RBAActiveStateMaker.hpp
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAActiveStateMaker.hpp
+/// @brief ActiveState object maker class header
+///
+
+#ifndef RBAACTIVESTATEMAKER_HPP
+#define RBAACTIVESTATEMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ActiveState object maker class
+class RBAActiveStateMaker : public RBAOperatorMaker
+{
+public:
+ RBAActiveStateMaker();
+ RBAActiveStateMaker(const RBAActiveStateMaker&)=delete;
+ RBAActiveStateMaker(const RBAActiveStateMaker&&)=delete;
+ RBAActiveStateMaker& operator=(const RBAActiveStateMaker&)=delete;
+ RBAActiveStateMaker& operator=(const RBAActiveStateMaker&&)=delete;
+ virtual ~RBAActiveStateMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAAllocatableOperator.cpp b/src/core/expression/RBAAllocatableOperator.cpp
new file mode 100644
index 0000000..15a9104
--- /dev/null
+++ b/src/core/expression/RBAAllocatableOperator.cpp
@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Allcatable operator class definitio
+ */
+
+#include "RBAAllocatableOperator.hpp"
+
+namespace rba
+{
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAAllocatableOperator::getExpressionText() const
+{
+ return getLhsOperand()->getExpressionText() + getSymbol();
+}
+
+const std::string
+RBAAllocatableOperator::getCoverageExpressionText() const
+{
+ return getLhsOperand()->getCoverageExpressionText() + getSymbol();
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAAllocatableOperator.hpp b/src/core/expression/RBAAllocatableOperator.hpp
new file mode 100644
index 0000000..7a4f40a
--- /dev/null
+++ b/src/core/expression/RBAAllocatableOperator.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Allocatable operator class header
+ */
+
+#ifndef RBAALLOCATABLEOPERATOR_HPP
+#define RBAALLOCATABLEOPERATOR_HPP
+
+#include "RBAOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAAllocatableOperator : public RBAOperator
+{
+protected:
+ RBAAllocatableOperator()=default;
+ RBAAllocatableOperator(const RBAAllocatableOperator&)=delete;
+ RBAAllocatableOperator(const RBAAllocatableOperator&&)=delete;
+ RBAAllocatableOperator& operator=(const RBAAllocatableOperator&)=delete;
+ RBAAllocatableOperator& operator=(const RBAAllocatableOperator&&)=delete;
+
+public:
+ virtual ~RBAAllocatableOperator()=default;
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAAllocatedContent.cpp b/src/core/expression/RBAAllocatedContent.cpp
new file mode 100644
index 0000000..923717d
--- /dev/null
+++ b/src/core/expression/RBAAllocatedContent.cpp
@@ -0,0 +1,118 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Allocated Content class
+ */
+
+#include "RBAAllocatedContent.hpp"
+
+#include "RBAAllocatable.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAContentState.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void RBAAllocatedContent::accept(RBAExpressionVisitor& visitor)
+{
+ // RBASceneAllocatableCollector which is the only visitor at the moment
+ // does not accept this content, so it will not pass this path.
+ //
+ // However, in the future, another visitor may accept it, so leave this.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAAllocatedContent::getModelElementType() const
+{
+ return RBAModelElementType::AllocatedContent;
+}
+
+const RBARuleObject*
+RBAAllocatedContent::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ const RBARuleObject* object {nullptr}; // return value
+ const auto leftInfo = info->getChild(0U);
+ const auto ruleObj = getLhsOperand()->getReferenceObject(leftInfo, arb);
+ if (ruleObj != nullptr) {
+ if (!leftInfo->isExceptionBeforeArbitrate()) {
+ const RBAAllocatable* const alloc {dynamic_cast<const RBAAllocatable*>(ruleObj->getRawObject())};
+ if (ruleObj->isPrevious() == true) {
+ const auto contentState = arb->getResult()->getDirectPreContentState(alloc);
+ if(contentState != nullptr) {
+ object = contentState->getOwner();
+ }
+ } else if (alloc->isChecked()) {
+ const auto contentState = alloc->getState();
+ if (contentState != nullptr) {
+ object = contentState->getOwner();
+ }
+ // At this point, it is unsure whether the constraint expression will be False or True,
+ // so put it in both.
+ info->addTrueAllocatable(alloc);
+ info->addFalseAllocatable(alloc);
+ } else {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ } else {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ }
+#ifdef RBA_USE_LOG
+ bool pre = false;
+ std::string str;
+ if (ruleObj == nullptr) {
+ // Currently there is no constraint expression that returns an area.
+ // Therefore, ruleObj never becomes NULL.
+ // In the future, a constraint expression that returns an area
+ // may be created, so leave this processing.
+ str = "Allocatable[NULL] has no Content skip";
+ } else {
+ pre = ruleObj->isPrevious();
+ if (info->isExceptionBeforeArbitrate()) {
+ str = "Allocatable[" + ruleObj->getElementName() + "] is before arbitrate skip";
+ } else if (object == nullptr) {
+ str = "Allocatable[" + ruleObj->getElementName() + "] has no Allocated Content";
+ } else {
+ str = "Allocatable[" + ruleObj->getElementName() + "] has Allocated Content["
+ + object->getElementName() + "]";
+ }
+ }
+ LOG_arbitrateConstraintLogicLogLine(" " + getPreMsg(pre) + str);
+#endif
+ return object;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAAllocatedContent::getSymbol() const
+{
+ return ".allocatedContent()";
+}
+
+void
+RBAAllocatedContent::createHierarchy()
+{
+ getLhsOperand()->createHierarchy();
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAAllocatedContent.hpp b/src/core/expression/RBAAllocatedContent.hpp
new file mode 100644
index 0000000..6fb44e2
--- /dev/null
+++ b/src/core/expression/RBAAllocatedContent.hpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Allocated Content class
+ */
+
+#ifndef RBAALLOCATEDCONTENT_HPP
+#define RBAALLOCATEDCONTENT_HPP
+
+#include "RBAAllocatableOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAAllocatedContent : public RBAAllocatableOperator
+{
+ public:
+ RBAAllocatedContent()=default;
+ RBAAllocatedContent(const RBAAllocatedContent&)=delete;
+ RBAAllocatedContent(const RBAAllocatedContent&&)=delete;
+ RBAAllocatedContent& operator=(const RBAAllocatedContent&)=delete;
+ RBAAllocatedContent& operator=(const RBAAllocatedContent&&)=delete;
+ virtual ~RBAAllocatedContent()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ void createHierarchy() override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAAllocatedContentMaker.cpp b/src/core/expression/RBAAllocatedContentMaker.cpp
new file mode 100644
index 0000000..36d3ad7
--- /dev/null
+++ b/src/core/expression/RBAAllocatedContentMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAllocatedContentMaker.cpp
+/// @brief AllocatedContent object maker class
+
+#include "RBAAllocatedContentMaker.hpp"
+#include "RBAAllocatedContent.hpp"
+
+namespace rba
+{
+
+RBAAllocatedContentMaker::RBAAllocatedContentMaker()
+ : RBAOperatorMaker{"AllocatedContent"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAAllocatedContentMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAAllocatedContent>();
+}
+
+}
diff --git a/src/core/expression/RBAAllocatedContentMaker.hpp b/src/core/expression/RBAAllocatedContentMaker.hpp
new file mode 100644
index 0000000..10f83b9
--- /dev/null
+++ b/src/core/expression/RBAAllocatedContentMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAllocatedContentMaker.hpp
+/// @brief AllocatedContent object maker class header file
+
+#ifndef RBAALLOCATEDCONTENTMAKER_HPP
+#define RBAALLOCATEDCONTENTMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief AllocatedContent object maker class
+class RBAAllocatedContentMaker : public RBAOperatorMaker
+{
+public:
+ RBAAllocatedContentMaker();
+ RBAAllocatedContentMaker(const RBAAllocatedContentMaker&)=delete;
+ RBAAllocatedContentMaker(const RBAAllocatedContentMaker&&)=delete;
+ RBAAllocatedContentMaker& operator=(const RBAAllocatedContentMaker&)=delete;
+ RBAAllocatedContentMaker& operator=(const RBAAllocatedContentMaker&&)=delete;
+ virtual ~RBAAllocatedContentMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAAndOperator.cpp b/src/core/expression/RBAAndOperator.cpp
new file mode 100644
index 0000000..0f3a30d
--- /dev/null
+++ b/src/core/expression/RBAAndOperator.cpp
@@ -0,0 +1,113 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AND operator class definition
+ */
+
+#include "RBAAndOperator.hpp"
+
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void
+RBAAndOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAAndOperator::getModelElementType() const
+{
+ return RBAModelElementType::AndOperator;
+}
+
+bool
+RBAAndOperator::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator * arb) const
+{
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+
+ std::uint32_t falseCount {0U};
+ std::uint32_t exceptionCount {0U};
+ std::uint32_t index {0U};
+ for(const auto& ope : getOperand()) {
+ // Add count to constraint hierarchy for coverage
+ LOG_addHierarchy("#" + std::to_string(index));
+
+ RBAConstraintInfo* const childInfo {info->getChild(index)};
+ const bool res {ope->execute(childInfo, arb)};
+ if(childInfo->isExceptionBeforeArbitrate()) {
+ exceptionCount++;
+ } else if(!res) {
+ falseCount++;
+ } else {
+ ;
+ }
+
+ // Remove count to constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ index++;
+ }
+
+ // with fail
+ if (falseCount > 0U) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ // Rmove count to constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return false;
+ }
+
+ // exception
+ if (exceptionCount > 0U) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ // Rmove count to constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ info->setExceptionBeforeArbitrate(true);
+ return false;
+ }
+
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ // Rmove count to constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ return true;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAAndOperator::getSymbol() const
+{
+ return "AND";
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAAndOperator.hpp b/src/core/expression/RBAAndOperator.hpp
new file mode 100644
index 0000000..229c69f
--- /dev/null
+++ b/src/core/expression/RBAAndOperator.hpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AND operator class header fiel
+ */
+
+#ifndef RBAANDOPERATOR_HPP
+#define RBAANDOPERATOR_HPP
+
+#include "RBALogicalOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAAndOperator : public RBALogicalOperator
+{
+ public:
+ RBAAndOperator()=default;
+ RBAAndOperator(const RBAAndOperator&)=delete;
+ RBAAndOperator(const RBAAndOperator&&)=delete;
+ RBAAndOperator& operator=(const RBAAndOperator&)=delete;
+ RBAAndOperator& operator=(const RBAAndOperator&&)=delete;
+ virtual ~RBAAndOperator()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAAndOperatorMaker.cpp b/src/core/expression/RBAAndOperatorMaker.cpp
new file mode 100644
index 0000000..1606e6b
--- /dev/null
+++ b/src/core/expression/RBAAndOperatorMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAndOperatorMaker.cpp
+/// @brief AndOperator object maker class defintion file
+
+#include "RBAAndOperatorMaker.hpp"
+#include "RBAAndOperator.hpp"
+
+namespace rba
+{
+
+RBAAndOperatorMaker::RBAAndOperatorMaker()
+ : RBAOperatorMaker{"AndOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAAndOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAAndOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAAndOperatorMaker.hpp b/src/core/expression/RBAAndOperatorMaker.hpp
new file mode 100644
index 0000000..6198440
--- /dev/null
+++ b/src/core/expression/RBAAndOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAndOperatorMaker.hpp
+/// @brief AndOperator object maker classs header file
+
+#ifndef RBAANDOPERATORMAKER_HPP
+#define RBAANDOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief AndOperator object maker classs
+class RBAAndOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBAAndOperatorMaker();
+ RBAAndOperatorMaker(const RBAAndOperatorMaker&)=delete;
+ RBAAndOperatorMaker(const RBAAndOperatorMaker&&)=delete;
+ RBAAndOperatorMaker& operator=(const RBAAndOperatorMaker&)=delete;
+ RBAAndOperatorMaker& operator=(const RBAAndOperatorMaker&&)=delete;
+ virtual ~RBAAndOperatorMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAArithmeticOperator.cpp b/src/core/expression/RBAArithmeticOperator.cpp
new file mode 100644
index 0000000..2bf25de
--- /dev/null
+++ b/src/core/expression/RBAArithmeticOperator.cpp
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ArithmeticOperator class definition
+ */
+
+#include "RBAArithmeticOperator.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/core/expression/RBAArithmeticOperator.hpp b/src/core/expression/RBAArithmeticOperator.hpp
new file mode 100644
index 0000000..5113a84
--- /dev/null
+++ b/src/core/expression/RBAArithmeticOperator.hpp
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ArithmeticOperator class header file
+ */
+
+#ifndef RBAARITHMETICOPERATOR_HPP
+#define RBAARITHMETICOPERATOR_HPP
+
+#include "RBAOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAArithmeticOperator : public RBAOperator
+{
+protected:
+ RBAArithmeticOperator()=default;
+ RBAArithmeticOperator(const RBAArithmeticOperator&)=delete;
+ RBAArithmeticOperator(const RBAArithmeticOperator&&)=delete;
+ RBAArithmeticOperator& operator=(const RBAArithmeticOperator&)=delete;
+ RBAArithmeticOperator& operator=(const RBAArithmeticOperator&&)=delete;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAContentOperator.cpp b/src/core/expression/RBAContentOperator.cpp
new file mode 100644
index 0000000..6f7083b
--- /dev/null
+++ b/src/core/expression/RBAContentOperator.cpp
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ContentOperator class definition
+ */
+
+#include "RBAContentOperator.hpp"
+
+namespace rba
+{
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAContentOperator::getExpressionText() const
+{
+ return getLhsOperand()->getExpressionText() + getSymbol();
+}
+
+const std::string
+RBAContentOperator::getCoverageExpressionText() const
+{
+ return getLhsOperand()->getCoverageExpressionText() + getSymbol();
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAContentOperator.hpp b/src/core/expression/RBAContentOperator.hpp
new file mode 100644
index 0000000..fef5ec3
--- /dev/null
+++ b/src/core/expression/RBAContentOperator.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ContentOperator class
+ */
+
+#ifndef RBACONTENTOPERATOR_HPP
+#define RBACONTENTOPERATOR_HPP
+
+#include "RBAOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAContentOperator : public RBAOperator
+{
+protected:
+ RBAContentOperator()=default;
+ RBAContentOperator(const RBAContentOperator&)=delete;
+ RBAContentOperator(const RBAContentOperator&&)=delete;
+ RBAContentOperator& operator=(const RBAContentOperator&)=delete;
+ RBAContentOperator& operator=(const RBAContentOperator&&)=delete;
+
+public:
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAContentValue.cpp b/src/core/expression/RBAContentValue.cpp
new file mode 100644
index 0000000..23b1b20
--- /dev/null
+++ b/src/core/expression/RBAContentValue.cpp
@@ -0,0 +1,116 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * ContentValue class definition
+ */
+
+#include <string>
+#include "RBAContentValue.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAContentState.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void RBAContentValue::accept(RBAExpressionVisitor& visitor)
+{
+ // RBA SceneAllocatableCollector which is only existing vistor at this time
+ // does not accept the value of the content state.
+ // So this code doesn't work.
+ //
+ // But, leave this because another visitor may accept it in the future.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAContentValue::getModelElementType() const
+{
+ return RBAModelElementType::ContentValue;
+}
+
+std::int32_t
+RBAContentValue::getValueCore(RBAConstraintInfo* info, RBAArbitrator* arb) const
+{
+ std::int32_t result { -99 };
+ const auto leftInfo = info->getChild(0U);
+ const auto r = getLhsOperand()->getReferenceObject(leftInfo, arb);
+ const RBAContentState* cs { nullptr };
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ if (r != nullptr) {
+ const auto a = dynamic_cast<const RBAAllocatable*>(r->getRawObject());
+ if (a != nullptr) {
+ if (r->isPrevious()) {
+ cs = arb->getResult()->getDirectPreContentState(a);
+ if (cs != nullptr) {
+ result = cs->getContentStatePriority();
+ }
+ } else {
+ info->addOperandAllocatable(a);
+ if (a->isChecked()) {
+ cs = a->getState();
+ if (cs != nullptr) {
+ result = cs->getContentStatePriority();
+ }
+ } else {
+ // Throw an Exception if arbitration is not over
+ info->setExceptionBeforeArbitrate(true);
+ }
+ }
+ }
+ }
+ }
+#ifdef RBA_USE_LOG
+ std::string pre;
+ std::string aName = "NULL";
+ std::string resultText = "no Content skip";
+ if (r != nullptr) {
+ aName = r->getElementName();
+ pre = getPreMsg(r->isPrevious());
+ }
+ if (info->isExceptionBeforeArbitrate()) {
+ resultText = "before arbitrate skip";
+ } else {
+ if (cs != nullptr) {
+ resultText = cs->getOwner()->getElementName() + "::" + cs->getElementName() + " : " + cs->getPriorityString();
+ }
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " "
+ + pre
+ + "Allocatable["
+ + aName
+ + "] has Content Priority ["
+ + resultText
+ + "]");
+ #endif
+ return result;
+}
+#ifdef RBA_USE_LOG
+const std::string
+RBAContentValue::getSymbol() const
+{
+ return ".contentValue()";
+}
+#endif
+}
diff --git a/src/core/expression/RBAContentValue.hpp b/src/core/expression/RBAContentValue.hpp
new file mode 100644
index 0000000..52bd841
--- /dev/null
+++ b/src/core/expression/RBAContentValue.hpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * ContentValue class header file
+ */
+
+#ifndef RBACONTENTVALUE_HPP
+#define RBACONTENTVALUE_HPP
+
+#include <cstdint>
+#include "RBAAllocatableOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAContentValue : public RBAAllocatableOperator
+{
+public:
+ RBAContentValue()=default;
+ RBAContentValue(const RBAContentValue&)=delete;
+ RBAContentValue(RBAContentValue&&)=delete;
+ RBAContentValue& operator=(const RBAContentValue&)=delete;
+ RBAContentValue& operator=(RBAContentValue&&)=delete;
+ virtual ~RBAContentValue()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ std::int32_t getValueCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAContentValueMaker.cpp b/src/core/expression/RBAContentValueMaker.cpp
new file mode 100644
index 0000000..48aaaeb
--- /dev/null
+++ b/src/core/expression/RBAContentValueMaker.cpp
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAContentValueMaker.cpp
+/// @brief ContentValue object maker classs definition
+
+#include "RBAContentValueMaker.hpp"
+#include "RBAContentValue.hpp"
+
+namespace rba
+{
+
+RBAContentValueMaker::RBAContentValueMaker()
+ : RBAOperatorMaker{"ContentValue"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAContentValueMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAContentValue>();
+}
+
+
+}
diff --git a/src/core/expression/RBAContentValueMaker.hpp b/src/core/expression/RBAContentValueMaker.hpp
new file mode 100644
index 0000000..8f14c95
--- /dev/null
+++ b/src/core/expression/RBAContentValueMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAContentValueMaker.hpp
+/// @brief ContentValue object maker calss header file
+
+#ifndef RBACONTENTVALUEMAKER_HPP
+#define RBACONTENTVALUEMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ContentValue object generation class
+class RBAContentValueMaker : public RBAOperatorMaker
+{
+public:
+ RBAContentValueMaker();
+ RBAContentValueMaker(const RBAContentValueMaker&)=delete;
+ RBAContentValueMaker(const RBAContentValueMaker&&)=delete;
+ RBAContentValueMaker& operator=(const RBAContentValueMaker&)=delete;
+ RBAContentValueMaker& operator=(const RBAContentValueMaker&&)=delete;
+ virtual ~RBAContentValueMaker()=default;
+
+protected:
+ /// @brief Create empty instance
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAExecuteResult.hpp b/src/core/expression/RBAExecuteResult.hpp
new file mode 100644
index 0000000..1eaf2a5
--- /dev/null
+++ b/src/core/expression/RBAExecuteResult.hpp
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * A type that withdraws requests when arbitration loses
+ */
+
+#ifndef RBAEXECUTERESULT_HPP
+#define RBAEXECUTERESULT_HPP
+
+namespace rba
+{
+
+enum class RBAExecuteResult : std::uint8_t
+{
+ TRUE,
+ FALSE,
+ EXE, // In case of action is performed by doAction()
+ // (Excludes SetOfAction and IfAction)
+ NOTEXE, // In case of action is NOT performed by doAction()
+ // (Excludes SetOfAction and IfAction)
+ SKIP // In case of getValue() or getReferenceObject()
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAExistsOperator.cpp b/src/core/expression/RBAExistsOperator.cpp
new file mode 100644
index 0000000..8bb8f05
--- /dev/null
+++ b/src/core/expression/RBAExistsOperator.cpp
@@ -0,0 +1,175 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Exists operator Class definition
+ */
+
+#include "RBAExistsOperator.hpp"
+#include "RBAAllocatableSet.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAContentSet.hpp"
+#include "RBAContent.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALambdaExpression.hpp"
+#include "RBALogManager.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAExistsOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAExistsOperator::getModelElementType() const
+{
+ return RBAModelElementType::ExistsOperator;
+}
+
+bool
+RBAExistsOperator::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator * arb) const
+{
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+
+ const RBAExpression* const setObj {getLhsOperand()};
+ RBALambdaExpression* const lambda {getLambda()};
+
+ // Get rule object and loop
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+
+ std::vector<const RBARuleObject*> objs;
+
+ const RBARuleObject* const ruleObj {setObj->getReferenceObject(leftInfo, arb)};
+ const RBARuleObject* objset {nullptr};
+ if (ruleObj != nullptr) {
+ objset = ruleObj->getRawObject();
+ }
+
+ if (leftInfo->isExceptionBeforeArbitrate() || (objset == nullptr)) {
+ // Remove itself form the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ info->setExceptionBeforeArbitrate(true);
+ return false;
+ }
+
+ if (dynamic_cast<const RBAAllocatableSet*>(objset) != nullptr) {
+ objs.clear();
+ for(const RBAAllocatable* alloc
+ : dynamic_cast<const RBAAllocatableSet*>(objset)->getLeafAllocatable() ) {
+ objs.push_back(alloc);
+ }
+ }
+ else {
+ objs.clear();
+ for(const auto& cont : dynamic_cast<const RBAContentSet*>(objset)->getLeafContent() ){
+ objs.push_back(cont);
+ }
+ }
+
+ bool isTrue {false};
+ std::uint32_t i {0U};
+ for(const RBARuleObject* const obj : objs) {
+ // Add count to the constraint hierarchy for coverage
+ LOG_addHierarchy("#" + std::to_string(i));
+
+ RBAConstraintInfo* const childInfo {info->getChild(i)};
+ lambda->setRuleObj(obj);
+
+ const bool res {lambda->execute(childInfo, arb)};
+
+ // Remove count from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ if(childInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ isTrue = (isTrue || res);
+ }
+ i++;
+ }
+
+ if (isTrue == true) {
+ // Succeed
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ info->setExceptionBeforeArbitrate(false);
+ return true;
+ } else if (info->isExceptionBeforeArbitrate()) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return false;
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return false;
+ }
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAExistsOperator::getSymbol() const
+{
+ return "Exists";
+}
+
+const std::string
+RBAExistsOperator::getExpressionText() const
+{
+ RBAExpression* exprLhs = getLhsOperand();
+ return getSymbol() + " "
+ + exprLhs->getExpressionText() + " "
+ + getLambda()->getExpressionText();
+}
+
+const std::string
+RBAExistsOperator::getCoverageExpressionText() const
+{
+ getLambda()->clearRuleObj();
+ RBAExpression* exprLhs = getLhsOperand();
+ return getSymbol() + " " +
+ exprLhs->getCoverageExpressionText() + " "
+ + getLambda()->getCoverageExpressionText();
+}
+
+RBAExpressionType
+RBAExistsOperator::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAExistsOperator.hpp b/src/core/expression/RBAExistsOperator.hpp
new file mode 100644
index 0000000..e75af32
--- /dev/null
+++ b/src/core/expression/RBAExistsOperator.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Exists operator Class header file
+ */
+
+#ifndef RBAEXISTSOPERATOR_HPP
+#define RBAEXISTSOPERATOR_HPP
+
+#include "RBALambdaContext.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAExistsOperator : public RBALambdaContext
+{
+public:
+ RBAExistsOperator()=default;
+ RBAExistsOperator(const RBAExistsOperator&)=delete;
+ RBAExistsOperator(const RBAExistsOperator&&)=delete;
+ RBAExistsOperator& operator=(const RBAExistsOperator&)=delete;
+ RBAExistsOperator& operator=(const RBAExistsOperator&&)=delete;
+ virtual ~RBAExistsOperator()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAExistsOperatorMaker.cpp b/src/core/expression/RBAExistsOperatorMaker.cpp
new file mode 100644
index 0000000..eb8250a
--- /dev/null
+++ b/src/core/expression/RBAExistsOperatorMaker.cpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAExistsOperatorMaker.cpp
+/// @brief Exists Operator object maker Class definition
+
+#include "RBAExistsOperatorMaker.hpp"
+#include "RBAExistsOperator.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBALambdaExpression.hpp"
+
+namespace rba
+{
+
+RBAExistsOperatorMaker::RBAExistsOperatorMaker()
+ : RBALambdaContextMaker{"ExistsOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAExistsOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAExistsOperator>();
+}
+
+RBAModelElement*
+RBAExistsOperatorMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(
+ RBALambdaContextMaker::setProperty(element, jsonElem, model, owner));
+
+ return element;
+}
+
+std::unique_ptr<RBALambdaContext>
+RBAExistsOperatorMaker::createLambdaContext()
+{
+ return std::make_unique<RBAExistsOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAExistsOperatorMaker.hpp b/src/core/expression/RBAExistsOperatorMaker.hpp
new file mode 100644
index 0000000..c88f610
--- /dev/null
+++ b/src/core/expression/RBAExistsOperatorMaker.hpp
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAExistsOperatorMaker.hpp
+/// @brief ExistsOperator object maker Class header
+
+#ifndef RBAEXISTSOPERATORMAKER_HPP
+#define RBAEXISTSOPERATORMAKER_HPP
+
+#include "RBALambdaContextMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ExistsOperator object maker Class
+class RBAExistsOperatorMaker : public RBALambdaContextMaker
+{
+public:
+ RBAExistsOperatorMaker();
+ RBAExistsOperatorMaker(const RBAExistsOperatorMaker&)=delete;
+ RBAExistsOperatorMaker(const RBAExistsOperatorMaker&&)=delete;
+ RBAExistsOperatorMaker& operator=(const RBAExistsOperatorMaker&)=delete;
+ RBAExistsOperatorMaker& operator=(const RBAExistsOperatorMaker&&)=delete;
+ virtual ~RBAExistsOperatorMaker()=default;
+
+protected:
+ /// @brief Create empty instance
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set attributes of model element for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model Model for storing created object
+ /// @param[in,out] owner parent object(Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner) override;
+
+ /// @brief Crate empty object of LambdaContext
+ /// @details Create empty object of unique_ptr
+ /// @return unique_ptr for LambdaContext object
+ std::unique_ptr<RBALambdaContext> createLambdaContext() override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAExpression.cpp b/src/core/expression/RBAExpression.cpp
new file mode 100644
index 0000000..2b9b6fc
--- /dev/null
+++ b/src/core/expression/RBAExpression.cpp
@@ -0,0 +1,156 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Expression class definition
+ */
+
+#include "RBAExpression.hpp"
+
+#include "RBALetStatement.hpp"
+#include "RBAConstraintInfo.hpp"
+#ifdef RBA_USE_LOG
+#include "RBAExpressionType.hpp"
+#endif
+
+namespace rba
+{
+
+void RBAExpression::addLetStatement(RBALetStatement* const letStatement)
+{
+ letStatements_.push_back(letStatement);
+}
+
+void
+RBAExpression::accept(RBAExpressionVisitor& visitor)
+{
+ // Not be called because the function of the derived class is called
+}
+
+bool
+RBAExpression::execute(RBAConstraintInfo* const info, RBAArbitrator * const arb) const
+{
+ info->setExpression(this);
+ for (RBALetStatement* const& letStatement : letStatements_) {
+ letStatement->setVariable(arb);
+ }
+ const bool result {executeCore(info, arb)};
+ if (result) {
+ info->setResult(RBAExecuteResult::TRUE);
+ } else {
+ info->setResult(RBAExecuteResult::FALSE);
+ }
+ return result;
+}
+
+bool
+RBAExpression::executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const
+{
+ // This function is called when an Expression that does not define
+ // getReferenceObject() in evaluate() is specified.
+ info->setExceptionBeforeArbitrate(true);
+ return false;
+}
+
+const RBARuleObject*
+RBAExpression::getReferenceObject(RBAConstraintInfo* const info,
+ RBAArbitrator* const arb) const
+{
+ info->setExpression(this);
+ for (RBALetStatement* const& letStatement : letStatements_) {
+ letStatement->setVariable(arb);
+ }
+ return getReferenceObjectCore(info, arb);
+}
+
+const RBARuleObject*
+RBAExpression::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ // This function is called when an Expression that does not define
+ // getReferenceObject() in evaluateObject() is specified.
+ return nullptr;
+}
+
+std::int32_t
+RBAExpression::getValue(RBAConstraintInfo* const info, RBAArbitrator * const arb) const
+{
+ info->setExpression(this);
+ for (RBALetStatement* const& letStatement : letStatements_) {
+ letStatement->setVariable(arb);
+ }
+ return getValueCore(info, arb);
+}
+
+const std::vector<RBALetStatement*>&
+RBAExpression::getLetStatements() const
+{
+ return letStatements_;
+}
+std::int32_t
+RBAExpression::getValueCore(RBAConstraintInfo* info, RBAArbitrator * arb) const
+{
+ // This function is called when an Expression that does not define
+ // getValue() in evaluateValue() is specified.
+ return -99;
+}
+
+void
+RBAExpression::doAction(RBAConstraintInfo* const info, RBAArbitrator* const arb)
+{
+ info->setExpression(this);
+ doActionCore(info, arb);
+ return;
+}
+
+void
+RBAExpression::doActionCore(RBAConstraintInfo* info, RBAArbitrator* arb)
+{
+ // This function is called when an Expression that does not define
+ // doAction() in evaluateDoAction() is specified.
+ return;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAExpression::getExpressionText() const
+{
+ // Not called because the function of the derived class is called
+ return "Unsupported operation exception";
+}
+
+const std::string
+RBAExpression::getCoverageExpressionText() const
+{
+ // Not called because the function of the derived class is called
+ return "Unsupported operation exception";
+}
+
+void
+RBAExpression::createHierarchy()
+{
+ // Not called because the function of the derived class is called
+}
+
+RBAExpressionType
+RBAExpression::getUnderlyingType() const
+{
+ // Not called because the function of the derived class is called
+ return RBAExpressionType::EXCEPTION;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAExpression.hpp b/src/core/expression/RBAExpression.hpp
new file mode 100644
index 0000000..9cd14e5
--- /dev/null
+++ b/src/core/expression/RBAExpression.hpp
@@ -0,0 +1,91 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Expression class header file
+ */
+
+#ifndef RBAEXPRESSION_HPP
+#define RBAEXPRESSION_HPP
+
+#include <cstdint>
+#include <string>
+#include <vector>
+#include "RBAModelElement.hpp"
+
+namespace rba
+{
+
+class RBAExpressionVisitor;
+class RBALetStatement;
+class RBAArbitrator;
+class RBARuleObject;
+class RBAConstraintInfo;
+#ifdef RBA_USE_LOG
+enum class RBAExpressionType : std::uint8_t;
+#endif
+
+class DLL_EXPORT RBAExpression : public RBAModelElement
+{
+protected:
+ RBAExpression()=default;
+ RBAExpression(const RBAExpression&)=delete;
+ RBAExpression(const RBAExpression&&)=delete;
+ RBAExpression& operator=(const RBAExpression&)=delete;
+ RBAExpression& operator=(const RBAExpression&&)=delete;
+
+public:
+ virtual ~RBAExpression()=default;
+ void addLetStatement(RBALetStatement* const letStatement);
+ virtual void accept(RBAExpressionVisitor& visitor);
+ bool execute(RBAConstraintInfo* const info, RBAArbitrator* const arb) const;
+ const RBARuleObject* getReferenceObject(RBAConstraintInfo* const info,
+ RBAArbitrator* const arb) const;
+ std::int32_t getValue(RBAConstraintInfo* const info, RBAArbitrator* const arb) const;
+ void doAction(RBAConstraintInfo* const info, RBAArbitrator* const arb);
+ const std::vector<RBALetStatement*>& getLetStatements() const;
+
+ // Log
+#ifdef RBA_USE_LOG
+ virtual const std::string getExpressionText() const;
+ virtual const std::string getCoverageExpressionText() const;
+ virtual void createHierarchy();
+ virtual RBAExpressionType getUnderlyingType() const;
+#endif
+
+protected:
+ virtual bool executeCore(RBAConstraintInfo* info, RBAArbitrator* arb) const;
+ virtual const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const;
+ virtual std::int32_t getValueCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const;
+ virtual void doActionCore(RBAConstraintInfo* info, RBAArbitrator* arb);
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::vector<RBALetStatement*> letStatements_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAExpressionMaker.cpp b/src/core/expression/RBAExpressionMaker.cpp
new file mode 100644
index 0000000..250ace0
--- /dev/null
+++ b/src/core/expression/RBAExpressionMaker.cpp
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAExpreessionMaker.cpp
+/// @brief Abstract class definition file for expression object generation
+
+#include "RBAExpressionMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBALetStatementMaker.hpp"
+#include "RBALetStatement.hpp"
+
+namespace rba
+{
+
+RBAExpressionMaker::RBAExpressionMaker(const std::string& label)
+ : RBAModelElementMaker{label}
+{
+}
+
+std::int32_t
+RBAExpressionMaker::setLetStatement(RBAModelImpl* const model,
+ RBAExpression* const expr,
+ const RBAJsonElement* const jsonElem)
+{
+ std::int32_t var_num {0};
+ const RBAJsonElement* const letElem {jsonElem->findChildren("letStatements")};
+ if(letElem != nullptr) {
+ RBALetStatementMaker letMaker;
+ letMaker.setFactory(getFactory());
+ for(const auto& param : letElem->getChildren()) {
+ // execute pushVariable() in letMaker::create()
+ RBALetStatement* const letExpr
+ {dynamic_cast<RBALetStatement*>(letMaker.create(param.get(), model))};
+ expr->addLetStatement(letExpr);
+ var_num += 1;
+ }
+ }
+
+ return var_num;
+}
+
+}
diff --git a/src/core/expression/RBAExpressionMaker.hpp b/src/core/expression/RBAExpressionMaker.hpp
new file mode 100644
index 0000000..282a093
--- /dev/null
+++ b/src/core/expression/RBAExpressionMaker.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAExpreessionMaker.hpp
+/// @brief Abstract class definition header file for expression object generation
+
+#ifndef RBAEXPRESSIONMAKER_HPP
+#define RBAEXPRESSIONMAKER_HPP
+
+#include <cstdint>
+#include "RBAModelElementMaker.hpp"
+
+namespace rba
+{
+
+class RBAExpression;
+
+/// @brief Abstract class for expression object gcreation
+class DLL_EXPORT RBAExpressionMaker : public RBAModelElementMaker
+{
+public:
+ explicit RBAExpressionMaker(const std::string& label="");
+ RBAExpressionMaker(const RBAExpressionMaker&)=delete;
+ RBAExpressionMaker(const RBAExpressionMaker&&)=delete;
+ RBAExpressionMaker& operator=(const RBAExpressionMaker&)=delete;
+ RBAExpressionMaker& operator=(const RBAExpressionMaker&&)=delete;
+ virtual ~RBAExpressionMaker()=default;
+
+protected:
+ /// @brief To set ”Let" expression
+ /// @details Generate Let expression from jsonElem and register it in expr.
+ /// Return the number of variables that have been registered
+ /// (pushed) to ModelFactory, and pop them when the reference of
+ /// variables is completed in function that called this function.
+ /// @return the number of pushed variables
+ std::int32_t setLetStatement(RBAModelImpl* model,
+ RBAExpression* expr,
+ const RBAJsonElement* jsonElem);
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAExpressionType.hpp b/src/core/expression/RBAExpressionType.hpp
new file mode 100644
index 0000000..6b6fcd8
--- /dev/null
+++ b/src/core/expression/RBAExpressionType.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Expression type enumeration class header file
+ */
+
+#ifndef RBAEXPRESSIONTYPE_HPP
+#define RBAEXPRESSIONTYPE_HPP
+
+#ifdef RBA_USE_LOG
+
+#include <cstdint>
+
+namespace rba
+{
+
+enum class RBAExpressionType : std::uint8_t
+{
+ VALUE = 0,
+ BOOLEAN,
+ AREA,
+ CONTENT,
+ SET_OF_AREA,
+ SET_OF_CONTENT,
+ LAMBDA,
+ SCENE,
+ ZONE,
+ SET_OF_ZONE,
+ SOUND,
+ SET_OF_SOUND,
+ ACTION,
+ SET_OF_ACTION,
+ PROPERTY,
+ EXTENSION,
+ CONTENT_STATE,
+ EXCEPTION
+};
+
+}
+
+#endif
+#endif
diff --git a/src/core/expression/RBAExpressionVisitor.hpp b/src/core/expression/RBAExpressionVisitor.hpp
new file mode 100644
index 0000000..e678b42
--- /dev/null
+++ b/src/core/expression/RBAExpressionVisitor.hpp
@@ -0,0 +1,168 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Expression visitor class header file
+ */
+
+#ifndef RBAEXPRESSIONVISITOR_HPP
+#define RBAEXPRESSIONVISITOR_HPP
+
+namespace rba {
+class RBAIsDisplayed;
+class RBADisplayingContent;
+class RBAAllocatedContent;
+class RBAIsHidden;
+class RBAContentValue;
+class RBAGetContentsList;
+class RBAIsActive;
+class RBAIsVisible;
+class RBAStateValue;
+class RBAHasBeenDisplayed;
+class RBAHasComeEarlierThan;
+class RBAHasComeLaterThan;
+class RBAGetAllocatables;
+class RBAIsOutputted;
+class RBAOutputtingSound;
+class RBAIsMuted;
+class RBAIsAttenuated;
+class RBAIsSounding;
+class RBAIsOn;
+class RBAGetProperty;
+class RBAAndOperator;
+class RBAOrOperator;
+class RBANotOperator;
+class RBAImpliesOperator;
+class RBAIsEqualToOperator;
+class RBAObjectCompare;
+class RBAIsGreaterThanOperator;
+class RBAIsGreaterThanEqualOperator;
+class RBAIsLowerThanOperator;
+class RBAIsLowerThanEqualOperator;
+class RBAForAllOperator;
+class RBAExistsOperator;
+class RBAAllInstanceOfArea;
+class RBAAllInstanceOfViewContent;
+class RBAAllInstanceOfZone;
+class RBAAllInstanceOfSoundContent;
+class RBAIfStatement;
+class RBALetStatement;
+class RBAPreviousModifier;
+class RBAActiveState;
+class RBAActiveContents;
+class RBAMaxOperator;
+class RBAMinOperator;
+class RBASelectOperator;
+class RBASizeOperator;
+class RBAObjectReference;
+class RBASetOfOperator;
+class RBAIsTypeOfOperator;
+
+class RBAExpressionVisitor {
+ public:
+ RBAExpressionVisitor()=default;
+ RBAExpressionVisitor(const RBAExpressionVisitor&)=delete;
+ RBAExpressionVisitor(const RBAExpressionVisitor&&)=delete;
+ RBAExpressionVisitor& operator=(const RBAExpressionVisitor&)=delete;
+ RBAExpressionVisitor& operator=(const RBAExpressionVisitor&&)=delete;
+ virtual ~RBAExpressionVisitor() = default;
+
+ // Refer to Area status
+ virtual void visit(RBAIsDisplayed& exp) = 0;
+ virtual void visit(RBADisplayingContent& exp) = 0;
+ virtual void visit(RBAAllocatedContent& exp) = 0;
+ virtual void visit(RBAIsHidden& exp) = 0;
+ virtual void visit(RBAContentValue& exp) = 0;
+ virtual void visit(RBAGetContentsList& exp) = 0;
+ virtual void visit(RBAActiveContents& exp) = 0;
+
+ // Refer to display content status
+ virtual void visit(RBAIsActive& exp) = 0;
+ virtual void visit(RBAIsVisible& exp) = 0;
+ virtual void visit(RBAStateValue& exp) = 0;
+ virtual void visit(RBAHasBeenDisplayed& exp) = 0;
+ virtual void visit(RBAHasComeEarlierThan& exp) = 0;
+ virtual void visit(RBAHasComeLaterThan& exp) = 0;
+ virtual void visit(RBAGetAllocatables& exp) = 0;
+ virtual void visit(RBAActiveState& exp) = 0;
+
+ // Refer to Zone status
+ virtual void visit(RBAIsOutputted& exp) = 0;
+ virtual void visit(RBAOutputtingSound& exp) = 0;
+ // allocatedContent is common with Area
+ virtual void visit(RBAIsMuted& exp) = 0;
+ virtual void visit(RBAIsAttenuated& exp) = 0;
+ // contentValue is common with Area
+ // contentsList is common with Area
+
+ // Refer to sound content status
+ // isActive is common with display content
+ virtual void visit(RBAIsSounding& exp) = 0;
+ // stateValue is common with display content
+ // hasComeEarlierThan is common with display content
+ // hasComeLaterThan is common with display content
+ // allocatables is common with display content
+ // activeState is common with display content
+
+ // Refer to Scene
+ virtual void visit(RBAIsOn& exp) = 0;
+ virtual void visit(RBAGetProperty& exp) = 0;
+
+ virtual void visit(RBAIsTypeOfOperator& exp) = 0;
+
+ // Operators
+ virtual void visit(RBAAndOperator& exp) = 0;
+ virtual void visit(RBAOrOperator& exp) = 0;
+ virtual void visit(RBANotOperator& exp) = 0;
+ virtual void visit(RBAImpliesOperator& exp) = 0;
+ virtual void visit(RBAIsEqualToOperator& exp) = 0;
+ virtual void visit(RBAObjectCompare& exp) = 0;
+ virtual void visit(RBAIsGreaterThanOperator& exp) = 0;
+ virtual void visit(RBAIsGreaterThanEqualOperator& exp) = 0;
+ virtual void visit(RBAIsLowerThanOperator& exp) = 0;
+ virtual void visit(RBAIsLowerThanEqualOperator& exp) = 0;
+
+ // Quantification symbol
+ virtual void visit(RBAForAllOperator& exp) = 0;
+ virtual void visit(RBAExistsOperator& exp) = 0;
+
+ // Built-in definition expression
+ virtual void visit(RBAAllInstanceOfArea& exp) = 0;
+ virtual void visit(RBAAllInstanceOfViewContent& exp) = 0;
+ virtual void visit(RBAAllInstanceOfZone& exp) = 0;
+ virtual void visit(RBAAllInstanceOfSoundContent& exp) = 0;
+
+ // Syntax
+ virtual void visit(RBAIfStatement& exp) = 0;
+ virtual void visit(RBALetStatement& exp) = 0;
+
+ // Modifier
+ virtual void visit(RBAPreviousModifier& exp) = 0;
+
+ // Set operator
+ virtual void visit(RBAMaxOperator& exp) = 0;
+ virtual void visit(RBAMinOperator& exp) = 0;
+ virtual void visit(RBASelectOperator& exp) = 0;
+ virtual void visit(RBASizeOperator& exp) = 0;
+
+ // Object references
+ virtual void visit(RBAObjectReference& exp) = 0;
+ virtual void visit(RBASetOfOperator& exp) = 0;
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAForAllOperator.cpp b/src/core/expression/RBAForAllOperator.cpp
new file mode 100644
index 0000000..93a2894
--- /dev/null
+++ b/src/core/expression/RBAForAllOperator.cpp
@@ -0,0 +1,173 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ForAll operator class
+ */
+
+#include "RBAForAllOperator.hpp"
+
+#include "RBAAllocatable.hpp"
+#include "RBAAllocatableSet.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentSet.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALambdaExpression.hpp"
+#include "RBALogManager.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAForAllOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAForAllOperator::getModelElementType() const
+{
+ return RBAModelElementType::ForAllOperator;
+}
+
+bool
+RBAForAllOperator::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator * arb) const
+{
+ const RBAExpression* const setObj {getLhsOperand()};
+ RBALambdaExpression* const lambda {getLambda()};
+
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+
+ // get Rule object and loop
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+
+ std::vector<const RBARuleObject*> objs;
+ const RBARuleObject* const ruleObj {setObj->getReferenceObject(leftInfo, arb)};
+ const RBARuleObject* objset {nullptr};
+ if (ruleObj != nullptr) {
+ objset = ruleObj->getRawObject();
+ }
+
+ if(leftInfo->isExceptionBeforeArbitrate() || (objset == nullptr)) {
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ info->setExceptionBeforeArbitrate(true);
+ return false;
+ }
+ if (dynamic_cast<const RBAAllocatableSet*>(objset) != nullptr) {
+ objs.clear();
+ for(const RBAAllocatable* alloc
+ : dynamic_cast<const RBAAllocatableSet*>(objset)->getLeafAllocatable()) {
+ objs.push_back(alloc);
+ }
+ }
+ else {
+ objs.clear();
+ for(const auto& cont : dynamic_cast<const RBAContentSet*>(objset)->getLeafContent() ){
+ objs.push_back(cont);
+ }
+ }
+
+ bool isTrue {true};
+ std::uint32_t i {0U};
+ for(const RBARuleObject* const obj : objs) {
+ // Add count to the constraint hierarchy for coverage
+ LOG_addHierarchy("#" + std::to_string(i));
+
+ RBAConstraintInfo* const childInfo {info->getChild(i)};
+ lambda->setRuleObj(obj);
+
+ const bool res {lambda->execute(childInfo, arb)};
+
+ // Remove count from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ if(childInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ isTrue = (isTrue && res);
+ }
+ i++;
+ }
+
+ if (isTrue == false) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ // Remove count from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ info->setExceptionBeforeArbitrate(false);
+ return false;
+ } else if (info->isExceptionBeforeArbitrate()) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ // Remove count from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return false;
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ // Remove count from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return true;
+ }
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAForAllOperator::getSymbol() const
+{
+ return "For All";
+}
+
+const std::string
+RBAForAllOperator::getExpressionText() const
+{
+ RBAExpression* exprLhs = getLhsOperand();
+ return getSymbol() + " "
+ + exprLhs->getExpressionText() + " "
+ + getLambda()->getExpressionText();
+}
+
+const std::string
+RBAForAllOperator::getCoverageExpressionText() const
+{
+ getLambda()->clearRuleObj();
+ RBAExpression* exprLhs = getLhsOperand();
+ return getSymbol() + " "
+ + exprLhs->getCoverageExpressionText() + " "
+ + getLambda()->getCoverageExpressionText();
+}
+
+RBAExpressionType
+RBAForAllOperator::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAForAllOperator.hpp b/src/core/expression/RBAForAllOperator.hpp
new file mode 100644
index 0000000..7c0c7cc
--- /dev/null
+++ b/src/core/expression/RBAForAllOperator.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ForAll operator class header file
+ */
+
+#ifndef RBAFORALLOPERATOR_HPP
+#define RBAFORALLOPERATOR_HPP
+
+#include "RBALambdaContext.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAForAllOperator : public RBALambdaContext
+{
+public:
+ RBAForAllOperator()=default;
+ RBAForAllOperator(const RBAForAllOperator&)=delete;
+ RBAForAllOperator(const RBAForAllOperator&&)=delete;
+ RBAForAllOperator& operator=(const RBAForAllOperator&)=delete;
+ RBAForAllOperator& operator=(const RBAForAllOperator&&)=delete;
+ virtual ~RBAForAllOperator()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAForAllOperatorMaker.cpp b/src/core/expression/RBAForAllOperatorMaker.cpp
new file mode 100644
index 0000000..eb1068d
--- /dev/null
+++ b/src/core/expression/RBAForAllOperatorMaker.cpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAForAllOperatorMaker.cpp
+/// @brief ForAllOperator object generation class
+
+#include "RBAForAllOperatorMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAForAllOperator.hpp"
+#include "RBALambdaExpression.hpp"
+
+namespace rba
+{
+
+RBAForAllOperatorMaker::RBAForAllOperatorMaker()
+ : RBALambdaContextMaker{"ForAllOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAForAllOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAForAllOperator>();
+}
+
+RBAModelElement*
+RBAForAllOperatorMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(
+ RBALambdaContextMaker::setProperty(element, jsonElem, model, owner));
+
+ return element;
+}
+
+std::unique_ptr<RBALambdaContext>
+RBAForAllOperatorMaker::createLambdaContext()
+{
+ return std::make_unique<RBAForAllOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAForAllOperatorMaker.hpp b/src/core/expression/RBAForAllOperatorMaker.hpp
new file mode 100644
index 0000000..9c5de92
--- /dev/null
+++ b/src/core/expression/RBAForAllOperatorMaker.hpp
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAForAllOperatorMaker.hpp
+/// @brief ForAllOperator object generation class header
+
+#ifndef RBAFORALLOPERATORMAKER_HPP
+#define RBAFORALLOPERATORMAKER_HPP
+
+#include "RBALambdaContextMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ForAllOperator object generation class
+class RBAForAllOperatorMaker : public RBALambdaContextMaker
+{
+public:
+ RBAForAllOperatorMaker();
+ RBAForAllOperatorMaker(const RBAForAllOperatorMaker&)=delete;
+ RBAForAllOperatorMaker(const RBAForAllOperatorMaker&&)=delete;
+ RBAForAllOperatorMaker& operator=(const RBAForAllOperatorMaker&)=delete;
+ RBAForAllOperatorMaker& operator=(const RBAForAllOperatorMaker&&)=delete;
+ virtual ~RBAForAllOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model M\model to store the generated object
+ /// @param[in,out] owner parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+ /// @brief generate an empty object of LambdaContext
+ /// @details generate an empty object of unique_ptr in a derived class
+ /// @return unique_ptr for LambdaContext object
+ std::unique_ptr<RBALambdaContext> createLambdaContext() override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAGetAllocatables.cpp b/src/core/expression/RBAGetAllocatables.cpp
new file mode 100644
index 0000000..8494a01
--- /dev/null
+++ b/src/core/expression/RBAGetAllocatables.cpp
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * GetAllocatables class definition file
+ */
+
+#include "RBAGetAllocatables.hpp"
+
+#include "RBAContent.hpp"
+#include "RBAAllocatableSet.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAGetAllocatables::accept(RBAExpressionVisitor& visitor)
+{
+ // This path is not used, because RBASceneAllocatableCollector,
+ // the only existing visitor as of now, does not accept content.
+ // But, keep this because another visitor may accept, in the future.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAGetAllocatables::getModelElementType() const
+{
+ return RBAModelElementType::GetAllocatables;
+}
+
+const RBARuleObject*
+RBAGetAllocatables::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+
+ const RBARuleObject* const ruleObj
+ {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+ const RBAContent* content {nullptr};
+ if (ruleObj != nullptr) {
+ content = dynamic_cast<const RBAContent*>(ruleObj->getRawObject());
+ }
+
+ if (content == nullptr) {
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ return nullptr;
+ }
+
+ return content->getAllocatableSet();
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAGetAllocatables::getSymbol() const
+{
+ return ".allocatables()";
+}
+
+const std::string
+RBAGetAllocatables::getExpressionText() const
+{
+ return getLhsOperand()->getExpressionText() + getSymbol();
+}
+
+// At the moment, the arbitration FW cannot write a constraint expression
+// to call createHierarchy() of GetAllocatables,
+// so it does not go through this path.
+// But, defined this for maintainability (especially expandability.
+void
+RBAGetAllocatables::createHierarchy()
+{
+ // No operation because it does not affect structure.
+}
+
+#endif
+
+}
diff --git a/src/core/expression/RBAGetAllocatables.hpp b/src/core/expression/RBAGetAllocatables.hpp
new file mode 100644
index 0000000..d1c7167
--- /dev/null
+++ b/src/core/expression/RBAGetAllocatables.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * GetAllocatables class header file
+ */
+
+#ifndef RBAGETALLOCATABLES_HPP
+#define RBAGETALLOCATABLES_HPP
+
+#include "RBAContentOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAGetAllocatables : public RBAContentOperator
+{
+public:
+ RBAGetAllocatables()=default;
+ RBAGetAllocatables(const RBAGetAllocatables&)=delete;
+ RBAGetAllocatables(const RBAGetAllocatables&&)=delete;
+ RBAGetAllocatables& operator=(const RBAGetAllocatables&)=delete;
+ RBAGetAllocatables& operator=(const RBAGetAllocatables&&)=delete;
+ virtual ~RBAGetAllocatables()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ void createHierarchy() override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAGetAllocatablesMaker.cpp b/src/core/expression/RBAGetAllocatablesMaker.cpp
new file mode 100644
index 0000000..aac81a2
--- /dev/null
+++ b/src/core/expression/RBAGetAllocatablesMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAGetAllocatablesMaker.cpp
+/// @brief GetAllocatables object generation class definition
+
+#include "RBAGetAllocatablesMaker.hpp"
+#include "RBAGetAllocatables.hpp"
+
+namespace rba
+{
+
+RBAGetAllocatablesMaker::RBAGetAllocatablesMaker()
+ : RBAOperatorMaker{"GetAllocatables"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAGetAllocatablesMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAGetAllocatables>();
+}
+
+}
diff --git a/src/core/expression/RBAGetAllocatablesMaker.hpp b/src/core/expression/RBAGetAllocatablesMaker.hpp
new file mode 100644
index 0000000..722845f
--- /dev/null
+++ b/src/core/expression/RBAGetAllocatablesMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAGetAllocatablesMaker.hpp
+/// @brief GetAllocatables object generation class header file
+
+#ifndef RBAGETALLOCATABLESMAKER_HPP
+#define RBAGETALLOCATABLESMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief GetAllocatables object gneration class
+class RBAGetAllocatablesMaker : public RBAOperatorMaker
+{
+public:
+ RBAGetAllocatablesMaker();
+ RBAGetAllocatablesMaker(const RBAGetAllocatablesMaker&)=delete;
+ RBAGetAllocatablesMaker(const RBAGetAllocatablesMaker&&)=delete;
+ RBAGetAllocatablesMaker& operator=(const RBAGetAllocatablesMaker&)=delete;
+ RBAGetAllocatablesMaker& operator=(const RBAGetAllocatablesMaker&&)=delete;
+ virtual ~RBAGetAllocatablesMaker()=default;
+
+protected:
+ /// @brief Generate an empty instance
+ /// @details Generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAGetContentsList.cpp b/src/core/expression/RBAGetContentsList.cpp
new file mode 100644
index 0000000..5f14b33
--- /dev/null
+++ b/src/core/expression/RBAGetContentsList.cpp
@@ -0,0 +1,86 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * GetContentsList class definition file
+ */
+
+#include "RBAGetContentsList.hpp"
+
+#include "RBAAllocatable.hpp"
+#include "RBAContentSet.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void RBAGetContentsList::accept(RBAExpressionVisitor& visitor)
+{
+ // This path is not used, because RBASceneAllocatableCollector,
+ // the only existing visitor as of now, does not accept content.
+ // But, keep this because another visitor may accept, in the future.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAGetContentsList::getModelElementType() const
+{
+ return RBAModelElementType::GetContentsList;
+}
+
+const RBARuleObject*
+RBAGetContentsList::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+
+ const RBARuleObject* const ruleObj
+ {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+ const RBAAllocatable* allocatable {nullptr};
+ if (ruleObj != nullptr) {
+ allocatable = dynamic_cast<const RBAAllocatable*>(ruleObj->getRawObject());
+ }
+ // Indicates whether the content referenced by this constraint expression
+ // is the result of the previous arbitration result.
+
+ if (leftInfo->isExceptionBeforeArbitrate() || (allocatable == nullptr)) {
+ // As of now, this path is not used due to the following reasons.
+ // - The expression below GetContentsList is before arbitration
+ // - Constraint expression that returns null as allocatable
+ // can not be described(specified)
+ // But, defined this for maintainability (especially expandability).
+ info->setExceptionBeforeArbitrate(true);
+ return nullptr;
+ }
+
+ return allocatable->getContentSet();
+}
+
+#ifdef RBA_USE_LOG
+// At the moment, the arbitration FW cannot write a constraint expression
+// to call createHierarchy() of GetContentsList,
+// so it does not go through this path.
+// But, defined this for maintainability (especially expandability.
+void
+RBAGetContentsList::createHierarchy()
+{
+ // No operation because it does not affect structure.
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAGetContentsList.hpp b/src/core/expression/RBAGetContentsList.hpp
new file mode 100644
index 0000000..240a50c
--- /dev/null
+++ b/src/core/expression/RBAGetContentsList.hpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * GetContentsList class header file
+ */
+
+#ifndef RBAGETCONTENTSLIST_HPP
+#define RBAGETCONTENTSLIST_HPP
+
+#include "RBAAllocatableOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAGetContentsList : public RBAAllocatableOperator
+{
+public:
+ RBAGetContentsList()=default;
+ RBAGetContentsList(const RBAGetContentsList&)=delete;
+ RBAGetContentsList(const RBAGetContentsList&&)=delete;
+ RBAGetContentsList& operator=(const RBAGetContentsList&)=delete;
+ RBAGetContentsList& operator=(const RBAGetContentsList&&)=delete;
+ virtual ~RBAGetContentsList()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ void createHierarchy() override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAGetContentsListMaker.cpp b/src/core/expression/RBAGetContentsListMaker.cpp
new file mode 100644
index 0000000..2081e2d
--- /dev/null
+++ b/src/core/expression/RBAGetContentsListMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAGetContentsListMaker.cpp
+/// @brief GetContentsList object generation class definition file
+
+#include "RBAGetContentsListMaker.hpp"
+#include "RBAGetContentsList.hpp"
+
+namespace rba
+{
+
+RBAGetContentsListMaker::RBAGetContentsListMaker()
+ : RBAOperatorMaker{"GetContentsList"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAGetContentsListMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAGetContentsList>();
+}
+
+}
diff --git a/src/core/expression/RBAGetContentsListMaker.hpp b/src/core/expression/RBAGetContentsListMaker.hpp
new file mode 100644
index 0000000..c703f68
--- /dev/null
+++ b/src/core/expression/RBAGetContentsListMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAGetContentsListMaker.hpp
+/// @brief GetContentsList object generation class header file
+
+#ifndef RBAGETCONTENTSLISTMAKER_HPP
+#define RBAGETCONTENTSLISTMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief GetContentsList object generation class
+class RBAGetContentsListMaker : public RBAOperatorMaker
+{
+public:
+ RBAGetContentsListMaker();
+ RBAGetContentsListMaker(const RBAGetContentsListMaker&)=delete;
+ RBAGetContentsListMaker(const RBAGetContentsListMaker&&)=delete;
+ RBAGetContentsListMaker& operator=(const RBAGetContentsListMaker&)=delete;
+ RBAGetContentsListMaker& operator=(const RBAGetContentsListMaker&&)=delete;
+ virtual ~RBAGetContentsListMaker()=default;
+
+protected:
+ /// @brief Generate an empty instance
+ /// @details Generate an empty class of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAGetProperty.cpp b/src/core/expression/RBAGetProperty.cpp
new file mode 100644
index 0000000..3a774d8
--- /dev/null
+++ b/src/core/expression/RBAGetProperty.cpp
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBAGetProperty class defintino file
+ */
+
+#include "RBAGetProperty.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBASceneImpl.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBALogManager.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAAbstractProperty.hpp"
+
+namespace rba
+{
+
+void
+RBAGetProperty::accept(RBAExpressionVisitor& visitor)
+{
+ // This path is not used, because RBASceneAllocatableCollector,
+ // the only existing visitor as of now, does not accept content.
+ // But, keep this because another visitor may accept, in the future.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAGetProperty::getModelElementType() const
+{
+ return RBAModelElementType::GetProperty;
+}
+
+std::int32_t
+RBAGetProperty::getValueCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ std::int32_t value{0};
+ const RBAAbstractProperty* prop{nullptr};
+ const RBARuleObject* const ruleObj {getLhsOperand()->getReferenceObject(info, arb)};
+ if(ruleObj->isPrevious()) {
+ prop = dynamic_cast<const RBAAbstractProperty*>(ruleObj->getRawObject());
+ value = arb->getResult()->getPreSceneProperty(prop);
+ }
+ else {
+ prop = dynamic_cast<const RBAAbstractProperty*>(ruleObj);
+ value = arb->getResult()->getSceneProperty(prop);
+ }
+ LOG_arbitrateConstraintLogicLogLine(" "
+ + getPreMsg(ruleObj->isPrevious())
+ + "Property["
+ + prop->getScene()->getElementName()
+ + "::"
+ + prop->getElementName()
+ + "] get["
+ + std::to_string(value)
+ + "]");
+ return value;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAGetProperty::getSymbol() const
+{
+ return ".get()";
+}
+
+const std::string
+RBAGetProperty::getExpressionText() const
+{
+ return getLhsOperand()->getExpressionText() + getSymbol();
+}
+
+const std::string
+RBAGetProperty::getCoverageExpressionText() const
+{
+ return getExpressionText();
+}
+
+RBAExpressionType
+RBAGetProperty::getUnderlyingType() const
+{
+ return RBAExpressionType::VALUE;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAGetProperty.hpp b/src/core/expression/RBAGetProperty.hpp
new file mode 100644
index 0000000..eff3852
--- /dev/null
+++ b/src/core/expression/RBAGetProperty.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBAGetProperty Class
+ */
+
+#ifndef RBAGETPROPERTY_HPP
+#define RBAGETPROPERTY_HPP
+
+#include "RBAPropertyOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAGetProperty : public RBAPropertyOperator
+{
+public:
+ RBAGetProperty()=default;
+ RBAGetProperty(const RBAGetProperty&)=delete;
+ RBAGetProperty(const RBAGetProperty&&)=delete;
+ RBAGetProperty& operator=(const RBAGetProperty&)=delete;
+ RBAGetProperty& operator=(const RBAGetProperty&&)=delete;
+ virtual ~RBAGetProperty()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ std::int32_t getValueCore(RBAConstraintInfo* info,
+ RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAGetPropertyMaker.cpp b/src/core/expression/RBAGetPropertyMaker.cpp
new file mode 100644
index 0000000..f2588ad
--- /dev/null
+++ b/src/core/expression/RBAGetPropertyMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAGetPropertyMaker.cpp
+/// @brief GetProperty object generation class defintion file
+
+#include "RBAGetPropertyMaker.hpp"
+#include "RBAGetProperty.hpp"
+
+namespace rba
+{
+
+RBAGetPropertyMaker::RBAGetPropertyMaker()
+ : RBAOperatorMaker{"GetProperty"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAGetPropertyMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAGetProperty>();
+}
+
+}
diff --git a/src/core/expression/RBAGetPropertyMaker.hpp b/src/core/expression/RBAGetPropertyMaker.hpp
new file mode 100644
index 0000000..db20ce1
--- /dev/null
+++ b/src/core/expression/RBAGetPropertyMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAGetPropertyMaker.hpp
+/// @brief GetProperty object generation class heeader file
+
+#ifndef RBAGETPROPERTYMAKER_HPP
+#define RBAGETPROPERTYMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief GetProperty object generation class
+class RBAGetPropertyMaker : public RBAOperatorMaker
+{
+public:
+ RBAGetPropertyMaker();
+ RBAGetPropertyMaker(const RBAGetPropertyMaker&)=delete;
+ RBAGetPropertyMaker(const RBAGetPropertyMaker&&)=delete;
+ RBAGetPropertyMaker& operator=(const RBAGetPropertyMaker&)=delete;
+ RBAGetPropertyMaker& operator=(const RBAGetPropertyMaker&&)=delete;
+ virtual ~RBAGetPropertyMaker()=default;
+
+protected:
+ /// @brief Generate an empty instance
+ /// @details Generate an empty class of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAHasBeenDisplayed.cpp b/src/core/expression/RBAHasBeenDisplayed.cpp
new file mode 100644
index 0000000..72c1d40
--- /dev/null
+++ b/src/core/expression/RBAHasBeenDisplayed.cpp
@@ -0,0 +1,102 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * .hasBeenDisplayed() definition
+ **/
+
+#include "RBAHasBeenDisplayed.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAContent.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+
+namespace rba
+{
+
+void RBAHasBeenDisplayed::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType RBAHasBeenDisplayed::getModelElementType() const
+{
+ return RBAModelElementType::HasBeenDisplayed;
+}
+
+bool RBAHasBeenDisplayed::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj {getLhsOperand()->getReferenceObject(leftInfo,
+ arb)};
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (ruleObj != nullptr) {
+ const RBAContent* const c {
+ dynamic_cast<const RBAContent*>(ruleObj->getRawObject())};
+ if (!ruleObj->isPrevious()) {
+ isPassed = arb->getResult()->hasBeenDisplayed(c);
+ } else {
+ isPassed = arb->getResult()->hasBeenPreDisplayed(c);
+ }
+ } else {
+ ;
+ }
+#ifdef RBA_USE_LOG
+ RBAExecuteResult r;
+ std::string cname;
+ std::string resultStr;
+ if (ruleObj != nullptr) {
+ cname = ruleObj->getRawObject()->getElementName();
+ } else {
+ cname = "NULL";
+ }
+ if (info->isExceptionBeforeArbitrate()) {
+ resultStr = " before arbitrate skip";
+ r = RBAExecuteResult::SKIP;
+ } else if (isPassed) {
+ resultStr = " true";
+ r = RBAExecuteResult::TRUE;
+ } else {
+ resultStr = " false";
+ r = RBAExecuteResult::FALSE;
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " Content[" + cname + "]" + getSymbol() + resultStr);
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(), r);
+#endif
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+// Log
+#ifdef RBA_USE_LOG
+const std::string RBAHasBeenDisplayed::getSymbol() const
+{
+ return ".hasBeenDisplayed()";
+}
+RBAExpressionType RBAHasBeenDisplayed::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+} /* namespace rba */
diff --git a/src/core/expression/RBAHasBeenDisplayed.hpp b/src/core/expression/RBAHasBeenDisplayed.hpp
new file mode 100644
index 0000000..3e3ebde
--- /dev/null
+++ b/src/core/expression/RBAHasBeenDisplayed.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// .hasBeenDisplayed() header file
+//
+
+#ifndef RBAHASBEENDISPLAYED_HPP
+#define RBAHASBEENDISPLAYED_HPP
+
+#include "RBAContentOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAHasBeenDisplayed : public RBAContentOperator
+{
+ public:
+ RBAHasBeenDisplayed()=default;
+ RBAHasBeenDisplayed(const RBAHasBeenDisplayed&)=delete;
+ RBAHasBeenDisplayed(const RBAHasBeenDisplayed&&)=delete;
+ RBAHasBeenDisplayed& operator=(const RBAHasBeenDisplayed&)=delete;
+ RBAHasBeenDisplayed& operator=(const RBAHasBeenDisplayed&&)=delete;
+ virtual ~RBAHasBeenDisplayed()=default;
+
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator* arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+};
+
+} /* namespace rba */
+
+#endif /* RBAHASBEENDISPLAYED_HPP */
diff --git a/src/core/expression/RBAHasBeenDisplayedMaker.cpp b/src/core/expression/RBAHasBeenDisplayedMaker.cpp
new file mode 100644
index 0000000..36aeecc
--- /dev/null
+++ b/src/core/expression/RBAHasBeenDisplayedMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAHasBeenDisplayedMaker.cpp
+/// @brief HasBeenDisplayed object generation class defintion file
+
+#include "RBAHasBeenDisplayedMaker.hpp"
+#include "RBAHasBeenDisplayed.hpp"
+
+namespace rba
+{
+
+RBAHasBeenDisplayedMaker::RBAHasBeenDisplayedMaker()
+ : RBAOperatorMaker{"HasBeenDisplayed"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAHasBeenDisplayedMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAHasBeenDisplayed>();
+}
+
+}
diff --git a/src/core/expression/RBAHasBeenDisplayedMaker.hpp b/src/core/expression/RBAHasBeenDisplayedMaker.hpp
new file mode 100644
index 0000000..5e9bc10
--- /dev/null
+++ b/src/core/expression/RBAHasBeenDisplayedMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAHasBeenDisplayedMaker.hpp
+/// @brief HasBeenDisplayed object generation class header file
+
+#ifndef RBAHASBEENDISPLAYEDMAKER_HPP
+#define RBAHASBEENDISPLAYEDMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief HasBeenDisplayed object generation class
+class RBAHasBeenDisplayedMaker : public RBAOperatorMaker
+{
+public:
+ RBAHasBeenDisplayedMaker();
+ RBAHasBeenDisplayedMaker(const RBAHasBeenDisplayedMaker&)=delete;
+ RBAHasBeenDisplayedMaker(const RBAHasBeenDisplayedMaker&&)=delete;
+ RBAHasBeenDisplayedMaker& operator=(const RBAHasBeenDisplayedMaker&)=delete;
+ RBAHasBeenDisplayedMaker& operator=(const RBAHasBeenDisplayedMaker&&)=delete;
+ virtual ~RBAHasBeenDisplayedMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instancce of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAHasComeEarlierThan.cpp b/src/core/expression/RBAHasComeEarlierThan.cpp
new file mode 100644
index 0000000..4b5482a
--- /dev/null
+++ b/src/core/expression/RBAHasComeEarlierThan.cpp
@@ -0,0 +1,151 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * HasComeEarlierThan class
+ */
+
+#include "RBAHasComeEarlierThan.hpp"
+#include "RBAContent.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+RBAModelElementType
+RBAHasComeEarlierThan::getModelElementType() const
+{
+ return RBAModelElementType::HasComeEarlier;
+}
+
+void RBAHasComeEarlierThan::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+bool
+RBAHasComeEarlierThan::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+
+ bool isResult {false};
+ // Get content in left side of the expression
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* ruleObj {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+ const RBAContent* contentLhs {nullptr};
+ if(ruleObj != nullptr) {
+ contentLhs = dynamic_cast<const RBAContent*>(ruleObj->getRawObject());
+ }
+
+ // Get content in right hand side of the expression
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ ruleObj = getRhsOperand()->getReferenceObject(rightInfo, arb);
+ const RBAContent* contentRhs {nullptr};
+ if(ruleObj != nullptr) {
+ contentRhs = dynamic_cast<const RBAContent*>(ruleObj->getRawObject());
+ }
+
+ if((contentLhs == nullptr) || (contentRhs == nullptr)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ if (!((arb->getResult()->isActive(contentLhs))
+ && (arb->getResult()->isActive(contentRhs)))) {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ else if(contentLhs == contentRhs) {
+ isResult = false;
+ }
+ else {
+ isResult = !arb->getResult()->isLater(contentLhs, contentRhs);
+ }
+ }
+#ifdef RBA_USE_LOG
+ std::string lhsName;
+ std::string rhsName;
+ std::string resultText;
+ if(contentLhs == nullptr) {
+ lhsName = "NULL";
+ } else {
+ lhsName = contentLhs->getElementName();
+ }
+ if (contentRhs == nullptr) {
+ rhsName = "NULL";
+ } else {
+ rhsName = contentRhs->getElementName();
+ }
+ if (info->isExceptionBeforeArbitrate() == true ) {
+ resultText = "is before arbitrate skip";
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else {
+ resultText = RBALogManager::boolToString(isResult);
+ if(isResult) {
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ }
+ else {
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " Content[" + lhsName + "] has come earlier than Content[" + rhsName + "] " + resultText);
+#endif
+ // Remove itself from constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isResult;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAHasComeEarlierThan::getSymbol() const
+{
+ return ".hasComeEarlierThan";
+}
+
+const std::string
+RBAHasComeEarlierThan::getExpressionText() const
+{
+ RBAExpression* exprLhs = getLhsOperand();
+ RBAExpression* exprRhs = getRhsOperand();
+ return exprLhs->getExpressionText() + getSymbol()
+ + "(" + exprRhs->getExpressionText() + ")";
+}
+
+const std::string
+RBAHasComeEarlierThan::getCoverageExpressionText() const
+{
+ RBAExpression* exprLhs = getLhsOperand();
+ RBAExpression* exprRhs = getRhsOperand();
+ return exprLhs->getCoverageExpressionText() + getSymbol()
+ + "(" + exprRhs->getCoverageExpressionText() + ")";
+}
+
+RBAExpressionType
+RBAHasComeEarlierThan::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAHasComeEarlierThan.hpp b/src/core/expression/RBAHasComeEarlierThan.hpp
new file mode 100644
index 0000000..fd39782
--- /dev/null
+++ b/src/core/expression/RBAHasComeEarlierThan.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * HasComeEarlierThan class header file
+ */
+
+#ifndef RBAHASCOMEEARLIERTHAN_HPP
+#define RBAHASCOMEEARLIERTHAN_HPP
+
+#include "RBAContentOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAHasComeEarlierThan : public RBAContentOperator
+{
+public:
+ RBAHasComeEarlierThan()=default;
+ RBAHasComeEarlierThan(const RBAHasComeEarlierThan&)=delete;
+ RBAHasComeEarlierThan(const RBAHasComeEarlierThan&&)=delete;
+ RBAHasComeEarlierThan& operator=(const RBAHasComeEarlierThan&)=delete;
+ RBAHasComeEarlierThan& operator=(const RBAHasComeEarlierThan&&)=delete;
+ virtual ~RBAHasComeEarlierThan()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator* arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAHasComeEarlierThanMaker.cpp b/src/core/expression/RBAHasComeEarlierThanMaker.cpp
new file mode 100644
index 0000000..fb5eb08
--- /dev/null
+++ b/src/core/expression/RBAHasComeEarlierThanMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAHasComeEarlierThanMaker.cpp
+/// @brief HasComeEarlierThan object generation class definition file
+
+#include "RBAHasComeEarlierThanMaker.hpp"
+#include "RBAHasComeEarlierThan.hpp"
+
+namespace rba
+{
+
+RBAHasComeEarlierThanMaker::RBAHasComeEarlierThanMaker()
+ : RBAOperatorMaker{"HasComeEarlierThan"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAHasComeEarlierThanMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAHasComeEarlierThan>();
+}
+
+}
diff --git a/src/core/expression/RBAHasComeEarlierThanMaker.hpp b/src/core/expression/RBAHasComeEarlierThanMaker.hpp
new file mode 100644
index 0000000..256a4ea
--- /dev/null
+++ b/src/core/expression/RBAHasComeEarlierThanMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAHasComeEarlierThanMaker.hpp
+/// @brief HasComeEarlierThan object generation class header
+
+#ifndef RBAHASCOMEEARLIERTHANMAKER_HPP
+#define RBAHASCOMEEARLIERTHANMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief HasComeEarlierThan object generation class
+class RBAHasComeEarlierThanMaker : public RBAOperatorMaker
+{
+public:
+ RBAHasComeEarlierThanMaker();
+ RBAHasComeEarlierThanMaker(const RBAHasComeEarlierThanMaker&)=delete;
+ RBAHasComeEarlierThanMaker(const RBAHasComeEarlierThanMaker&&)=delete;
+ RBAHasComeEarlierThanMaker& operator=(const RBAHasComeEarlierThanMaker&)=delete;
+ RBAHasComeEarlierThanMaker& operator=(const RBAHasComeEarlierThanMaker&&)=delete;
+ virtual ~RBAHasComeEarlierThanMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAHasComeLaterThan.cpp b/src/core/expression/RBAHasComeLaterThan.cpp
new file mode 100644
index 0000000..341d164
--- /dev/null
+++ b/src/core/expression/RBAHasComeLaterThan.cpp
@@ -0,0 +1,153 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * HasComeLaterThan class
+ */
+
+#include "RBAHasComeLaterThan.hpp"
+
+#include "RBAContent.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void RBAHasComeLaterThan::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAHasComeLaterThan::getModelElementType() const
+{
+ return RBAModelElementType::HasComeLater;
+}
+
+bool
+RBAHasComeLaterThan::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+
+ bool isResult {false};
+ // pop the Content of left hand side expresion
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* ruleObj {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+ const RBAContent* contentLhs {nullptr};
+ if(ruleObj != nullptr) {
+ contentLhs = dynamic_cast<const RBAContent*>(ruleObj->getRawObject());
+ }
+
+ // pop the Content of left hand side expresion
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ ruleObj = getRhsOperand()->getReferenceObject(rightInfo, arb);
+ const RBAContent* contentRhs {nullptr};
+ if(ruleObj != nullptr) {
+ contentRhs = dynamic_cast<const RBAContent*>(ruleObj->getRawObject());
+ }
+
+ if((contentLhs == nullptr) || (contentRhs == nullptr)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ if (!((arb->getResult()->isActive(contentLhs))
+ && (arb->getResult()->isActive(contentRhs)))) {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ else if(contentLhs == contentRhs) {
+ isResult = false;
+ }
+ else {
+ isResult = arb->getResult()->isLater(contentLhs, contentRhs);
+ }
+ }
+#ifdef RBA_USE_LOG
+ std::string lhsName;
+ std::string rhsName;
+ std::string resultText;
+ if(contentLhs == nullptr) {
+ lhsName = "NULL";
+ } else {
+ lhsName = contentLhs->getElementName();
+ }
+ if (contentRhs == nullptr) {
+ rhsName = "NULL";
+ } else {
+ rhsName = contentRhs->getElementName();
+ }
+ if (info->isExceptionBeforeArbitrate() == true ) {
+ resultText = "is before arbitrate skip";
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else {
+ resultText = RBALogManager::boolToString(isResult);
+ if(isResult) {
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ }
+ else {
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " Content[" + lhsName + "] has come later than Content[" + rhsName + "] " + resultText);
+#endif
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ return isResult;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAHasComeLaterThan::getSymbol() const
+{
+ return ".hasComeLaterThan";
+}
+
+const std::string
+RBAHasComeLaterThan::getExpressionText() const
+{
+ RBAExpression* exprLhs = getLhsOperand();
+ RBAExpression* exprRhs = getRhsOperand();
+ return exprLhs->getExpressionText() + getSymbol()
+ + "(" + exprRhs->getExpressionText() + ")";
+}
+
+const std::string
+RBAHasComeLaterThan::getCoverageExpressionText() const
+{
+ RBAExpression* exprLhs = getLhsOperand();
+ RBAExpression* exprRhs = getRhsOperand();
+ return exprLhs->getCoverageExpressionText() + getSymbol()
+ + "(" + exprRhs->getCoverageExpressionText() + ")";
+}
+
+RBAExpressionType
+RBAHasComeLaterThan::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAHasComeLaterThan.hpp b/src/core/expression/RBAHasComeLaterThan.hpp
new file mode 100644
index 0000000..659068f
--- /dev/null
+++ b/src/core/expression/RBAHasComeLaterThan.hpp
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * HasComeLaterThan class
+ */
+
+#ifndef RBAHASCOMELATERTHAN_HPP
+#define RBAHASCOMELATERTHAN_HPP
+
+#include "RBAContentOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAHasComeLaterThan : public RBAContentOperator
+{
+public:
+ RBAHasComeLaterThan()=default;
+ RBAHasComeLaterThan(const RBAHasComeLaterThan&)=delete;
+ RBAHasComeLaterThan(const RBAHasComeLaterThan&&)=delete;
+ RBAHasComeLaterThan& operator=(const RBAHasComeLaterThan&)=delete;
+ RBAHasComeLaterThan& operator=(const RBAHasComeLaterThan&&)=delete;
+ virtual ~RBAHasComeLaterThan()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator* arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAHasComeLaterThanMaker.cpp b/src/core/expression/RBAHasComeLaterThanMaker.cpp
new file mode 100644
index 0000000..2b49835
--- /dev/null
+++ b/src/core/expression/RBAHasComeLaterThanMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAHasComeLaterThanMaker.cpp
+/// @brief HasComeLaterThan object generation class definitino file
+
+#include "RBAHasComeLaterThanMaker.hpp"
+#include "RBAHasComeLaterThan.hpp"
+
+namespace rba
+{
+
+RBAHasComeLaterThanMaker::RBAHasComeLaterThanMaker()
+ : RBAOperatorMaker{"HasComeLaterThan"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAHasComeLaterThanMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAHasComeLaterThan>();
+}
+
+}
diff --git a/src/core/expression/RBAHasComeLaterThanMaker.hpp b/src/core/expression/RBAHasComeLaterThanMaker.hpp
new file mode 100644
index 0000000..16a42c3
--- /dev/null
+++ b/src/core/expression/RBAHasComeLaterThanMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAHasComeLaterThanMaker.hpp
+/// @brief HasComeLaterThan object generation class header file
+
+#ifndef RBAHASCOMELATERTHANMAKER_HPP
+#define RBAHASCOMELATERTHANMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief HasComeLaterThan object generation class
+class RBAHasComeLaterThanMaker : public RBAOperatorMaker
+{
+public:
+ RBAHasComeLaterThanMaker();
+ RBAHasComeLaterThanMaker(const RBAHasComeLaterThanMaker&)=delete;
+ RBAHasComeLaterThanMaker(const RBAHasComeLaterThanMaker&&)=delete;
+ RBAHasComeLaterThanMaker& operator=(const RBAHasComeLaterThanMaker&)=delete;
+ RBAHasComeLaterThanMaker& operator=(const RBAHasComeLaterThanMaker&&)=delete;
+ virtual ~RBAHasComeLaterThanMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIfStatement.cpp b/src/core/expression/RBAIfStatement.cpp
new file mode 100644
index 0000000..d776bf7
--- /dev/null
+++ b/src/core/expression/RBAIfStatement.cpp
@@ -0,0 +1,268 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * If statement class defintion file
+ */
+
+#include <sstream>
+#include "RBAIfStatement.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAIfStatement::setCondition(RBAExpression* const expr)
+{
+ condition_ = expr;
+}
+
+void
+RBAIfStatement::setThenExpression(RBAExpression* const expr)
+{
+ thenExpression_ = expr;
+}
+
+void
+RBAIfStatement::setElseExpression(RBAExpression* const expr)
+{
+ elseExpression_ = expr;
+}
+
+RBAExpression* const
+RBAIfStatement::getCondition() const
+{
+ return condition_;
+}
+
+RBAExpression* const
+RBAIfStatement::getThenExpression() const
+{
+ return thenExpression_;
+}
+
+RBAExpression* const
+RBAIfStatement::getElseExpression() const
+{
+ return elseExpression_;
+}
+
+void
+RBAIfStatement::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIfStatement::getModelElementType() const
+{
+ return RBAModelElementType::IfStatement;
+}
+
+bool
+RBAIfStatement::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ LOG_addHierarchy("IF");
+ bool isPassed;
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ LOG_addHierarchy("#condition:");
+ const bool cond {getCondition()->execute(leftInfo, arb)};
+ LOG_removeHierarchy();
+ if (cond == true) {
+ LOG_addHierarchy("#then:");
+ isPassed = getThenExpression()->execute(rightInfo, arb);
+ LOG_removeHierarchy();
+ } else {
+ LOG_addHierarchy("#else:");
+ isPassed = getElseExpression()->execute(rightInfo, arb);
+ LOG_removeHierarchy();
+ }
+ if ((leftInfo->isExceptionBeforeArbitrate() == true)
+ || (rightInfo->isExceptionBeforeArbitrate() == true)) {
+ info->setExceptionBeforeArbitrate(true);
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+#ifdef RBA_USE_LOG
+ } else if (isPassed == true) {
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+#endif
+ }
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+const RBARuleObject*
+RBAIfStatement::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ LOG_addHierarchy("IF");
+ const RBARuleObject* object {nullptr};
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ LOG_addHierarchy("#condition:");
+ const bool cond {getCondition()->execute(leftInfo, arb)};
+ LOG_removeHierarchy();
+ if (cond == true) {
+ LOG_addHierarchy("#then:");
+ object = getThenExpression()->getReferenceObject(rightInfo, arb);
+ LOG_removeHierarchy();
+ } else {
+ LOG_addHierarchy("#else:");
+ object = getElseExpression()->getReferenceObject(rightInfo, arb);
+ LOG_removeHierarchy();
+ if ((leftInfo->isExceptionBeforeArbitrate() == true)
+ || (rightInfo->isExceptionBeforeArbitrate() == true)) {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ }
+ LOG_removeHierarchy();
+ return object;
+}
+
+std::int32_t
+RBAIfStatement::getValueCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ LOG_addHierarchy("IF");
+ std::int32_t value;
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ LOG_addHierarchy("#condition:");
+ const bool cond {getCondition()->execute(leftInfo, arb)};
+ LOG_removeHierarchy();
+ if (cond == true) {
+ LOG_addHierarchy("#then:");
+ value = getThenExpression()->getValue(rightInfo, arb);
+ LOG_removeHierarchy();
+ } else {
+ LOG_addHierarchy("#else:");
+ value = getElseExpression()->getValue(rightInfo, arb);
+ LOG_removeHierarchy();
+ if ((leftInfo->isExceptionBeforeArbitrate() == true)
+ || (rightInfo->isExceptionBeforeArbitrate() == true)) {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ }
+ LOG_removeHierarchy();
+ return value;
+}
+
+void
+RBAIfStatement::doActionCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb)
+{
+ LOG_addHierarchy("IF");
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ LOG_addHierarchy("#condition:");
+ const bool cond {getCondition()->execute(leftInfo, arb)};
+ LOG_removeHierarchy();
+ if (cond == true) {
+ LOG_addHierarchy("#then:");
+ getThenExpression()->doAction(rightInfo, arb);
+ LOG_removeHierarchy();
+ } else {
+ LOG_addHierarchy("#else:");
+ getElseExpression()->doAction(rightInfo, arb);
+ LOG_removeHierarchy();
+ }
+#ifdef RBA_USE_LOG
+ LOG_coverageConstraintExpressionLog2(LOG_getCoverageExpressionText());
+#endif
+ LOG_removeHierarchy();
+ return;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIfStatement::getExpressionText() const
+{
+ std::ostringstream oss;
+ oss << "IF(";
+ oss << condition_->getExpressionText();
+ oss << ") THEN ";
+ oss << thenExpression_->getExpressionText();
+ oss << " ELSE ";
+ oss << elseExpression_->getExpressionText();
+
+ return oss.str();
+}
+
+const std::string
+RBAIfStatement::getCoverageExpressionText() const
+{
+ std::ostringstream oss;
+ oss << "IF(";
+ oss << condition_->getCoverageExpressionText();
+ oss << ") THEN ";
+ oss << thenExpression_->getCoverageExpressionText();
+ oss << " ELSE ";
+ oss << elseExpression_->getCoverageExpressionText();
+
+ return oss.str();
+}
+
+void
+RBAIfStatement::createHierarchy()
+{
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy("IF");
+ RBALogManager::coverageHierarchyOfConstraintExpressionLog(getCoverageExpressionText(),
+ this);
+
+ // Add condition to the constraint hierarchy for coverage
+ LOG_addHierarchy("#condition:");
+ condition_->createHierarchy();
+ // Remove condtion from to the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ if(thenExpression_) {
+ // Add "then" to the constraint hierarchy for coverage
+ LOG_addHierarchy("#then:");
+ thenExpression_->createHierarchy();
+ // Remove "then" from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ }
+
+ if(elseExpression_) {
+ // Add "else" to the constraint hierarchy for coverage
+ LOG_addHierarchy("#else:");
+ elseExpression_->createHierarchy();
+ // Remove "else" from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ }
+
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+}
+
+RBAExpressionType
+RBAIfStatement::getUnderlyingType() const
+{
+ return thenExpression_->getUnderlyingType();
+}
+#endif
+}
diff --git a/src/core/expression/RBAIfStatement.hpp b/src/core/expression/RBAIfStatement.hpp
new file mode 100644
index 0000000..7059583
--- /dev/null
+++ b/src/core/expression/RBAIfStatement.hpp
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * If statement class header file
+ */
+
+#ifndef RBAIFSTATEMENT_HPP
+#define RBAIFSTATEMENT_HPP
+
+#include "RBAExpression.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAIfStatement : public RBAExpression
+{
+public:
+ RBAIfStatement()=default;
+ RBAIfStatement(const RBAIfStatement&)=delete;
+ RBAIfStatement(const RBAIfStatement&&)=delete;
+ RBAIfStatement& operator=(const RBAIfStatement&)=delete;
+ RBAIfStatement& operator=(const RBAIfStatement&&)=delete;
+ virtual ~RBAIfStatement()=default;
+
+public:
+ void setCondition(RBAExpression* const expr);
+ void setThenExpression(RBAExpression* const expr);
+ void setElseExpression(RBAExpression* const expr);
+ RBAExpression* const getCondition() const;
+ RBAExpression* const getThenExpression() const;
+ RBAExpression* const getElseExpression() const;
+
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator* arb) const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+ std::int32_t getValueCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+ void doActionCore(RBAConstraintInfo* info, RBAArbitrator* arb) override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ void createHierarchy() override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+ private:
+ RBAExpression* condition_ {nullptr};
+ RBAExpression* thenExpression_ {nullptr};
+ RBAExpression* elseExpression_ {nullptr};
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIfStatementMaker.cpp b/src/core/expression/RBAIfStatementMaker.cpp
new file mode 100644
index 0000000..b878ada
--- /dev/null
+++ b/src/core/expression/RBAIfStatementMaker.cpp
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIfStatementMaker.cpp
+/// @brief IfStatement object generation class definition file
+
+#include "RBAIfStatementMaker.hpp"
+#include "RBAIfStatement.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAIfStatementMaker::RBAIfStatementMaker()
+ : RBAExpressionMaker{"IfStatement"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIfStatementMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIfStatement>();
+}
+
+RBAModelElement*
+RBAIfStatementMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBAIfStatement* const ifstmt {dynamic_cast<RBAIfStatement*>(element)};
+
+ // Set LetStatement
+ const std::int32_t pop_num {setLetStatement(model, ifstmt, jsonElem)};
+
+ // Set condition
+ const RBAJsonElement* const condElem {jsonElem->findChildren("condition")};
+ RBAModelElement* const condExpr
+ {getFactory()->createElement(condElem->getClassName(), condElem)};
+ ifstmt->setCondition(dynamic_cast<RBAExpression*>(condExpr));
+ // Set "then"
+ const RBAJsonElement* const thenElem {jsonElem->findChildren("thenExpression")};
+ RBAModelElement* thenExpr {nullptr};
+ if(thenElem != nullptr) {
+ thenExpr = getFactory()->createElement(thenElem->getClassName(), thenElem);
+ }
+ ifstmt->setThenExpression(dynamic_cast<RBAExpression*>(thenExpr));
+ // Set "else"
+ const RBAJsonElement* const elseElem {jsonElem->findChildren("elseExpression")};
+ RBAModelElement* elseExpr {nullptr};
+ if(elseElem != nullptr) {
+ elseExpr = getFactory()->createElement(elseElem->getClassName(), elseElem);
+ }
+ ifstmt->setElseExpression(dynamic_cast<RBAExpression*>(elseExpr));
+
+ // Pop variable
+ for(std::int32_t i{0}; i<pop_num; i++) {
+ getFactory()->popVariable();
+ }
+
+ return ifstmt;
+}
+
+}
diff --git a/src/core/expression/RBAIfStatementMaker.hpp b/src/core/expression/RBAIfStatementMaker.hpp
new file mode 100644
index 0000000..57a4133
--- /dev/null
+++ b/src/core/expression/RBAIfStatementMaker.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIfStatementMaker.hpp
+/// @brief IfStatement object generation class header file
+
+#ifndef RBAIFSTATEMENTMAKER_HPP
+#define RBAIFSTATEMENTMAKER_HPP
+
+#include "RBAExpressionMaker.hpp"
+
+namespace rba
+{
+
+/// @brief IfStatement object generation class
+class RBAIfStatementMaker : public RBAExpressionMaker
+{
+public:
+ RBAIfStatementMaker();
+ RBAIfStatementMaker(const RBAIfStatementMaker&)=delete;
+ RBAIfStatementMaker(const RBAIfStatementMaker&&)=delete;
+ RBAIfStatementMaker& operator=(const RBAIfStatementMaker&)=delete;
+ RBAIfStatementMaker& operator=(const RBAIfStatementMaker&&)=delete;
+ virtual ~RBAIfStatementMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief set property of Model Element for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model Model for storing generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAImpliesOperator.cpp b/src/core/expression/RBAImpliesOperator.cpp
new file mode 100644
index 0000000..ab95dc7
--- /dev/null
+++ b/src/core/expression/RBAImpliesOperator.cpp
@@ -0,0 +1,145 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * implication operator class defintion file
+ */
+
+#include "RBAImpliesOperator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAImpliesOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAImpliesOperator::getModelElementType() const
+{
+ return RBAModelElementType::ImpliesOperator;
+}
+
+bool
+RBAImpliesOperator::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ // Add "left-hand side formula" to the constraint hierarchy for coverage
+ LOG_addHierarchy("#left");
+ const bool lhsRes {getLhsOperand()->execute(leftInfo, arb)};
+ // Remove "left-hand side formula" from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ if (leftInfo->isExceptionBeforeArbitrate() == false) {
+ if (lhsRes == false) {
+ isPassed = true;
+ } else {
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ // Add "right-hand side formula" to the constraint hierarchy for coverage
+ LOG_addHierarchy("#right");
+ const bool rhsRes {getRhsOperand()->execute(rightInfo, arb)};
+ // Remove "right-hand side formula"
+ // from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ if (rightInfo->isExceptionBeforeArbitrate() == true) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (rhsRes == true) {
+ isPassed = true;
+ } else {
+ ;
+ }
+ }
+ } else {
+ info->setExceptionBeforeArbitrate(true);
+ // Evaluate the right-hand side fromula
+ // to get the right side allocatable of arbitration target
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ // Add "right-hand side formula" to the constraint hierarchy for coverage
+ LOG_addHierarchy("#right");
+ static_cast<void>(getRhsOperand()->execute(rightInfo, arb));
+ // Remove "right-hand side formula" to the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate()) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAImpliesOperator::getSymbol() const
+{
+ return "->";
+}
+
+void
+RBAImpliesOperator::createHierarchy()
+{
+ RBAExpression* exprLhs = getLhsOperand();
+ RBAExpression* exprRhs = getRhsOperand();
+
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy(getSymbol());
+ RBALogManager::coverageHierarchyOfConstraintExpressionLog(getCoverageExpressionText(), this);
+
+ // Add "left-hand side formula" to the constraint hierarchy for coverage
+ LOG_addHierarchy("#left");
+ exprLhs->createHierarchy();
+ // Remove "left-hand side formula" from
+ // the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ // Add "right-hand side formula" to the constraint hierarchy for coverage
+ LOG_addHierarchy("#right");
+ exprRhs->createHierarchy();
+ // Remove "right-hand side formula" from
+ // the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAImpliesOperator.hpp b/src/core/expression/RBAImpliesOperator.hpp
new file mode 100644
index 0000000..cc1cb33
--- /dev/null
+++ b/src/core/expression/RBAImpliesOperator.hpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * implication operator class defintion file
+ */
+
+#ifndef RBAIMPLIESOPERATOR_HPP
+#define RBAIMPLIESOPERATOR_HPP
+
+#include "RBALogicalOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAImpliesOperator: public RBALogicalOperator
+{
+public:
+ RBAImpliesOperator()=default;
+ RBAImpliesOperator(const RBAImpliesOperator&)=delete;
+ RBAImpliesOperator(const RBAImpliesOperator&&)=delete;
+ RBAImpliesOperator& operator=(const RBAImpliesOperator&)=delete;
+ RBAImpliesOperator& operator=(const RBAImpliesOperator&&)=delete;
+ virtual ~RBAImpliesOperator()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ void createHierarchy() override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAImpliesOperatorMaker.cpp b/src/core/expression/RBAImpliesOperatorMaker.cpp
new file mode 100644
index 0000000..00b35fa
--- /dev/null
+++ b/src/core/expression/RBAImpliesOperatorMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAImpliesOperatorMaker.cpp
+/// @brief ImpliesOperator object generation class definition file
+
+#include "RBAImpliesOperatorMaker.hpp"
+#include "RBAImpliesOperator.hpp"
+
+namespace rba
+{
+
+RBAImpliesOperatorMaker::RBAImpliesOperatorMaker()
+ : RBAOperatorMaker{"ImpliesOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAImpliesOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAImpliesOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAImpliesOperatorMaker.hpp b/src/core/expression/RBAImpliesOperatorMaker.hpp
new file mode 100644
index 0000000..466d36a
--- /dev/null
+++ b/src/core/expression/RBAImpliesOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAImpliesOperatorMaker.hpp
+/// @brief ImpliesOperator object generation class header file
+
+#ifndef RBAIMPLIEDOPERATORMAKER_HPP
+#define RBAIMPLIEDOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ImpliesOperator object generation class
+class RBAImpliesOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBAImpliesOperatorMaker();
+ RBAImpliesOperatorMaker(const RBAImpliesOperatorMaker&)=delete;
+ RBAImpliesOperatorMaker(const RBAImpliesOperatorMaker&&)=delete;
+ RBAImpliesOperatorMaker& operator=(const RBAImpliesOperatorMaker&)=delete;
+ RBAImpliesOperatorMaker& operator=(const RBAImpliesOperatorMaker&&)=delete;
+ virtual ~RBAImpliesOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIntegerValue.cpp b/src/core/expression/RBAIntegerValue.cpp
new file mode 100644
index 0000000..aadffb0
--- /dev/null
+++ b/src/core/expression/RBAIntegerValue.cpp
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Integer value class definition file
+ */
+
+#include "RBAIntegerValue.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+
+namespace rba
+{
+
+void
+RBAIntegerValue::setValue(const std::int32_t value)
+{
+ value_ = value;
+}
+
+std::int32_t
+RBAIntegerValue::getValue() const
+{
+ return value_;
+}
+
+RBAModelElementType
+RBAIntegerValue::getModelElementType() const
+{
+ return RBAModelElementType::IntegerValue;
+}
+
+std::int32_t
+RBAIntegerValue::getValueCore(RBAConstraintInfo* info, RBAArbitrator * arb) const
+{
+ return getValue();
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIntegerValue::getExpressionText() const
+{
+ return std::to_string(value_);
+}
+
+const std::string
+RBAIntegerValue::getCoverageExpressionText() const
+{
+ return getExpressionText();
+}
+
+void
+RBAIntegerValue::createHierarchy()
+{
+ // No opration
+ // because there is no hierarchy below this expression
+}
+
+RBAExpressionType
+RBAIntegerValue::getUnderlyingType() const
+{
+ return RBAExpressionType::VALUE;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAIntegerValue.hpp b/src/core/expression/RBAIntegerValue.hpp
new file mode 100644
index 0000000..44cf8cb
--- /dev/null
+++ b/src/core/expression/RBAIntegerValue.hpp
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Integer value class
+ */
+
+#ifndef RBAINTEGERVALUE_HPP
+#define RBAINTEGERVALUE_HPP
+
+#include "RBAValueExpression.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAIntegerValue : public RBAValueExpression
+{
+public:
+ RBAIntegerValue()=default;
+ RBAIntegerValue(const RBAIntegerValue&)=delete;
+ RBAIntegerValue(const RBAIntegerValue&&)=delete;
+ RBAIntegerValue& operator=(const RBAIntegerValue&)=delete;
+ RBAIntegerValue& operator=(const RBAIntegerValue&&)=delete;
+ virtual ~RBAIntegerValue()=default;
+
+public:
+ void setValue(const std::int32_t value);
+
+ std::int32_t getValue() const;
+ RBAModelElementType getModelElementType() const override;
+ std::int32_t getValueCore(RBAConstraintInfo* info,
+ RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ void createHierarchy() override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+ private:
+ std::int32_t value_ {0};
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIntegerValueMaker.cpp b/src/core/expression/RBAIntegerValueMaker.cpp
new file mode 100644
index 0000000..19a21eb
--- /dev/null
+++ b/src/core/expression/RBAIntegerValueMaker.cpp
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIntegerValueMaker.cpp
+/// @brief IntegerValue object generation class definition file
+
+#include "RBAIntegerValueMaker.hpp"
+#include "RBAIntegerValue.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAIntegerValueMaker::RBAIntegerValueMaker()
+ : RBAExpressionMaker{"IntegerValue"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIntegerValueMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIntegerValue>();
+}
+
+RBAModelElement*
+RBAIntegerValueMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBAIntegerValue* const intVal {dynamic_cast<RBAIntegerValue*>(element)};
+
+ // Set LetStatement
+ const std::int32_t pop_num {setLetStatement(model, intVal, jsonElem)};
+
+ // Set value
+ const RBAJsonElement* const valueElem {jsonElem->findChildren("value")};
+ intVal->setValue(stoi(valueElem->getString()));
+
+ // Pop variable
+ for(std::int32_t i{0}; i<pop_num; i++) {
+ getFactory()->popVariable();
+ }
+
+ return intVal;
+}
+
+}
diff --git a/src/core/expression/RBAIntegerValueMaker.hpp b/src/core/expression/RBAIntegerValueMaker.hpp
new file mode 100644
index 0000000..0f637df
--- /dev/null
+++ b/src/core/expression/RBAIntegerValueMaker.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIntegerValueMaker.hpp
+/// @brief IntegerValue object generation class header file
+
+#ifndef RBAINTEGERVALUEMAKER_HPP
+#define RBAINTEGERVALUEMAKER_HPP
+
+#include "RBAExpressionMaker.hpp"
+
+namespace rba
+{
+
+/// @brief IntegerValue object generation class
+class RBAIntegerValueMaker : public RBAExpressionMaker
+{
+public:
+ RBAIntegerValueMaker();
+ RBAIntegerValueMaker(const RBAIntegerValueMaker&)=delete;
+ RBAIntegerValueMaker(const RBAIntegerValueMaker&&)=delete;
+ RBAIntegerValueMaker& operator=(const RBAIntegerValueMaker&)=delete;
+ RBAIntegerValueMaker& operator=(const RBAIntegerValueMaker&&)=delete;
+ virtual ~RBAIntegerValueMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief set property of Model Element for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model Model for storing generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsActive.cpp b/src/core/expression/RBAIsActive.cpp
new file mode 100644
index 0000000..a89745f
--- /dev/null
+++ b/src/core/expression/RBAIsActive.cpp
@@ -0,0 +1,113 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * IsActive class definition
+ */
+
+#include "RBAIsActive.hpp"
+#include "RBAContent.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void RBAIsActive::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsActive::getModelElementType() const
+{
+ return RBAModelElementType::IsActive;
+}
+
+bool
+RBAIsActive::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj
+ {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+ if (leftInfo->isExceptionBeforeArbitrate() == true) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (ruleObj != nullptr) {
+ const RBAContent* const content {dynamic_cast<const RBAContent*>(ruleObj->getRawObject())};
+ if (ruleObj->isPrevious()) {
+ isPassed = arb->getResult()->isPreActive(content);
+ } else {
+ isPassed = arb->getResult()->isActive(content);
+ }
+ } else {
+ ;
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " Content[NULL] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (ruleObj != nullptr) {
+ const RBAContent* content = dynamic_cast<const RBAContent*>(ruleObj
+ ->getRawObject());
+ if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Content["
+ + content->getElementName() + "] is Active");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Content["
+ + content->getElementName() + "] is not Active");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(" Content[NULL] is not Active");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsActive::getSymbol() const
+{
+ return ".isActive()";
+}
+
+RBAExpressionType
+RBAIsActive::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAIsActive.hpp b/src/core/expression/RBAIsActive.hpp
new file mode 100644
index 0000000..73ab055
--- /dev/null
+++ b/src/core/expression/RBAIsActive.hpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * IsActive class header file
+ */
+
+#ifndef RBAISACTIVE_HPP
+#define RBAISACTIVE_HPP
+
+#include "RBAContentOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAIsActive : public RBAContentOperator
+{
+public:
+ RBAIsActive()=default;
+ RBAIsActive(const RBAIsActive&)=delete;
+ RBAIsActive(const RBAIsActive&&)=delete;
+ RBAIsActive& operator=(const RBAIsActive&)=delete;
+ RBAIsActive& operator=(const RBAIsActive&&)=delete;
+ virtual ~RBAIsActive()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsActiveMaker.cpp b/src/core/expression/RBAIsActiveMaker.cpp
new file mode 100644
index 0000000..6b2e7ee
--- /dev/null
+++ b/src/core/expression/RBAIsActiveMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsActiveMaker.cpp
+/// @brief IsActive object generation class defintion file
+
+#include "RBAIsActiveMaker.hpp"
+#include "RBAIsActive.hpp"
+
+namespace rba
+{
+
+RBAIsActiveMaker::RBAIsActiveMaker()
+ : RBAOperatorMaker{"IsActive"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsActiveMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsActive>();
+}
+
+}
diff --git a/src/core/expression/RBAIsActiveMaker.hpp b/src/core/expression/RBAIsActiveMaker.hpp
new file mode 100644
index 0000000..15011fb
--- /dev/null
+++ b/src/core/expression/RBAIsActiveMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsActiveMaker.hpp
+/// @brief IsActive object generation class heaer file
+
+#ifndef RBAISACTIVEMAKER_HPP
+#define RBAISACTIVEMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief IsActive object generation class
+class RBAIsActiveMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsActiveMaker();
+ RBAIsActiveMaker(const RBAIsActiveMaker&)=delete;
+ RBAIsActiveMaker(const RBAIsActiveMaker&&)=delete;
+ RBAIsActiveMaker& operator=(const RBAIsActiveMaker&)=delete;
+ RBAIsActiveMaker& operator=(const RBAIsActiveMaker&&)=delete;
+ virtual ~RBAIsActiveMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsEqualToOperator.cpp b/src/core/expression/RBAIsEqualToOperator.cpp
new file mode 100644
index 0000000..5dfa929
--- /dev/null
+++ b/src/core/expression/RBAIsEqualToOperator.cpp
@@ -0,0 +1,105 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// IsEqualToOperator class definitino file
+
+#include "RBAIsEqualToOperator.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAIsEqualToOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsEqualToOperator::getModelElementType() const
+{
+ return RBAModelElementType::IsEqualToOperator;
+}
+
+bool
+RBAIsEqualToOperator::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ const std::int32_t lhsVal {getLhsOperand()->getValue(leftInfo, arb)};
+ const std::int32_t rhsVal {getRhsOperand()->getValue(rightInfo, arb)};
+ if ((leftInfo->isExceptionBeforeArbitrate() == true)
+ || (rightInfo->isExceptionBeforeArbitrate() == true)
+ || (lhsVal == -99)
+ || (rhsVal == -99)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ if (lhsVal == rhsVal) {
+ isPassed = true;
+ info->addTrueAllocatableFromOperand();
+ } else {
+ info->addFalseAllocatableFromOperand();
+ }
+ }
+
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (lhsVal == rhsVal) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsEqualToOperator::getSymbol() const
+{
+ return "=";
+}
+
+RBAExpressionType
+RBAIsEqualToOperator::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAIsEqualToOperator.hpp b/src/core/expression/RBAIsEqualToOperator.hpp
new file mode 100644
index 0000000..d66efed
--- /dev/null
+++ b/src/core/expression/RBAIsEqualToOperator.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// IsEqualToOperator class header file
+
+#ifndef RBAISEQUALTOOPERATOR_HPP
+#define RBAISEQUALTOOPERATOR_HPP
+
+#include "RBALogicalOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAIsEqualToOperator : public RBALogicalOperator
+{
+public:
+ RBAIsEqualToOperator()=default;
+ RBAIsEqualToOperator(const RBAIsEqualToOperator&)=delete;
+ RBAIsEqualToOperator(RBAIsEqualToOperator&&)=delete;
+ RBAIsEqualToOperator& operator=(const RBAIsEqualToOperator&)=delete;
+ RBAIsEqualToOperator& operator=(RBAIsEqualToOperator&&)=delete;
+ virtual ~RBAIsEqualToOperator()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsEqualToOperatorMaker.cpp b/src/core/expression/RBAIsEqualToOperatorMaker.cpp
new file mode 100644
index 0000000..32717ce
--- /dev/null
+++ b/src/core/expression/RBAIsEqualToOperatorMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsEqualToOperatorMaker.cpp
+/// @brief IsEqualToOperator object generation file
+
+#include "RBAIsEqualToOperatorMaker.hpp"
+#include "RBAIsEqualToOperator.hpp"
+
+namespace rba
+{
+
+RBAIsEqualToOperatorMaker::RBAIsEqualToOperatorMaker()
+ : RBAOperatorMaker{"IsEqualToOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsEqualToOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsEqualToOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAIsEqualToOperatorMaker.hpp b/src/core/expression/RBAIsEqualToOperatorMaker.hpp
new file mode 100644
index 0000000..9d0fa30
--- /dev/null
+++ b/src/core/expression/RBAIsEqualToOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsEqualToOperatorMaker.hpp
+/// @brief IsEqualToOperator object generation file
+
+#ifndef RBAISEQUALTOOPERATORMAKER_HPP
+#define RBAISEQUALTOOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief IsEqualToOperator object generation class
+class RBAIsEqualToOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsEqualToOperatorMaker();
+ RBAIsEqualToOperatorMaker(const RBAIsEqualToOperatorMaker&)=delete;
+ RBAIsEqualToOperatorMaker(const RBAIsEqualToOperatorMaker&&)=delete;
+ RBAIsEqualToOperatorMaker& operator=(const RBAIsEqualToOperatorMaker&)=delete;
+ RBAIsEqualToOperatorMaker& operator=(const RBAIsEqualToOperatorMaker&&)=delete;
+ virtual ~RBAIsEqualToOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsGreaterThanEqualOperator.cpp b/src/core/expression/RBAIsGreaterThanEqualOperator.cpp
new file mode 100644
index 0000000..368bb3b
--- /dev/null
+++ b/src/core/expression/RBAIsGreaterThanEqualOperator.cpp
@@ -0,0 +1,105 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// IsGreaterThanEqualOperator class definition file
+
+#include "RBAIsGreaterThanEqualOperator.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAIsGreaterThanEqualOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsGreaterThanEqualOperator::getModelElementType() const
+{
+ return RBAModelElementType::IsGreaterThanEqualOperator;
+}
+
+bool
+RBAIsGreaterThanEqualOperator::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ const std::int32_t lhsVal {getLhsOperand()->getValue(leftInfo, arb)};
+ const std::int32_t rhsVal {getRhsOperand()->getValue(rightInfo, arb)};
+ // If a pre-arbitration exception occurs on either the left side
+ // or the right side in the reference, throw it higher
+ if ((leftInfo->isExceptionBeforeArbitrate() == true)
+ || (rightInfo->isExceptionBeforeArbitrate() == true)
+ || (lhsVal == -99)
+ || (rhsVal == -99)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ if (lhsVal >= rhsVal) {
+ isPassed = true;
+ info->addTrueAllocatableFromOperand();
+ } else {
+ info->addFalseAllocatableFromOperand();
+ }
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsGreaterThanEqualOperator::getSymbol() const
+{
+ return ">=";
+}
+
+RBAExpressionType
+RBAIsGreaterThanEqualOperator::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAIsGreaterThanEqualOperator.hpp b/src/core/expression/RBAIsGreaterThanEqualOperator.hpp
new file mode 100644
index 0000000..0d5db61
--- /dev/null
+++ b/src/core/expression/RBAIsGreaterThanEqualOperator.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// IsGreaterThanEqualOperator class header file
+
+#ifndef RBAISGREATERTHANEQUALOPERATOR_HPP
+#define RBAISGREATERTHANEQUALOPERATOR_HPP
+
+#include "RBALogicalOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAIsGreaterThanEqualOperator : public RBALogicalOperator
+{
+public:
+ RBAIsGreaterThanEqualOperator()=default;
+ RBAIsGreaterThanEqualOperator(const RBAIsGreaterThanEqualOperator&)=delete;
+ RBAIsGreaterThanEqualOperator(RBAIsGreaterThanEqualOperator&&)=delete;
+ RBAIsGreaterThanEqualOperator& operator=(const RBAIsGreaterThanEqualOperator&)=delete;
+ RBAIsGreaterThanEqualOperator& operator=(RBAIsGreaterThanEqualOperator&&)=delete;
+ virtual ~RBAIsGreaterThanEqualOperator()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsGreaterThanEqualOperatorMaker.cpp b/src/core/expression/RBAIsGreaterThanEqualOperatorMaker.cpp
new file mode 100644
index 0000000..e9e23a9
--- /dev/null
+++ b/src/core/expression/RBAIsGreaterThanEqualOperatorMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsGreaterThanEqualOperatorMaker.cpp
+/// @brief IsGreaterThanEqualOperator object generation class
+
+#include "RBAIsGreaterThanEqualOperatorMaker.hpp"
+#include "RBAIsGreaterThanEqualOperator.hpp"
+
+namespace rba
+{
+
+RBAIsGreaterThanEqualOperatorMaker::RBAIsGreaterThanEqualOperatorMaker()
+ : RBAOperatorMaker{"IsGreaterThanEqualOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsGreaterThanEqualOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsGreaterThanEqualOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAIsGreaterThanEqualOperatorMaker.hpp b/src/core/expression/RBAIsGreaterThanEqualOperatorMaker.hpp
new file mode 100644
index 0000000..e7f470f
--- /dev/null
+++ b/src/core/expression/RBAIsGreaterThanEqualOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsGreaterThanEqualOperatorMaker.hpp
+/// @brief IsGreaterThanEqualOperator object generation class header file
+
+#ifndef RBAISGREATERTHANEQUALOPERATORMAKER_HPP
+#define RBAISGREATERTHANEQUALOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief IsGreaterThanEqualOperator object generation class
+class RBAIsGreaterThanEqualOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsGreaterThanEqualOperatorMaker();
+ RBAIsGreaterThanEqualOperatorMaker(const RBAIsGreaterThanEqualOperatorMaker&)=delete;
+ RBAIsGreaterThanEqualOperatorMaker(const RBAIsGreaterThanEqualOperatorMaker&&)=delete;
+ RBAIsGreaterThanEqualOperatorMaker& operator=(const RBAIsGreaterThanEqualOperatorMaker&)=delete;
+ RBAIsGreaterThanEqualOperatorMaker& operator=(const RBAIsGreaterThanEqualOperatorMaker&&)=delete;
+ virtual ~RBAIsGreaterThanEqualOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsGreaterThanOperator.cpp b/src/core/expression/RBAIsGreaterThanOperator.cpp
new file mode 100644
index 0000000..d9153f1
--- /dev/null
+++ b/src/core/expression/RBAIsGreaterThanOperator.cpp
@@ -0,0 +1,105 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// IsGreaterThanOperator class definition file
+
+#include "RBAIsGreaterThanOperator.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+RBAModelElementType
+RBAIsGreaterThanOperator::getModelElementType() const
+{
+ return RBAModelElementType::IsGreaterThanOperator;
+}
+
+void
+RBAIsGreaterThanOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+bool
+RBAIsGreaterThanOperator::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ const std::int32_t lhsVal {getLhsOperand()->getValue(leftInfo, arb)};
+ const std::int32_t rhsVal {getRhsOperand()->getValue(rightInfo, arb)};
+ // If a pre-arbitration exception occurs on either the left side
+ // or the right side in the reference, throw it higher
+ if ((leftInfo->isExceptionBeforeArbitrate() == true)
+ || (rightInfo->isExceptionBeforeArbitrate() == true)
+ || (lhsVal == -99)
+ || (rhsVal == -99)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ if (lhsVal > rhsVal) {
+ isPassed = true;
+ info->addTrueAllocatableFromOperand();
+ } else {
+ info->addFalseAllocatableFromOperand();
+ }
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsGreaterThanOperator::getSymbol() const
+{
+ return ">";
+}
+
+RBAExpressionType
+RBAIsGreaterThanOperator::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAIsGreaterThanOperator.hpp b/src/core/expression/RBAIsGreaterThanOperator.hpp
new file mode 100644
index 0000000..9e0938b
--- /dev/null
+++ b/src/core/expression/RBAIsGreaterThanOperator.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// IsGreaterThanOperator class header file
+
+#ifndef RBAISGREATERTHANOPERATOR_HPP
+#define RBAISGREATERTHANOPERATOR_HPP
+
+#include "RBALogicalOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAIsGreaterThanOperator : public RBALogicalOperator
+{
+public:
+ RBAIsGreaterThanOperator()=default;
+ RBAIsGreaterThanOperator(const RBAIsGreaterThanOperator&)=delete;
+ RBAIsGreaterThanOperator(RBAIsGreaterThanOperator&&)=delete;
+ RBAIsGreaterThanOperator& operator=(const RBAIsGreaterThanOperator&)=delete;
+ RBAIsGreaterThanOperator& operator=(RBAIsGreaterThanOperator&&)=delete;
+ virtual ~RBAIsGreaterThanOperator()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsGreaterThanOperatorMaker.cpp b/src/core/expression/RBAIsGreaterThanOperatorMaker.cpp
new file mode 100644
index 0000000..37a2888
--- /dev/null
+++ b/src/core/expression/RBAIsGreaterThanOperatorMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsGreaterThanEqualOperatorMaker.cpp
+/// @brief IsGreaterThanEqualOperator object generation class definition file
+
+#include "RBAIsGreaterThanOperatorMaker.hpp"
+#include "RBAIsGreaterThanOperator.hpp"
+
+namespace rba
+{
+
+RBAIsGreaterThanOperatorMaker::RBAIsGreaterThanOperatorMaker()
+ : RBAOperatorMaker{"IsGreaterThanOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsGreaterThanOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsGreaterThanOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAIsGreaterThanOperatorMaker.hpp b/src/core/expression/RBAIsGreaterThanOperatorMaker.hpp
new file mode 100644
index 0000000..40bfc17
--- /dev/null
+++ b/src/core/expression/RBAIsGreaterThanOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsGreaterThanEqualOperatorMaker.hpp
+/// @brief IsGreaterThanEqualOperator object generation class header file
+
+#ifndef RBAISGREATERTHANOPERATORMAKER_HPP
+#define RBAISGREATERTHANOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief IsGreaterThanEqualOperator object generation class
+class RBAIsGreaterThanOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsGreaterThanOperatorMaker();
+ RBAIsGreaterThanOperatorMaker(const RBAIsGreaterThanOperatorMaker&)=delete;
+ RBAIsGreaterThanOperatorMaker(const RBAIsGreaterThanOperatorMaker&&)=delete;
+ RBAIsGreaterThanOperatorMaker& operator=(const RBAIsGreaterThanOperatorMaker&)=delete;
+ RBAIsGreaterThanOperatorMaker& operator=(const RBAIsGreaterThanOperatorMaker&&)=delete;
+ virtual ~RBAIsGreaterThanOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsLowerThanEqualOperator.cpp b/src/core/expression/RBAIsLowerThanEqualOperator.cpp
new file mode 100644
index 0000000..811b34d
--- /dev/null
+++ b/src/core/expression/RBAIsLowerThanEqualOperator.cpp
@@ -0,0 +1,106 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// IsLowerThanEqualOperator class definition file
+
+#include "RBAIsLowerThanEqualOperator.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+
+namespace rba
+{
+
+void
+RBAIsLowerThanEqualOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsLowerThanEqualOperator::getModelElementType() const
+{
+ return RBAModelElementType::IsLowerThanEqualOperator;
+}
+
+bool
+RBAIsLowerThanEqualOperator::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ const std::int32_t lhsVal {getLhsOperand()->getValue(leftInfo, arb)};
+ const std::int32_t rhsVal {getRhsOperand()->getValue(rightInfo, arb)};
+ // If a pre-arbitration exception occurs on either the left side
+ // or the right side in the reference, throw it higher
+ if ((leftInfo->isExceptionBeforeArbitrate() == true)
+ || (rightInfo->isExceptionBeforeArbitrate() == true)
+ || (lhsVal == -99)
+ || (rhsVal == -99)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ if (lhsVal <= rhsVal) {
+ isPassed = true;
+ info->addTrueAllocatableFromOperand();
+ } else {
+ info->addFalseAllocatableFromOperand();
+ }
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsLowerThanEqualOperator::getSymbol() const
+{
+ return "<=";
+}
+
+RBAExpressionType
+RBAIsLowerThanEqualOperator::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAIsLowerThanEqualOperator.hpp b/src/core/expression/RBAIsLowerThanEqualOperator.hpp
new file mode 100644
index 0000000..3459110
--- /dev/null
+++ b/src/core/expression/RBAIsLowerThanEqualOperator.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// IsLowerThanEqualOperator class header file
+
+#ifndef RBAISLOWERTHANEQUALOPERATOR_HPP
+#define RBAISLOWERTHANEQUALOPERATOR_HPP
+
+#include "RBALogicalOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAIsLowerThanEqualOperator : public RBALogicalOperator
+{
+public:
+ RBAIsLowerThanEqualOperator()=default;
+ RBAIsLowerThanEqualOperator(const RBAIsLowerThanEqualOperator&)=delete;
+ RBAIsLowerThanEqualOperator(RBAIsLowerThanEqualOperator&&)=delete;
+ RBAIsLowerThanEqualOperator& operator=(const RBAIsLowerThanEqualOperator&)=delete;
+ RBAIsLowerThanEqualOperator& operator=(RBAIsLowerThanEqualOperator&&)=delete;
+ virtual ~RBAIsLowerThanEqualOperator()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsLowerThanEqualOperatorMaker.cpp b/src/core/expression/RBAIsLowerThanEqualOperatorMaker.cpp
new file mode 100644
index 0000000..a04a52b
--- /dev/null
+++ b/src/core/expression/RBAIsLowerThanEqualOperatorMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsLowerThanEqualOperatorMaker.cpp
+/// @brief IsLowerThanEqualOperator object geneation class defintion file
+
+#include "RBAIsLowerThanEqualOperatorMaker.hpp"
+#include "RBAIsLowerThanEqualOperator.hpp"
+
+namespace rba
+{
+
+RBAIsLowerThanEqualOperatorMaker::RBAIsLowerThanEqualOperatorMaker()
+ : RBAOperatorMaker{"IsLowerThanEqualOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsLowerThanEqualOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsLowerThanEqualOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAIsLowerThanEqualOperatorMaker.hpp b/src/core/expression/RBAIsLowerThanEqualOperatorMaker.hpp
new file mode 100644
index 0000000..10cf469
--- /dev/null
+++ b/src/core/expression/RBAIsLowerThanEqualOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsLowerThanEqualOperatorMaker.hpp
+/// @brief IsLowerThanEqualOperator object geneation class header file
+
+#ifndef RBAISLOWERTHANEQUALOPERATORMAKER_HPP
+#define RBAISLOWERTHANEQUALOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief IsLowerThanEqualOperator object generation class
+class RBAIsLowerThanEqualOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsLowerThanEqualOperatorMaker();
+ RBAIsLowerThanEqualOperatorMaker(const RBAIsLowerThanEqualOperatorMaker&)=delete;
+ RBAIsLowerThanEqualOperatorMaker(const RBAIsLowerThanEqualOperatorMaker&&)=delete;
+ RBAIsLowerThanEqualOperatorMaker& operator=(const RBAIsLowerThanEqualOperatorMaker&)=delete;
+ RBAIsLowerThanEqualOperatorMaker& operator=(const RBAIsLowerThanEqualOperatorMaker&&)=delete;
+ virtual ~RBAIsLowerThanEqualOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsLowerThanOperator.cpp b/src/core/expression/RBAIsLowerThanOperator.cpp
new file mode 100644
index 0000000..99a7860
--- /dev/null
+++ b/src/core/expression/RBAIsLowerThanOperator.cpp
@@ -0,0 +1,105 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// IsLowerThanOperator class definition file
+
+#include "RBAIsLowerThanOperator.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAIsLowerThanOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsLowerThanOperator::getModelElementType() const
+{
+ return RBAModelElementType::IsLowerThanOperator;
+}
+
+bool
+RBAIsLowerThanOperator::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ const std::int32_t lhsVal {getLhsOperand()->getValue(leftInfo, arb)};
+ const std::int32_t rhsVal {getRhsOperand()->getValue(rightInfo, arb)};
+ // If a pre-arbitration exception occurs on either the left side
+ // or the right side in the reference, throw it higher
+ if ((leftInfo->isExceptionBeforeArbitrate() == true)
+ || (rightInfo->isExceptionBeforeArbitrate() == true)
+ || (lhsVal == -99)
+ || (rhsVal == -99)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ if (lhsVal < rhsVal) {
+ isPassed = true;
+ info->addTrueAllocatableFromOperand();
+ } else {
+ info->addFalseAllocatableFromOperand();
+ }
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsLowerThanOperator::getSymbol() const
+{
+ return "<";
+}
+
+RBAExpressionType
+RBAIsLowerThanOperator::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAIsLowerThanOperator.hpp b/src/core/expression/RBAIsLowerThanOperator.hpp
new file mode 100644
index 0000000..3a23e45
--- /dev/null
+++ b/src/core/expression/RBAIsLowerThanOperator.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// IsLowerThanOperator class header file
+
+#ifndef RBAISLOWERTHANOPERATOR_HPP
+#define RBAISLOWERTHANOPERATOR_HPP
+
+#include "RBALogicalOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAIsLowerThanOperator : public RBALogicalOperator
+{
+public:
+ RBAIsLowerThanOperator()=default;
+ RBAIsLowerThanOperator(const RBAIsLowerThanOperator&)=delete;
+ RBAIsLowerThanOperator(RBAIsLowerThanOperator&&)=delete;
+ RBAIsLowerThanOperator& operator=(const RBAIsLowerThanOperator&)=delete;
+ RBAIsLowerThanOperator& operator=(RBAIsLowerThanOperator&&)=delete;
+ virtual ~RBAIsLowerThanOperator()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsLowerThanOperatorMaker.cpp b/src/core/expression/RBAIsLowerThanOperatorMaker.cpp
new file mode 100644
index 0000000..f6ddf53
--- /dev/null
+++ b/src/core/expression/RBAIsLowerThanOperatorMaker.cpp
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsLowerThanOperatorMaker.cpp
+/// @brief IsLowerThanOperator object gerneation class
+
+#include "RBAIsLowerThanOperatorMaker.hpp"
+#include "RBAIsLowerThanOperator.hpp"
+
+namespace rba
+{
+
+RBAIsLowerThanOperatorMaker::RBAIsLowerThanOperatorMaker()
+ : RBAOperatorMaker{"IsLowerThanOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsLowerThanOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsLowerThanOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAIsLowerThanOperatorMaker.hpp b/src/core/expression/RBAIsLowerThanOperatorMaker.hpp
new file mode 100644
index 0000000..d2c6870
--- /dev/null
+++ b/src/core/expression/RBAIsLowerThanOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsLowerThanOperatorMaker.hpp
+/// @brief IsLowerThanOperator object gerneation class header file
+
+#ifndef RBAISLOWERTHANOPERATORMAKER_HPP
+#define RBAISLOWERTHANOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief sLowerThanOperator object gerneation class
+class RBAIsLowerThanOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsLowerThanOperatorMaker();
+ RBAIsLowerThanOperatorMaker(const RBAIsLowerThanOperatorMaker&)=delete;
+ RBAIsLowerThanOperatorMaker(const RBAIsLowerThanOperatorMaker&&)=delete;
+ RBAIsLowerThanOperatorMaker& operator=(const RBAIsLowerThanOperatorMaker&)=delete;
+ RBAIsLowerThanOperatorMaker& operator=(const RBAIsLowerThanOperatorMaker&&)=delete;
+ virtual ~RBAIsLowerThanOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsOn.cpp b/src/core/expression/RBAIsOn.cpp
new file mode 100644
index 0000000..f8dd769
--- /dev/null
+++ b/src/core/expression/RBAIsOn.cpp
@@ -0,0 +1,132 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * IsOn class (to judge if a Scene is active) definition file
+ */
+
+#include "RBAIsOn.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBASceneImpl.hpp"
+#include "RBALogManager.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void
+RBAIsOn::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsOn::getModelElementType() const
+{
+ return RBAModelElementType::IsOn;
+}
+
+bool
+RBAIsOn::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj
+ {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (ruleObj != nullptr){
+ const RBASceneImpl* const scene {dynamic_cast<const RBASceneImpl*>(ruleObj->getRawObject())};
+ if (ruleObj->isPrevious() == false) {
+ isPassed = arb->getResult()->isActive(scene);
+ } else {
+ isPassed = arb->getResult()->isPreActive(scene);
+ }
+ } else {
+ // Currently, there is no expression that returns null as "Scene",
+ // so it does not go through this path. But an expression that returns null
+ // may be added in the future, so it is described as it is.
+ ;
+ }
+#ifdef RBA_USE_LOG
+ if (ruleObj != nullptr) {
+ const RBASceneImpl* scene = dynamic_cast<const RBASceneImpl*>(ruleObj
+ ->getRawObject());
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " Scene[" + scene->getName() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Scene["
+ + scene->getName() + "] is On");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Scene["
+ + scene->getName() + "] is not On");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+ } else {
+ // Currently, there is no expression that returns null as "Scene",
+ // so it does not go through this path. But an expression that returns null
+ // may be added in the future, so it is described as it is.
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Scene[NULL] is not On");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsOn::getSymbol() const
+{
+ return ".isOn()";
+}
+
+const std::string
+RBAIsOn::getExpressionText() const
+{
+ return getLhsOperand()->getExpressionText() + getSymbol();
+}
+
+const std::string RBAIsOn::getCoverageExpressionText() const
+{
+ return getLhsOperand()->getCoverageExpressionText() + getSymbol();
+}
+
+RBAExpressionType
+RBAIsOn::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAIsOn.hpp b/src/core/expression/RBAIsOn.hpp
new file mode 100644
index 0000000..9f3f778
--- /dev/null
+++ b/src/core/expression/RBAIsOn.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * IsOn class (to judge if a Scene is active) header
+ */
+
+#ifndef RBAISON_HPP
+#define RBAISON_HPP
+
+#include "RBASceneOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAIsOn : public RBASceneOperator
+{
+public:
+ RBAIsOn()=default;
+ RBAIsOn(const RBAIsOn&)=delete;
+ RBAIsOn(const RBAIsOn&&)=delete;
+ RBAIsOn& operator=(const RBAIsOn&)=delete;
+ RBAIsOn& operator=(const RBAIsOn&&)=delete;
+ virtual ~RBAIsOn()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsOnMaker.cpp b/src/core/expression/RBAIsOnMaker.cpp
new file mode 100644
index 0000000..79a4e16
--- /dev/null
+++ b/src/core/expression/RBAIsOnMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsOnMaker.cpp
+/// @brief IsOn (to judge if a Scene is active) class generation definition
+
+#include "RBAIsOnMaker.hpp"
+#include "RBAIsOn.hpp"
+
+namespace rba
+{
+
+RBAIsOnMaker::RBAIsOnMaker()
+ : RBAOperatorMaker{"IsOn"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsOnMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsOn>();
+}
+
+}
diff --git a/src/core/expression/RBAIsOnMaker.hpp b/src/core/expression/RBAIsOnMaker.hpp
new file mode 100644
index 0000000..824d091
--- /dev/null
+++ b/src/core/expression/RBAIsOnMaker.hpp
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsOnMaker.hpp
+/// @brief IsOn object generation class header file
+/// IsOn is class to judge if a Scene is active
+
+#ifndef RBAISONMAKER_HPP
+#define RBAISONMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief IsOn object generation class
+class RBAIsOnMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsOnMaker();
+ RBAIsOnMaker(const RBAIsOnMaker&)=delete;
+ RBAIsOnMaker(const RBAIsOnMaker&&)=delete;
+ RBAIsOnMaker& operator=(const RBAIsOnMaker&)=delete;
+ RBAIsOnMaker& operator=(const RBAIsOnMaker&&)=delete;
+ virtual ~RBAIsOnMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAIsTypeOfOperator.cpp b/src/core/expression/RBAIsTypeOfOperator.cpp
new file mode 100644
index 0000000..2104f43
--- /dev/null
+++ b/src/core/expression/RBAIsTypeOfOperator.cpp
@@ -0,0 +1,102 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// IsTypeOf class defintion file
+//
+
+#include "RBAIsTypeOfOperator.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBALogManager.hpp"
+#include "RBARuleObject.hpp"
+
+namespace rba
+{
+
+void RBAIsTypeOfOperator::setTag(const std::string& tag)
+{
+ tagId_ = tag;
+}
+
+void RBAIsTypeOfOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+RBAModelElementType RBAIsTypeOfOperator::getModelElementType() const
+{
+ return RBAModelElementType::IsTypeOfOperator;
+}
+bool RBAIsTypeOfOperator::executeCore(RBAConstraintInfo* info, RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo * const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj {getLhsOperand()->getReferenceObject(leftInfo,
+ arb)};
+ if (leftInfo->isExceptionBeforeArbitrate() == true) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (ruleObj != nullptr) {
+ isPassed = ruleObj->containsTag(tagId_);
+ } else {
+ ;
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate()) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getExpressionText() + " before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if ((ruleObj == nullptr) || (!isPassed)) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getExpressionText() + " false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getExpressionText() + " true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ }
+#endif
+ LOG_removeHierarchy();
+ return isPassed;
+}
+#ifdef RBA_USE_LOG
+const std::string RBAIsTypeOfOperator::getExpressionText() const
+{
+ return getLhsOperand()->getExpressionText() + getSymbol();
+}
+
+const std::string RBAIsTypeOfOperator::getCoverageExpressionText() const
+{
+ return getLhsOperand()->getCoverageExpressionText() + getSymbol();
+}
+
+const std::string RBAIsTypeOfOperator::getSymbol() const
+{
+ return ".isTypeOf(" + tagId_ + ")";
+}
+
+RBAExpressionType RBAIsTypeOfOperator::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+}
+/* namespace rba */
diff --git a/src/core/expression/RBAIsTypeOfOperator.hpp b/src/core/expression/RBAIsTypeOfOperator.hpp
new file mode 100644
index 0000000..ce4d213
--- /dev/null
+++ b/src/core/expression/RBAIsTypeOfOperator.hpp
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// IsTypeOfクラスヘッダファイル
+//
+
+#ifndef RBAISTYPEOFOPERATOR_HPP
+#define RBAISTYPEOFOPERATOR_HPP
+
+#include "RBAOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAIsTypeOfOperator : public RBAOperator
+{
+ public:
+ RBAIsTypeOfOperator()=default;
+ RBAIsTypeOfOperator(const RBAIsTypeOfOperator&)=delete;
+ RBAIsTypeOfOperator(const RBAIsTypeOfOperator&&)=delete;
+ RBAIsTypeOfOperator& operator=(const RBAIsTypeOfOperator&)=delete;
+ RBAIsTypeOfOperator& operator=(const RBAIsTypeOfOperator&&)=delete;
+ virtual ~RBAIsTypeOfOperator()=default;
+
+ public:
+ void setTag(const std::string& tag);
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator* arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+ private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::string tagId_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+} /* namespace rba */
+
+#endif /* RBAISTYPEOFOPERATOR_HPP */
diff --git a/src/core/expression/RBAIsTypeOfOperatorMaker.cpp b/src/core/expression/RBAIsTypeOfOperatorMaker.cpp
new file mode 100644
index 0000000..cabd83c
--- /dev/null
+++ b/src/core/expression/RBAIsTypeOfOperatorMaker.cpp
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsTypeOfOperatorMaker.cpp
+/// @brief IsTypeOf object generation class
+
+#include "RBAIsTypeOfOperatorMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAIsTypeOfOperator.hpp"
+
+namespace rba
+{
+
+RBAIsTypeOfOperatorMaker::RBAIsTypeOfOperatorMaker()
+ : RBAOperatorMaker{"IsTypeOf"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsTypeOfOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsTypeOfOperator>();
+}
+
+RBAModelElement*
+RBAIsTypeOfOperatorMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBAIsTypeOfOperator* const isTypeOfOpe
+ {dynamic_cast<RBAIsTypeOfOperator*>(element)};
+
+ // Set LetStatement
+ const std::int32_t pop_num {setLetStatement(model, isTypeOfOpe, jsonElem)};
+
+ // Set operand
+ const RBAJsonElement* const operand {jsonElem->findChildren("operand")};
+ const RBAJsonElement* const param {operand->getChild()};
+ RBAModelElement* const expr {getFactory()->createElement(param->getClassName(), param)};
+ isTypeOfOpe->addOperand(dynamic_cast<RBAExpression*>(expr));
+ // Set Tag
+ const RBAJsonElement* const tagElem {jsonElem->findChildren("tagName")};
+ isTypeOfOpe->setTag(tagElem->getString());
+
+ // Pop variable
+ for(std::int32_t i{0}; i<pop_num; i++) {
+ getFactory()->popVariable();
+ }
+
+ return isTypeOfOpe;
+}
+
+}
diff --git a/src/core/expression/RBAIsTypeOfOperatorMaker.hpp b/src/core/expression/RBAIsTypeOfOperatorMaker.hpp
new file mode 100644
index 0000000..5877267
--- /dev/null
+++ b/src/core/expression/RBAIsTypeOfOperatorMaker.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAIsTypeOfOperatorMaker.hpp
+/// @brief IsTypeOf object geneation class header file
+
+#ifndef RBAISTYPEOFOPERATORMAKER_HPP
+#define RBAISTYPEOFOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief IsTypeOf object geneation class
+class RBAIsTypeOfOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsTypeOfOperatorMaker();
+ RBAIsTypeOfOperatorMaker(const RBAIsTypeOfOperatorMaker&)=delete;
+ RBAIsTypeOfOperatorMaker(const RBAIsTypeOfOperatorMaker&&)=delete;
+ RBAIsTypeOfOperatorMaker& operator=(const RBAIsTypeOfOperatorMaker&)=delete;
+ RBAIsTypeOfOperatorMaker& operator=(const RBAIsTypeOfOperatorMaker&&)=delete;
+ virtual ~RBAIsTypeOfOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBALambdaContext.cpp b/src/core/expression/RBALambdaContext.cpp
new file mode 100644
index 0000000..7d68513
--- /dev/null
+++ b/src/core/expression/RBALambdaContext.cpp
@@ -0,0 +1,92 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * LambdaContext class definition file
+ */
+
+#include "RBALambdaContext.hpp"
+#include "RBALogManager.hpp"
+#include "RBAVariable.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAAllocatableSet.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentSet.hpp"
+#include "RBALambdaExpression.hpp"
+
+namespace rba
+{
+
+RBALambdaExpression* const
+RBALambdaContext::getLambda() const
+{
+ return lambda_;
+}
+
+void
+RBALambdaContext::setLambda(RBALambdaExpression* const newLambda)
+{
+ lambda_ = newLambda;
+}
+
+#ifdef RBA_USE_LOG
+void
+RBALambdaContext::createHierarchy()
+{
+ lambda_->getX()->clearRuleObj();
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(getSymbol());
+ RBALogManager::coverageHierarchyOfConstraintExpressionLog(getCoverageExpressionText(), this);
+
+ // Get rule object and loop
+ RBAExpression* setObj = getLhsOperand();
+ RBAConstraintInfo dummyInfo;
+ // Since it is not referenced by "AllInstanceOf..." or "SetOfOperator"
+ // used for the set of "For-All" or "Exists", nullptr is no problem
+ RBAArbitrator* dummyArb = nullptr;
+ const RBARuleObject* objset = setObj->getReferenceObject(&dummyInfo, dummyArb);
+ std::vector<const RBARuleObject*> objs;
+ if(objset) {
+ if(dynamic_cast<const RBAAllocatableSet*>(objset) != nullptr) {
+ const RBAAllocatableSet* aSet
+ = dynamic_cast<const RBAAllocatableSet*>(objset);
+ for(const auto& alloc : aSet->getLeafAllocatable()) {
+ objs.push_back(alloc);
+ }
+ }
+ else if(dynamic_cast<const RBAContentSet*>(objset) != nullptr) {
+ const RBAContentSet* cSet = dynamic_cast<const RBAContentSet*>(objset);
+ for(const auto& cont : cSet->getLeafContent() ){
+ objs.push_back(cont);
+ }
+ }
+ }
+
+ // Enable expansion of own variables in the coverage log
+ std::int32_t idx=0;
+ for(const RBARuleObject* obj : objs) {
+ LOG_addHierarchy("#" + std::to_string(idx++));
+ lambda_->getX()->setRuleObj(obj);
+ lambda_->createHierarchy();
+ LOG_removeHierarchy();
+ }
+
+ // Remove own to Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+}
+#endif
+
+}
diff --git a/src/core/expression/RBALambdaContext.hpp b/src/core/expression/RBALambdaContext.hpp
new file mode 100644
index 0000000..219be71
--- /dev/null
+++ b/src/core/expression/RBALambdaContext.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * LambdaContext class header file
+ */
+
+#ifndef RBALAMBDACONTEXT_HPP
+#define RBALAMBDACONTEXT_HPP
+
+#include "RBASetOperator.hpp"
+
+namespace rba
+{
+
+class RBALambdaExpression;
+
+class DLL_EXPORT RBALambdaContext : public RBASetOperator
+{
+protected:
+ RBALambdaContext()=default;
+ RBALambdaContext(const RBALambdaContext&)=delete;
+ RBALambdaContext(const RBALambdaContext&&)=delete;
+ RBALambdaContext& operator=(const RBALambdaContext&)=delete;
+ RBALambdaContext& operator=(const RBALambdaContext&&)=delete;
+public:
+ virtual ~RBALambdaContext()=default;
+
+public:
+ RBALambdaExpression* const getLambda() const;
+ void setLambda(RBALambdaExpression* const newLambda);
+
+#ifdef RBA_USE_LOG
+ void createHierarchy() override;
+#endif
+
+private:
+ RBALambdaExpression* lambda_ {nullptr};
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBALambdaContextMaker.cpp b/src/core/expression/RBALambdaContextMaker.cpp
new file mode 100644
index 0000000..f0e7e4d
--- /dev/null
+++ b/src/core/expression/RBALambdaContextMaker.cpp
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBALambdaContextMaker.cpp
+/// @brief LambdaContext object generation abstract class definition
+
+#include "RBALambdaContextMaker.hpp"
+#include "RBALambdaContext.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBALambdaExpression.hpp"
+
+namespace rba
+{
+
+RBALambdaContextMaker::RBALambdaContextMaker(const std::string& label)
+ : RBAOperatorMaker{label}
+{
+}
+
+RBAModelElement*
+RBALambdaContextMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBALambdaContext* const lambdaContext
+ {dynamic_cast<RBALambdaContext*>(element)};
+
+ // Set LetStatement
+ const std::int32_t pop_num {setLetStatement(model, lambdaContext, jsonElem)};
+ // Set lambda
+ const RBAJsonElement* const lambdaElement {jsonElem->findChildren("lambda")};
+ RBAModelElement* const lambdaExpr
+ {getFactory()->createElement(lambdaElement->getClassName(), lambdaElement)};
+ lambdaContext->setLambda(dynamic_cast<RBALambdaExpression*>(lambdaExpr));
+ // Set operand
+ const RBAJsonElement* const param {jsonElem->findChildren("operand")->getChild()};
+ RBAModelElement* const expr
+ {getFactory()->createElement(param->getClassName(), param)};
+ lambdaContext->addOperand(dynamic_cast<RBAExpression*>(expr));
+ // Pop variable
+ for(std::int32_t i{0}; i<pop_num; i++) {
+ getFactory()->popVariable();
+ }
+
+ return lambdaContext;
+}
+
+}
diff --git a/src/core/expression/RBALambdaContextMaker.hpp b/src/core/expression/RBALambdaContextMaker.hpp
new file mode 100644
index 0000000..6df7001
--- /dev/null
+++ b/src/core/expression/RBALambdaContextMaker.hpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBALambdaContextMaker.cpp
+/// @brief LambdaContext object generation abstract class header file
+
+#ifndef RBASETOPERATORMAKER_HPP
+#define RBASETOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+class RBALambdaContext;
+
+/// @brief LambdaContext object generation abstract class
+class RBALambdaContextMaker : public RBAOperatorMaker
+{
+public:
+ explicit RBALambdaContextMaker(const std::string& label="");
+ RBALambdaContextMaker(const RBALambdaContextMaker&)=delete;
+ RBALambdaContextMaker(const RBALambdaContextMaker&&)=delete;
+ RBALambdaContextMaker& operator=(const RBALambdaContextMaker&)=delete;
+ RBALambdaContextMaker& operator=(const RBALambdaContextMaker&&)=delete;
+ virtual ~RBALambdaContextMaker()=default;
+
+protected:
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+ /// @brief generate an empty object of LambdaContext
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for LambdaContext object
+ virtual std::unique_ptr<RBALambdaContext> createLambdaContext()=0;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBALambdaExpression.cpp b/src/core/expression/RBALambdaExpression.cpp
new file mode 100644
index 0000000..7638faa
--- /dev/null
+++ b/src/core/expression/RBALambdaExpression.cpp
@@ -0,0 +1,139 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBALambdaExpression class defnition
+ */
+
+#include "RBALambdaExpression.hpp"
+#include "RBAVariable.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void
+RBALambdaExpression::setX(RBAVariable* const x)
+{
+ variable_ = x;
+}
+
+void
+RBALambdaExpression::setBodyText(RBAExpression* const expr)
+{
+ bodyText_ = expr;
+}
+
+RBAVariable* const
+RBALambdaExpression::getX() const
+{
+ return variable_;
+}
+
+RBAExpression* const
+RBALambdaExpression::getBodyText() const
+{
+ return bodyText_;
+}
+
+RBAModelElementType
+RBALambdaExpression::getModelElementType() const
+{
+ return RBAModelElementType::LambdaExpression;
+}
+
+bool
+RBALambdaExpression::executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const
+{
+ getX()->setRuleObj(ruleObj_);
+
+ RBAConstraintInfo* const childInfo {info->getChild(0U)};
+ bool res {getBodyText()->execute(childInfo,arb)};
+ if(childInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ res = false;
+ }
+
+ return res;
+}
+
+const RBARuleObject*
+RBALambdaExpression::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ getX()->setRuleObj(ruleObj_);
+
+ RBAConstraintInfo* const childInfo {info->getChild(0U)};
+ const RBARuleObject* const res {getBodyText()->getReferenceObject(childInfo, arb)};
+ if (childInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ }
+
+ return res;
+}
+std::int32_t
+RBALambdaExpression::getValueCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ getX()->setRuleObj(ruleObj_);
+
+ RBAConstraintInfo* const childInfo {info->getChild(0U)};
+ const std::int32_t res {getBodyText()->getValue(childInfo, arb)};
+ if (childInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ }
+
+ return res;
+}
+#ifdef RBA_USE_LOG
+void
+RBALambdaExpression::createHierarchy()
+{
+ bodyText_->createHierarchy();
+}
+
+const std::string
+RBALambdaExpression::getExpressionText() const
+{
+ return "{ " + getX()->getElementName() + " |"
+ + bodyText_->getExpressionText() + "}";
+}
+
+const std::string
+RBALambdaExpression::getCoverageExpressionText() const
+{
+ return "{ " + getX()->getElementName() + " |" +
+ bodyText_->getCoverageExpressionText() + "}";
+}
+#endif
+
+void
+RBALambdaExpression::setRuleObj(const RBARuleObject* const ruleObj)
+{
+ ruleObj_ = ruleObj;
+ getX()->setRuleObj(ruleObj);
+}
+
+void
+RBALambdaExpression::clearRuleObj()
+{
+ ruleObj_ = nullptr;
+ getX()->clearRuleObj();
+}
+
+}
diff --git a/src/core/expression/RBALambdaExpression.hpp b/src/core/expression/RBALambdaExpression.hpp
new file mode 100644
index 0000000..76958e7
--- /dev/null
+++ b/src/core/expression/RBALambdaExpression.hpp
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBALambdaExpression class header
+ */
+
+#ifndef RBALAMBDAEXPRESSION_HPP
+#define RBALAMBDAEXPRESSION_HPP
+
+#include "RBAExpression.hpp"
+
+namespace rba
+{
+
+class RBAArbitrator;
+class RBAConstraintInfo;
+class RBAVariable;
+class RBARuleObject;
+
+class DLL_EXPORT RBALambdaExpression : public RBAExpression
+{
+public:
+ RBALambdaExpression()=default;
+ RBALambdaExpression(const RBALambdaExpression&)=delete;
+ RBALambdaExpression(const RBALambdaExpression&&)=delete;
+ RBALambdaExpression& operator=(const RBALambdaExpression&)=delete;
+ RBALambdaExpression& operator=(const RBALambdaExpression&&)=delete;
+ virtual ~RBALambdaExpression()=default;
+
+public:
+ void setX(RBAVariable* const x);
+ void setBodyText(RBAExpression* const expr);
+ RBAVariable* const getX() const;
+ RBAExpression* const getBodyText() const;
+
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator* arb) const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+ std::int32_t getValueCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+ void setRuleObj(const RBARuleObject* const ruleObj);
+ void clearRuleObj();
+
+ // Log
+#ifdef RBA_USE_LOG
+ void createHierarchy();
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+
+private:
+ // "variable" is not const because it calls setExpression()
+ // in the arbitration process.
+ RBAVariable* variable_;
+ RBAExpression* bodyText_ {nullptr};
+ const RBARuleObject* ruleObj_ {nullptr};
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBALambdaExpressionMaker.cpp b/src/core/expression/RBALambdaExpressionMaker.cpp
new file mode 100644
index 0000000..674067f
--- /dev/null
+++ b/src/core/expression/RBALambdaExpressionMaker.cpp
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBALambdaExpressionMaker.cpp
+/// @brief LambdaExpression object generation class definition
+
+#include "RBALambdaExpressionMaker.hpp"
+#include "RBALambdaExpression.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBALambdaExpressionMaker::RBALambdaExpressionMaker()
+ : RBAExpressionMaker{"LambdaExpression"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBALambdaExpressionMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBALambdaExpression>();
+}
+
+RBAModelElement*
+RBALambdaExpressionMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBALambdaExpression* const lambdaExpr
+ {dynamic_cast<RBALambdaExpression*>(element)};
+
+ // Set LetStatement
+ const std::int32_t pop_num {setLetStatement(model, lambdaExpr, jsonElem)};
+
+ // Set variable
+ const RBAJsonElement* const varElement {jsonElem->findChildren("x")};
+ RBAVariable* const var
+ {dynamic_cast<RBAVariable*>(getFactory()->createElement("Variable",
+ varElement))};
+ lambdaExpr->setX(var);
+ // Set bodyText
+ getFactory()->pushVariable(var);
+ const RBAJsonElement* const body {jsonElem->findChildren("bodyText")};
+ RBAExpression* const expr
+ {dynamic_cast<RBAExpression*>(getFactory()->createElement(body->getClassName(),
+ body))};
+ lambdaExpr->setBodyText(expr);
+
+ // Pop variable
+ for(std::int32_t i{0}; i<pop_num; i++) {
+ getFactory()->popVariable();
+ }
+
+ return lambdaExpr;
+}
+
+}
diff --git a/src/core/expression/RBALambdaExpressionMaker.hpp b/src/core/expression/RBALambdaExpressionMaker.hpp
new file mode 100644
index 0000000..04e5f05
--- /dev/null
+++ b/src/core/expression/RBALambdaExpressionMaker.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBALambdaExpressionMaker.hpp
+/// @brief LambdaExpression object generation class header
+
+#ifndef RBALAMBDAEXPRESSIONMAKER_HPP
+#define RBALAMBDAEXPRESSIONMAKER_HPP
+
+#include "RBAExpressionMaker.hpp"
+
+namespace rba
+{
+
+/// @brief LambdaExpression object generation class
+class RBALambdaExpressionMaker : public RBAExpressionMaker
+{
+public:
+ RBALambdaExpressionMaker();
+ RBALambdaExpressionMaker(const RBALambdaExpressionMaker&)=delete;
+ RBALambdaExpressionMaker(const RBALambdaExpressionMaker&&)=delete;
+ RBALambdaExpressionMaker& operator=(const RBALambdaExpressionMaker&)=delete;
+ RBALambdaExpressionMaker& operator=(const RBALambdaExpressionMaker&&)=delete;
+ virtual ~RBALambdaExpressionMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBALetStatement.cpp b/src/core/expression/RBALetStatement.cpp
new file mode 100644
index 0000000..f64cc18
--- /dev/null
+++ b/src/core/expression/RBALetStatement.cpp
@@ -0,0 +1,68 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * LetStatement class definition
+ */
+
+#include "RBALetStatement.hpp"
+#include "RBALogManager.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAVariable.hpp"
+#include "RBAExpressionVisitor.hpp"
+
+namespace rba
+{
+
+RBAModelElementType RBALetStatement::getModelElementType() const
+{
+ return RBAModelElementType::LetStatement;
+}
+
+void RBALetStatement::setVariable(RBAVariable* const var)
+{
+ variable_ = var;
+}
+
+void
+RBALetStatement::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+void RBALetStatement::setVariable(RBAArbitrator* const arb)
+{
+ RBAConstraintInfo* const info {variable_->createConstraintInfo()};
+ variable_->setRuleObj(getLhsOperand()->getReferenceObject(info, arb));
+#ifdef RBA_USE_LOG
+ std::string valueName;
+ if (info->isExceptionBeforeArbitrate() == true) {
+ valueName = "before arbitrate skip";
+ } else if (variable_->getRuleObj() == nullptr) {
+ valueName = "NULL";
+ } else {
+ valueName = variable_->getRuleObj()->getElementName();
+ if (valueName == "") {
+ valueName = variable_->getRuleObj()->getDynamicName();
+ }
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " let " + variable_->getElementName() + " = "
+ + getLhsOperand()->getExpressionText() + " = " + valueName);
+#endif
+}
+} /* namespace rba */
diff --git a/src/core/expression/RBALetStatement.hpp b/src/core/expression/RBALetStatement.hpp
new file mode 100644
index 0000000..636b07d
--- /dev/null
+++ b/src/core/expression/RBALetStatement.hpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/**
+ * LetStatement class header file
+ */
+
+#ifndef RBALETOPERATOR_HPP_
+#define RBALETOPERATOR_HPP_
+
+#include "RBAOperator.hpp"
+
+namespace rba {
+
+class RBAVariable;
+
+class DLL_EXPORT RBALetStatement : public RBAOperator
+{
+public:
+ RBALetStatement()=default;
+ RBALetStatement(const RBALetStatement&)=delete;
+ RBALetStatement(const RBALetStatement&&)=delete;
+ RBALetStatement& operator=(const RBALetStatement&)=delete;
+ RBALetStatement& operator=(const RBALetStatement&&)=delete;
+ virtual ~RBALetStatement()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ void setVariable(RBAVariable* const var);
+ void setVariable(RBAArbitrator* const arb);
+
+private:
+ RBAVariable* variable_;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBALetStatementMaker.cpp b/src/core/expression/RBALetStatementMaker.cpp
new file mode 100644
index 0000000..93fcdee
--- /dev/null
+++ b/src/core/expression/RBALetStatementMaker.cpp
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBALetStatementMaker.cpp
+/// @brief LetStatement object generation class defintino.
+
+#include "RBALetStatementMaker.hpp"
+#include "RBALetStatement.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBALetStatementMaker::RBALetStatementMaker()
+ : RBAExpressionMaker{"LetStatement"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBALetStatementMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBALetStatement>();
+}
+
+RBAModelElement*
+RBALetStatementMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBALetStatement* const letStmt {dynamic_cast<RBALetStatement*>(element)};
+
+ // Set variable
+ const RBAJsonElement* const varElement {jsonElem->findChildren("variable")};
+ RBAVariable* const var
+ {dynamic_cast<RBAVariable*>(getFactory()->createElement("Variable",
+ varElement))};
+ letStmt->setVariable(var); // Set Body
+
+ // popVariable() is executed by the caller of this function
+ getFactory()->pushVariable(var);
+ const RBAJsonElement* const body {jsonElem->findChildren("body")};
+ RBAExpression* const expr
+ {dynamic_cast<RBAExpression*>(getFactory()->createElement(body->getClassName(),
+ body))};
+ letStmt->addOperand(expr);
+
+ return letStmt;
+}
+
+}
diff --git a/src/core/expression/RBALetStatementMaker.hpp b/src/core/expression/RBALetStatementMaker.hpp
new file mode 100644
index 0000000..348ca71
--- /dev/null
+++ b/src/core/expression/RBALetStatementMaker.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBALetStatementMaker.hpp
+/// @brief LetStatement object generation class header
+
+#ifndef RBAISACTIVEMAKER_HPP
+#define RBAISACTIVEMAKER_HPP
+
+#include "RBAExpressionMaker.hpp"
+
+namespace rba
+{
+
+/// @brief LetStatement object generation class
+class RBALetStatementMaker : public RBAExpressionMaker
+{
+public:
+ RBALetStatementMaker();
+ RBALetStatementMaker(const RBALetStatementMaker&)=delete;
+ RBALetStatementMaker(const RBALetStatementMaker&&)=delete;
+ RBALetStatementMaker& operator=(const RBALetStatementMaker&)=delete;
+ RBALetStatementMaker& operator=(const RBALetStatementMaker&&)=delete;
+ virtual ~RBALetStatementMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBALogicalOperator.cpp b/src/core/expression/RBALogicalOperator.cpp
new file mode 100644
index 0000000..e931b7a
--- /dev/null
+++ b/src/core/expression/RBALogicalOperator.cpp
@@ -0,0 +1,73 @@
+
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * 論理オペレータクラス定義ファイル
+ */
+
+#include <sstream>
+#include "RBALogicalOperator.hpp"
+#include "RBAExpressionType.hpp"
+
+namespace rba
+{
+
+#ifdef RBA_USE_LOG
+const std::string
+RBALogicalOperator::getExpressionText() const
+{
+ std::ostringstream oss;
+ oss << "(";
+ const auto& exprList = getOperand();
+ const auto& lastExpr = exprList.back();
+ for (const auto& expr : exprList) {
+ oss << expr->getExpressionText();
+ if (expr != lastExpr) {
+ oss << " " << getSymbol() << " ";
+ }
+ }
+ oss << ")";
+
+ return oss.str();
+}
+
+const std::string
+RBALogicalOperator::getCoverageExpressionText() const
+{
+ std::ostringstream oss;
+ oss << "(";
+ auto exprList = getOperand();
+ auto lastExpr = exprList.back();
+ for (const auto& expr : exprList) {
+ oss << expr->getCoverageExpressionText();
+ if (expr != lastExpr) {
+ oss << " " << getSymbol() << " ";
+ }
+ }
+ oss << ")";
+
+ return oss.str();
+}
+
+RBAExpressionType
+RBALogicalOperator::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBALogicalOperator.hpp b/src/core/expression/RBALogicalOperator.hpp
new file mode 100644
index 0000000..b713f5a
--- /dev/null
+++ b/src/core/expression/RBALogicalOperator.hpp
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * LogicalOperator class header
+ */
+
+#ifndef RBALOGICOPERATOR_HPP
+#define RBALOGICOPERATOR_HPP
+
+#include "RBAOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBALogicalOperator : public RBAOperator
+{
+ protected:
+ RBALogicalOperator()=default;
+ RBALogicalOperator(const RBALogicalOperator&)=delete;
+ RBALogicalOperator(const RBALogicalOperator&&)=delete;
+ RBALogicalOperator& operator=(const RBALogicalOperator&)=delete;
+ RBALogicalOperator& operator=(const RBALogicalOperator&&)=delete;
+
+ public:
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAMaxOperator.cpp b/src/core/expression/RBAMaxOperator.cpp
new file mode 100644
index 0000000..46d5ed1
--- /dev/null
+++ b/src/core/expression/RBAMaxOperator.cpp
@@ -0,0 +1,135 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * MaxOperator class definition
+ */
+
+#include "RBAMaxOperator.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAContent.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBALogManager.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALambdaExpression.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void
+RBAMaxOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAMaxOperator::getModelElementType() const
+{
+ return RBAModelElementType::MaxOperator;
+}
+
+const RBARuleObject* RBAMaxOperator::getReferenceObjectCore(
+ RBAConstraintInfo* info, RBAArbitrator* arb) const
+{
+ LOG_addHierarchy(LOG_getSymbol());
+ const RBARuleObject* returnObj {nullptr};
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const lhsObj {getLhsOperand()->getReferenceObject(leftInfo,
+ arb)};
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ if (lhsObj != nullptr) {
+ const RBAAllocatableSet* alloSet = dynamic_cast<const RBAAllocatableSet*>(lhsObj);
+ if (alloSet != nullptr) {
+ std::uint32_t i { 0U };
+ std::int32_t maxVal { -99 };
+ RBALambdaExpression* const lambda { getLambda() };
+ for (auto& obj : alloSet->getLeafAllocatable()) {
+ LOG_addHierarchy("#" + std::to_string(i));
+ ++i;
+ RBAConstraintInfo* const childInfo { info->getChild(i) };
+ lambda->setRuleObj(obj);
+ const std::int32_t val { lambda->getValue(childInfo, arb) };
+ LOG_removeHierarchy();
+ if ((maxVal < val) && (!childInfo->isExceptionBeforeArbitrate())) {
+ maxVal = val;
+ returnObj = obj;
+ }
+ }
+ } else {
+ const RBAContentSet* contentSet = dynamic_cast<const RBAContentSet*>(lhsObj);
+ if (contentSet != nullptr) {
+ std::uint32_t i { 0U };
+ std::int32_t maxVal { -99 };
+ RBALambdaExpression* const lambda { getLambda() };
+ for (auto& obj : contentSet->getLeafContent()) {
+ LOG_addHierarchy("#" + std::to_string(i));
+ ++i;
+ RBAConstraintInfo* const childInfo { info->getChild(i) };
+ lambda->setRuleObj(obj);
+ const std::int32_t val { lambda->getValue(childInfo, arb) };
+ LOG_removeHierarchy();
+ if ((maxVal < val) && (!childInfo->isExceptionBeforeArbitrate())) {
+ maxVal = val;
+ returnObj = obj;
+ }
+ }
+ }
+ }
+ }
+ }
+#ifdef RBA_USE_LOG
+ std::string objName = "NULL";
+ if (info->isExceptionBeforeArbitrate()) {
+ objName = "before arbitrate skip";
+ } else {
+ if (returnObj != nullptr){
+ objName = returnObj->getElementName();
+ if (objName == "") {
+ objName = returnObj->getDynamicName();
+ }
+ }
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + LOG_getExpressionText() + " is " + objName);
+#endif
+ LOG_removeHierarchy();
+ return returnObj;
+}
+#ifdef RBA_USE_LOG
+const std::string RBAMaxOperator::getSymbol() const
+{
+ return ".max";
+}
+
+const std::string RBAMaxOperator::getExpressionText() const
+{
+ return getLhsOperand()->getExpressionText() + getSymbol()
+ + getLambda()->getExpressionText();
+}
+
+const std::string RBAMaxOperator::getCoverageExpressionText() const
+{
+ getLambda()->clearRuleObj();
+ return getLhsOperand()->getCoverageExpressionText() + getSymbol()
+ + getLambda()->getCoverageExpressionText();
+}
+#endif
+
+} // namespace rba
diff --git a/src/core/expression/RBAMaxOperator.hpp b/src/core/expression/RBAMaxOperator.hpp
new file mode 100644
index 0000000..046cec9
--- /dev/null
+++ b/src/core/expression/RBAMaxOperator.hpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * MaxOperator class header
+ */
+
+#ifndef RBAMAXOPERATOR_HPP
+#define RBAMAXOPERATOR_HPP
+
+#include "RBALambdaContext.hpp"
+
+namespace rba
+{
+
+class RBAMaxOperator : public RBALambdaContext
+{
+ public:
+ RBAMaxOperator()=default;
+ RBAMaxOperator(const RBAMaxOperator&)=delete;
+ RBAMaxOperator(const RBAMaxOperator&&)=delete;
+ RBAMaxOperator& operator=(const RBAMaxOperator&)=delete;
+ RBAMaxOperator& operator=(const RBAMaxOperator&&)=delete;
+ virtual ~RBAMaxOperator()=default;
+
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+};
+
+} /* namespace rba */
+
+#endif /* RBAMAXOPERATOR_HPP */
diff --git a/src/core/expression/RBAMaxOperatorMaker.cpp b/src/core/expression/RBAMaxOperatorMaker.cpp
new file mode 100644
index 0000000..298bbbf
--- /dev/null
+++ b/src/core/expression/RBAMaxOperatorMaker.cpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAMaxOperatorMaker.cpp
+/// @brief MaxOperator object generation class definition
+
+#include "RBAMaxOperatorMaker.hpp"
+#include "RBAMaxOperator.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBALambdaExpression.hpp"
+
+namespace rba
+{
+
+RBAMaxOperatorMaker::RBAMaxOperatorMaker()
+ : RBALambdaContextMaker{"MaxOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAMaxOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAMaxOperator>();
+}
+
+RBAModelElement*
+RBAMaxOperatorMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(
+ RBALambdaContextMaker::setProperty(element, jsonElem, model, owner));
+
+ return element;
+}
+
+std::unique_ptr<RBALambdaContext>
+RBAMaxOperatorMaker::createLambdaContext()
+{
+ return std::make_unique<RBAMaxOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAMaxOperatorMaker.hpp b/src/core/expression/RBAMaxOperatorMaker.hpp
new file mode 100644
index 0000000..1216674
--- /dev/null
+++ b/src/core/expression/RBAMaxOperatorMaker.hpp
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAMaxOperatorMaker.hpp
+/// @brief MaxOperator object generation class header
+
+#ifndef RBAMAXOPERATORMAKER_HPP
+#define RBAMAXOPERATORMAKER_HPP
+
+#include "RBALambdaContextMaker.hpp"
+
+namespace rba
+{
+
+/// @brief MaxOperator object generation class
+class RBAMaxOperatorMaker : public RBALambdaContextMaker
+{
+public:
+ RBAMaxOperatorMaker();
+ RBAMaxOperatorMaker(const RBAMaxOperatorMaker&)=delete;
+ RBAMaxOperatorMaker(const RBAMaxOperatorMaker&&)=delete;
+ RBAMaxOperatorMaker& operator=(const RBAMaxOperatorMaker&)=delete;
+ RBAMaxOperatorMaker& operator=(const RBAMaxOperatorMaker&&)=delete;
+ virtual ~RBAMaxOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner) override;
+
+ /// @brief generate an empty object of LambdaContext
+ /// @details generate an empty object of unique_ptr
+ /// @return unique_ptr for object of LambdaContext
+ std::unique_ptr<RBALambdaContext> createLambdaContext() override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAMemberFeatureReferenceMaker.cpp b/src/core/expression/RBAMemberFeatureReferenceMaker.cpp
new file mode 100644
index 0000000..699bca0
--- /dev/null
+++ b/src/core/expression/RBAMemberFeatureReferenceMaker.cpp
@@ -0,0 +1,94 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAMemberFeatureReferenceMaker.cpp
+/// @brief ObjectReference of property object generator class definition
+
+#include "RBAMemberFeatureReferenceMaker.hpp"
+#include "RBAObjectReference.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAAbstractProperty.hpp"
+
+namespace rba
+{
+
+RBAMemberFeatureReferenceMaker::RBAMemberFeatureReferenceMaker()
+ : RBAObjectReferenceMaker{"MemberFeatureReference"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAMemberFeatureReferenceMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAObjectReference>();
+}
+
+RBAModelElement*
+RBAMemberFeatureReferenceMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBAObjectReference* const objRef {dynamic_cast<RBAObjectReference*>(element)};
+
+ // Set reference object
+ objRef->setRefObject(getRuleObject(jsonElem,model));
+
+ return objRef;
+}
+
+const RBARuleObject*
+RBAMemberFeatureReferenceMaker::getRuleObject(const RBAJsonElement*
+ const jsonElem,
+ RBAModelImpl* const model)
+{
+ const RBARuleObject* refObj {nullptr};
+ const auto typeStr = jsonElem->findChildren("type")->getString();
+ const auto refObjStr = jsonElem->findChildren("refObject")->getString();
+
+ if (jsonElem->findChildren("class")->getString() == "ObjectReference") {
+ refObj = dynamic_cast<RBARuleObject*>(getMaker(typeStr)->getInstance(model,
+ refObjStr));
+ } else { // jsonElem->findChildren("class")->getString() == "MemberFeatureReference"
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // calling getRuleObject() recursively
+ // [Explain that it is okay to deviate from the rules]
+ // When "Content name.State machine name.State name" is used
+ // in the constraint expression, it becomes the STATEMACHINE_STATE of
+ // Member of "STATEMACHINE" of "CONTENT", so recursive call is used.
+ // Since the number of elements in the rule model is finite and
+ // there is no cyclic relationship, stack overflow does not occur and
+ // there is no problem.
+ const auto owner = const_cast<RBARuleObject*>(getRuleObject(jsonElem->findChildren("operand")->getChild(), model));
+ refObj = owner->getMember(refObjStr);
+ if (refObj == nullptr) {
+ if (getMaker(typeStr) != nullptr) {
+ refObj = dynamic_cast<RBARuleObject*>(getMaker(typeStr)->getInstance(model,
+ refObjStr, owner));
+ }
+ if ((refObj == nullptr)
+ && (jsonElem->findChildren("type")->getString() == "PROPERTY")) {
+ refObj = dynamic_cast<RBASceneImpl*>(owner)->addProperty(refObjStr, -99);
+ }
+ }
+ }
+ return refObj;
+}
+}
diff --git a/src/core/expression/RBAMemberFeatureReferenceMaker.hpp b/src/core/expression/RBAMemberFeatureReferenceMaker.hpp
new file mode 100644
index 0000000..61880a7
--- /dev/null
+++ b/src/core/expression/RBAMemberFeatureReferenceMaker.hpp
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAMemberFeatureReferenceMaker.cpp
+/// @brief ObjectReference of property object generator class header
+
+#ifndef RBAMEMBERFEATUREREFERENCEMAKER_HPP
+#define RBAMEMBERFEATUREREFERENCEMAKER_HPP
+
+#include "RBAObjectReferenceMaker.hpp"
+
+namespace rba
+{
+
+class RBARuleObject;
+
+/// @brief ObjectReference of property object generator class
+class RBAMemberFeatureReferenceMaker : public RBAObjectReferenceMaker
+{
+public:
+ RBAMemberFeatureReferenceMaker();
+ RBAMemberFeatureReferenceMaker(const RBAMemberFeatureReferenceMaker&)=delete;
+ RBAMemberFeatureReferenceMaker(const RBAMemberFeatureReferenceMaker&&)=delete;
+ RBAMemberFeatureReferenceMaker& operator=(const RBAMemberFeatureReferenceMaker&)=delete;
+ RBAMemberFeatureReferenceMaker& operator=(const RBAMemberFeatureReferenceMaker&&)=delete;
+ virtual ~RBAMemberFeatureReferenceMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner) override;
+private:
+ const RBARuleObject* getRuleObject(const RBAJsonElement* const jsonElem,
+ RBAModelImpl* const model);
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAMinOperator.cpp b/src/core/expression/RBAMinOperator.cpp
new file mode 100644
index 0000000..923088b
--- /dev/null
+++ b/src/core/expression/RBAMinOperator.cpp
@@ -0,0 +1,135 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// MinOperator class definition
+
+#include "RBAMinOperator.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAContent.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALambdaExpression.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void
+RBAMinOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAMinOperator::getModelElementType() const
+{
+ return RBAModelElementType::MinOperator;
+}
+
+const RBARuleObject* RBAMinOperator::getReferenceObjectCore(
+ RBAConstraintInfo* info, RBAArbitrator* arb) const
+{
+ LOG_addHierarchy(LOG_getSymbol());
+ const RBARuleObject* returnObj {nullptr};
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const lhsObj {getLhsOperand()->getReferenceObject(leftInfo,
+ arb)};
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ if (lhsObj != nullptr) {
+ const RBAAllocatableSet* alloSet = dynamic_cast<const RBAAllocatableSet*>(lhsObj);
+ if (alloSet != nullptr) {
+ std::uint32_t i { 0U };
+ std::int32_t minVal { INT32_MAX };
+ RBALambdaExpression* const lambda { getLambda() };
+ for (auto& obj : alloSet->getLeafAllocatable()) {
+ LOG_addHierarchy("#" + std::to_string(i));
+ ++i;
+ RBAConstraintInfo* const childInfo { info->getChild(i) };
+ lambda->setRuleObj(obj);
+ const std::int32_t val { lambda->getValue(childInfo, arb) };
+ LOG_removeHierarchy();
+ if ((val != -99) && (minVal > val)
+ && (!childInfo->isExceptionBeforeArbitrate())) {
+ minVal = val;
+ returnObj = obj;
+ }
+ }
+ } else {
+ const RBAContentSet* contentSet = dynamic_cast<const RBAContentSet*>(lhsObj);
+ if (contentSet != nullptr) {
+ std::uint32_t i { 0U };
+ std::int32_t minVal { INT32_MAX };
+ RBALambdaExpression* const lambda { getLambda() };
+ for (auto& obj : contentSet->getLeafContent()) {
+ LOG_addHierarchy("#" + std::to_string(i));
+ ++i;
+ RBAConstraintInfo* const childInfo { info->getChild(i) };
+ lambda->setRuleObj(obj);
+ const std::int32_t val { lambda->getValue(childInfo, arb) };
+ LOG_removeHierarchy();
+ if ((val != -99) && (minVal > val)
+ && (!childInfo->isExceptionBeforeArbitrate())) {
+ minVal = val;
+ returnObj = obj;
+ }
+ }
+ }
+ }
+ }
+ }
+#ifdef RBA_USE_LOG
+ std::string objName = "NULL";
+ if (info->isExceptionBeforeArbitrate()) {
+ objName = "before arbitrate skip";
+ } else {
+ if (returnObj != nullptr){
+ objName = returnObj->getElementName();
+ if (objName == "") {
+ objName = returnObj->getDynamicName();
+ }
+ }
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + LOG_getExpressionText() + " is " + objName);
+#endif
+ LOG_removeHierarchy();
+ return returnObj;
+}
+#ifdef RBA_USE_LOG
+const std::string RBAMinOperator::getSymbol() const
+{
+ return ".mix";
+}
+
+const std::string RBAMinOperator::getExpressionText() const
+{
+ return getLhsOperand()->getExpressionText() + getSymbol()
+ + getLambda()->getExpressionText();
+}
+
+const std::string RBAMinOperator::getCoverageExpressionText() const
+{
+ getLambda()->clearRuleObj();
+ return getLhsOperand()->getCoverageExpressionText() + getSymbol()
+ + getLambda()->getCoverageExpressionText();
+}
+#endif
+
+} // namespace rba
diff --git a/src/core/expression/RBAMinOperator.hpp b/src/core/expression/RBAMinOperator.hpp
new file mode 100644
index 0000000..b128877
--- /dev/null
+++ b/src/core/expression/RBAMinOperator.hpp
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// MinOperator class header
+
+#ifndef RBAMINOPERATOR_HPP
+#define RBAMINOPERATOR_HPP
+
+#include "RBALambdaContext.hpp"
+
+namespace rba
+{
+
+class RBAMinOperator : public RBALambdaContext
+{
+ public:
+ RBAMinOperator()=default;
+ RBAMinOperator(const RBAMinOperator&)=delete;
+ RBAMinOperator(RBAMinOperator&&)=delete;
+ RBAMinOperator& operator=(const RBAMinOperator&)=delete;
+ RBAMinOperator& operator=(RBAMinOperator&&)=delete;
+ virtual ~RBAMinOperator()=default;
+
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+};
+
+} // namespace rba
+
+#endif // RBAMINOPERATOR_HPP
diff --git a/src/core/expression/RBAMinOperatorMaker.cpp b/src/core/expression/RBAMinOperatorMaker.cpp
new file mode 100644
index 0000000..060e552
--- /dev/null
+++ b/src/core/expression/RBAMinOperatorMaker.cpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAMinOperatorMaker.cpp
+/// @brief MinOperator object generator class definition
+
+#include "RBAMinOperatorMaker.hpp"
+#include "RBAMinOperator.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBALambdaExpression.hpp"
+
+namespace rba
+{
+
+RBAMinOperatorMaker::RBAMinOperatorMaker()
+ : RBALambdaContextMaker{"MinOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAMinOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAMinOperator>();
+}
+
+RBAModelElement*
+RBAMinOperatorMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(
+ RBALambdaContextMaker::setProperty(element, jsonElem, model, owner));
+
+ return element;
+}
+
+std::unique_ptr<RBALambdaContext>
+RBAMinOperatorMaker::createLambdaContext()
+{
+ return std::make_unique<RBAMinOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAMinOperatorMaker.hpp b/src/core/expression/RBAMinOperatorMaker.hpp
new file mode 100644
index 0000000..6eb90e1
--- /dev/null
+++ b/src/core/expression/RBAMinOperatorMaker.hpp
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAMinOperatorMaker.hpp
+/// @brief MinOperator object generator class header
+
+#ifndef RBAMINOPERATORMAKER_HPP
+#define RBAMINOPERATORMAKER_HPP
+
+#include "RBALambdaContextMaker.hpp"
+
+namespace rba
+{
+
+/// @brief MinOperator object generator class
+class RBAMinOperatorMaker : public RBALambdaContextMaker
+{
+public:
+ RBAMinOperatorMaker();
+ RBAMinOperatorMaker(const RBAMinOperatorMaker&)=delete;
+ RBAMinOperatorMaker(const RBAMinOperatorMaker&&)=delete;
+ RBAMinOperatorMaker& operator=(const RBAMinOperatorMaker&)=delete;
+ RBAMinOperatorMaker& operator=(const RBAMinOperatorMaker&&)=delete;
+ virtual ~RBAMinOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner) override;
+
+ /// @brief generate an empty object of LambdaContext
+ /// @details generate an empty object of unique_ptr
+ /// @return unique_ptr for object of LambdaContext
+ std::unique_ptr<RBALambdaContext> createLambdaContext() override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBANotOperator.cpp b/src/core/expression/RBANotOperator.cpp
new file mode 100644
index 0000000..afcf3c8
--- /dev/null
+++ b/src/core/expression/RBANotOperator.cpp
@@ -0,0 +1,99 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBANotOperator class definition
+ */
+
+#include "RBANotOperator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBANotOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBANotOperator::getModelElementType() const
+{
+ return RBAModelElementType::NotOperator;
+}
+
+bool
+RBANotOperator::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const childInfo {info->getChild(0U)};
+ const bool isChildPassed {getLhsOperand()->execute(childInfo, arb)};
+ if (childInfo->isExceptionBeforeArbitrate() == true) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ isPassed = !isChildPassed;
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBANotOperator::getSymbol() const
+{
+ return "!";
+}
+
+const std::string
+RBANotOperator::getExpressionText() const
+{
+ return getSymbol() + getLhsOperand()->getExpressionText();
+}
+
+const std::string
+RBANotOperator::getCoverageExpressionText() const
+{
+ return getSymbol() + getLhsOperand()->getCoverageExpressionText();
+}
+#endif
+
+}
diff --git a/src/core/expression/RBANotOperator.hpp b/src/core/expression/RBANotOperator.hpp
new file mode 100644
index 0000000..4af1461
--- /dev/null
+++ b/src/core/expression/RBANotOperator.hpp
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBANotOperator class header
+ */
+
+#ifndef RBANOTOPERATOR_HPP
+#define RBANOTOPERATOR_HPP
+
+#include "RBALogicalOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBANotOperator : public RBALogicalOperator
+{
+public:
+ RBANotOperator()=default;
+ RBANotOperator(const RBANotOperator&)=delete;
+ RBANotOperator(const RBANotOperator&&)=delete;
+ RBANotOperator& operator=(const RBANotOperator&)=delete;
+ RBANotOperator& operator=(const RBANotOperator&&)=delete;
+ virtual ~RBANotOperator()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBANotOperatorMaker.cpp b/src/core/expression/RBANotOperatorMaker.cpp
new file mode 100644
index 0000000..e4e823c
--- /dev/null
+++ b/src/core/expression/RBANotOperatorMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBANotOperatorMaker.cpp
+/// @brief NotOperator object generator class definition
+
+#include "RBANotOperatorMaker.hpp"
+#include "RBANotOperator.hpp"
+
+namespace rba
+{
+
+RBANotOperatorMaker::RBANotOperatorMaker()
+ : RBAOperatorMaker{"NotOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBANotOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBANotOperator>();
+}
+
+}
diff --git a/src/core/expression/RBANotOperatorMaker.hpp b/src/core/expression/RBANotOperatorMaker.hpp
new file mode 100644
index 0000000..91f39b9
--- /dev/null
+++ b/src/core/expression/RBANotOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBANotOperatorMaker.hpp
+/// @brief NotOperator object generator class header
+
+#ifndef RBANOTOPERATORMAKER_HPP
+#define RBANOTOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief NotOperator object generator class header
+class RBANotOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBANotOperatorMaker();
+ RBANotOperatorMaker(const RBANotOperatorMaker&)=delete;
+ RBANotOperatorMaker(const RBANotOperatorMaker&&)=delete;
+ RBANotOperatorMaker& operator=(const RBANotOperatorMaker&)=delete;
+ RBANotOperatorMaker& operator=(const RBANotOperatorMaker&&)=delete;
+ virtual ~RBANotOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAObjectCompare.cpp b/src/core/expression/RBAObjectCompare.cpp
new file mode 100644
index 0000000..65bee04
--- /dev/null
+++ b/src/core/expression/RBAObjectCompare.cpp
@@ -0,0 +1,165 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ObjectCompare calss defintion
+ */
+
+#include "RBAObjectCompare.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+
+namespace rba
+{
+
+void
+RBAObjectCompare::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAObjectCompare::getModelElementType() const
+{
+ return RBAModelElementType::ObjectCompare;
+}
+
+bool
+RBAObjectCompare::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBAExpression* const lhs {getLhsOperand()};
+ // Add left hand side expression to Constraint hierarchy for coverage
+ LOG_addHierarchy("#left");
+ const RBARuleObject* const lhobj {lhs->getReferenceObject(leftInfo, arb)};
+ // Remove left hand side expression from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ // Throw if one of the pre-arbitration exceptions appears in the reference
+ if (leftInfo->isExceptionBeforeArbitrate() == true) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ RBAConstraintInfo* const rightInfo {info->getChild(1U)};
+ const RBAExpression* const rhs {getRhsOperand()};
+ // Add right hand side expression to Constraint hierarchy for coverage
+ LOG_addHierarchy("#right");
+ const RBARuleObject* const rhobj {rhs->getReferenceObject(rightInfo, arb)};
+ // Remove right hand side expression to Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ // Throw if one of the pre-arbitration exceptions appears in the reference
+ if (rightInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ // False if both objects cannot be got
+ if ((lhobj != nullptr) && (rhobj != nullptr)) {
+ if (lhobj->getRawObject() == rhobj->getRawObject()) {
+ isPassed = true;
+          // Even if re-arbitration is performed for "ObjectCompare" that uses
+ // "ObjectRefrence" as an operand, the evaluation result does not
+ // change from false to True, so it is not necessary to add
+ // "FalseAllocatable" or "TrueAllocatabe" for re-arbitration.
+ // When "Expression" such as "AllocatedContent" is used as an operand,
+ // "FalseAllocatable" and "TrueAllocatabe" are added in the operand,
+ // so it is not necessary to add in ObjectCompare.
+ }
+ }
+ }
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAObjectCompare::getSymbol() const
+{
+ return "==";
+}
+
+const std::string
+RBAObjectCompare::getExpressionText() const
+{
+ return getLhsOperand()->getExpressionText()
+ + " " + getSymbol() + " " + getRhsOperand()->getExpressionText();
+}
+
+const std::string
+RBAObjectCompare::getCoverageExpressionText() const
+{
+ return getLhsOperand()->getCoverageExpressionText()
+ + " " + getSymbol() + " " + getRhsOperand()->getCoverageExpressionText();
+}
+
+void
+RBAObjectCompare::createHierarchy()
+{
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(getSymbol());
+ RBALogManager::coverageHierarchyOfConstraintExpressionLog(getCoverageExpressionText(), this);
+
+ RBAExpression* expr0 = getLhsOperand();
+ RBAExpression* expr1 = getRhsOperand();
+
+ // Add left hand side expression to Constraint hierarchy for coverage
+ LOG_addHierarchy("#left");
+ expr0->createHierarchy();
+ // Remove left hand side expression from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ // Add right hand side expression to Constraint hierarchy for coverage
+ LOG_addHierarchy("#right");
+ expr1->createHierarchy();
+ // Remove right hand side expression from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ // Remove itself from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+}
+
+RBAExpressionType
+RBAObjectCompare::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAObjectCompare.hpp b/src/core/expression/RBAObjectCompare.hpp
new file mode 100644
index 0000000..c7c345d
--- /dev/null
+++ b/src/core/expression/RBAObjectCompare.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ObjectCompare calss header
+ */
+
+#ifndef RBAOBJECTCOMPARE_HPP
+#define RBAOBJECTCOMPARE_HPP
+
+#include "RBAOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAObjectCompare : public RBAOperator
+{
+public:
+ RBAObjectCompare()=default;
+ RBAObjectCompare(const RBAObjectCompare&)=delete;
+ RBAObjectCompare(const RBAObjectCompare&&)=delete;
+ RBAObjectCompare& operator=(const RBAObjectCompare&)=delete;
+ RBAObjectCompare& operator=(const RBAObjectCompare&&)=delete;
+ virtual ~RBAObjectCompare()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ void createHierarchy() override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAObjectCompareMaker.cpp b/src/core/expression/RBAObjectCompareMaker.cpp
new file mode 100644
index 0000000..ab696cf
--- /dev/null
+++ b/src/core/expression/RBAObjectCompareMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAObjectCompareMaker.cpp
+/// @brief ObjectCompare object generator class
+
+#include "RBAObjectCompareMaker.hpp"
+#include "RBAObjectCompare.hpp"
+
+namespace rba
+{
+
+RBAObjectCompareMaker::RBAObjectCompareMaker()
+ : RBAOperatorMaker{"ObjectCompare"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAObjectCompareMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAObjectCompare>();
+}
+
+}
diff --git a/src/core/expression/RBAObjectCompareMaker.hpp b/src/core/expression/RBAObjectCompareMaker.hpp
new file mode 100644
index 0000000..3d44a4e
--- /dev/null
+++ b/src/core/expression/RBAObjectCompareMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAObjectCompareMaker.hpp
+/// @brief ObjectCompare object generator class header
+
+#ifndef RBAOBJECTCOMPAREMAKER_HPP
+#define RBAOBJECTCOMPAREMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ObjectCompare object generator class
+class RBAObjectCompareMaker : public RBAOperatorMaker
+{
+public:
+ RBAObjectCompareMaker();
+ RBAObjectCompareMaker(const RBAObjectCompareMaker&)=delete;
+ RBAObjectCompareMaker(const RBAObjectCompareMaker&&)=delete;
+ RBAObjectCompareMaker& operator=(const RBAObjectCompareMaker&)=delete;
+ RBAObjectCompareMaker& operator=(const RBAObjectCompareMaker&&)=delete;
+ virtual ~RBAObjectCompareMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAObjectReference.cpp b/src/core/expression/RBAObjectReference.cpp
new file mode 100644
index 0000000..aefe83c
--- /dev/null
+++ b/src/core/expression/RBAObjectReference.cpp
@@ -0,0 +1,133 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// ObjectReference class definition
+
+#include "RBAObjectReference.hpp"
+
+#include "RBAExpressionVisitor.hpp"
+#include "RBAVariable.hpp"
+#include "RBAModelElementType.hpp"
+#ifdef RBA_USE_LOG
+#include "RBAAbstractProperty.hpp"
+#include "RBASceneImpl.hpp"
+#endif
+
+namespace rba
+{
+
+void
+RBAObjectReference::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAObjectReference::getModelElementType() const
+{
+ return RBAModelElementType::ObjectReference;
+}
+
+const RBARuleObject*
+RBAObjectReference::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ const RBARuleObject* obj {refObject_};
+ if (obj->isModelElementType(RBAModelElementType::Variable)) {
+ // in case of varible, its reference
+ const RBAVariable* const val {dynamic_cast<const RBAVariable*>(obj)};
+ obj = val->getRuleObj();
+ std::shared_ptr<RBAConstraintInfo> valInfo {val->getConstraintInfo()};
+ if (valInfo != nullptr) {
+ info->setChild(valInfo);
+ if (valInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ }
+ }
+ return obj;
+}
+
+void
+RBAObjectReference::setRefObject(const RBARuleObject* const newRefObject)
+{
+ refObject_ = newRefObject;
+}
+
+#ifdef RBA_USE_LOG
+
+void
+RBAObjectReference::setExpressionType(RBAExpressionType const newExprType)
+{
+ expressionType_ = newExprType;
+}
+
+void
+RBAObjectReference::createHierarchy()
+{
+ // No operation, because this does not affect the structure
+}
+
+const std::string
+RBAObjectReference::getExpressionText() const
+{
+ if (refObject_->isModelElementType(RBAModelElementType::Property)) {
+ return dynamic_cast<const RBAAbstractProperty*>(refObject_)->getScene()->getElementName();
+ }
+ else if ((refObject_->isModelElementType(RBAModelElementType::ViewContentState)) ||
+ (refObject_->isModelElementType(RBAModelElementType::SoundContentState))) {
+ return (refObject_->getOwner()->getElementName() + "." + refObject_->getElementName());
+ }
+ if(refObject_->getElementName() != ""){
+ return refObject_->getElementName();
+ } else {
+ return refObject_->getDynamicName();
+ }
+}
+
+const std::string
+RBAObjectReference::getCoverageExpressionText() const
+{
+ if (refObject_->isModelElementType(RBAModelElementType::Variable)) {
+ const RBAVariable* var =
+ dynamic_cast<const RBAVariable*>(refObject_);
+ if (var->getRuleObj()) {
+ if (var->getRuleObj()->getElementName() != "") {
+ return var->getRuleObj()->getElementName();
+ } else {
+ return var->getRuleObj()->getDynamicName();
+ }
+ }
+ }
+ if ((refObject_->isModelElementType(RBAModelElementType::ViewContentState)) ||
+ (refObject_->isModelElementType(RBAModelElementType::SoundContentState))) {
+ return (refObject_->getOwner()->getElementName() + "." + refObject_->getElementName());
+ }
+ if(refObject_->getElementName() != ""){
+ return refObject_->getElementName();
+ } else {
+ return refObject_->getDynamicName();
+ }
+}
+
+RBAExpressionType
+RBAObjectReference::getUnderlyingType() const
+{
+ return expressionType_;
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAObjectReference.hpp b/src/core/expression/RBAObjectReference.hpp
new file mode 100644
index 0000000..2eb38df
--- /dev/null
+++ b/src/core/expression/RBAObjectReference.hpp
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// ObjectReference class header
+
+#ifndef RBAOBJECTREFERENCE_HPP
+#define RBAOBJECTREFERENCE_HPP
+
+#include "RBAExpression.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAObjectReference : public RBAExpression
+{
+public:
+ RBAObjectReference()=default;
+ RBAObjectReference(const RBAObjectReference&)=delete;
+ RBAObjectReference(const RBAObjectReference&&)=delete;
+ RBAObjectReference& operator=(const RBAObjectReference&)=delete;
+ RBAObjectReference& operator=(const RBAObjectReference&&)=delete;
+ virtual ~RBAObjectReference()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+ void setRefObject(const RBARuleObject* const newRefObject);
+
+ // Log
+#ifdef RBA_USE_LOG
+ void setExpressionType(RBAExpressionType const newExprType);
+ void createHierarchy() override;
+ const std::string getExpressionText() const override;
+ RBAExpressionType getUnderlyingType() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+
+private:
+ const RBARuleObject* refObject_;
+#ifdef RBA_USE_LOG
+ RBAExpressionType expressionType_;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAObjectReferenceMaker.cpp b/src/core/expression/RBAObjectReferenceMaker.cpp
new file mode 100644
index 0000000..8c216ba
--- /dev/null
+++ b/src/core/expression/RBAObjectReferenceMaker.cpp
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAObjectReferenceMaker.cpp
+/// @brief ObjectReference object generator class definition
+
+#include "RBAObjectReferenceMaker.hpp"
+#include "RBAObjectReference.hpp"
+
+#include "RBAJsonElement.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAModelImpl.hpp"
+
+namespace rba
+{
+
+RBAObjectReferenceMaker::RBAObjectReferenceMaker(const std::string& label)
+ : RBAExpressionMaker{label}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAObjectReferenceMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAObjectReference>();
+}
+
+RBAModelElement*
+RBAObjectReferenceMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBAObjectReference* const objRef {dynamic_cast<RBAObjectReference*>(element)};
+
+ // Set reference object
+ //// Getting reference object string
+ const auto& refObjectStr = jsonElem->findChildren("refObject")->getString();
+
+ //// Find object
+ auto ruleObj = model->findModelElement(refObjectStr);
+
+ if(ruleObj == nullptr) {
+ ruleObj = getFactory()->getVariable(refObjectStr);
+ if(ruleObj == nullptr) {
+ const auto& typeStr = jsonElem->findChildren("type")->getString();
+ auto maker = getMaker(typeStr);
+ if (maker != nullptr) {
+ ruleObj = maker->getInstance(model, refObjectStr, owner);
+ }
+ }
+ }
+ objRef->setRefObject(dynamic_cast<const RBARuleObject*>(ruleObj));
+
+#ifdef RBA_USE_LOG
+ // Set expression type
+ const RBAExpressionType exprType {jsonElem->getExpressionType()};
+ objRef->setExpressionType(exprType);
+#endif
+
+ return objRef;
+}
+
+}
diff --git a/src/core/expression/RBAObjectReferenceMaker.hpp b/src/core/expression/RBAObjectReferenceMaker.hpp
new file mode 100644
index 0000000..ee58b92
--- /dev/null
+++ b/src/core/expression/RBAObjectReferenceMaker.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAObjectReferenceMaker.hpp
+/// @brief ObjectReference object generator class header
+
+#ifndef RBAOBJECTREFERENCEMAKER_HPP
+#define RBAOBJECTREFERENCEMAKER_HPP
+
+#include "RBAExpressionMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ObjectReference object generator class header
+class DLL_EXPORT RBAObjectReferenceMaker : public RBAExpressionMaker
+{
+public:
+ explicit RBAObjectReferenceMaker(const std::string& label="ObjectReference");
+ RBAObjectReferenceMaker(const RBAObjectReferenceMaker&)=delete;
+ RBAObjectReferenceMaker(const RBAObjectReferenceMaker&&)=delete;
+ RBAObjectReferenceMaker& operator=(const RBAObjectReferenceMaker&)=delete;
+ RBAObjectReferenceMaker& operator=(const RBAObjectReferenceMaker&&)=delete;
+ virtual ~RBAObjectReferenceMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAOperator.cpp b/src/core/expression/RBAOperator.cpp
new file mode 100644
index 0000000..7d73f66
--- /dev/null
+++ b/src/core/expression/RBAOperator.cpp
@@ -0,0 +1,99 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Operator class definition
+ */
+
+#include "RBAOperator.hpp"
+#include "RBALogManager.hpp"
+
+namespace rba
+{
+
+const std::vector<RBAExpression*>&
+RBAOperator::getOperand() const
+{
+ return operand_;
+}
+
+void
+RBAOperator::addOperand(RBAExpression* const newExpr)
+{
+ if(newExpr != nullptr) {
+ operand_.push_back(newExpr);
+ }
+}
+
+RBAExpression*
+RBAOperator::getLhsOperand() const
+{
+ return operand_.front();
+}
+
+RBAExpression*
+RBAOperator::getRhsOperand() const
+{
+ return operand_.back();
+}
+
+const std::string
+RBAOperator::getPreMsg(const bool isPrevious) const
+{
+ if(isPrevious) {
+ return "(pre)";
+ }
+ else {
+ return "";
+ }
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAOperator::getSymbol() const
+{
+ return "";
+}
+
+void
+RBAOperator::createHierarchy()
+{
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(getSymbol());
+ RBALogManager::coverageHierarchyOfConstraintExpressionLog(getCoverageExpressionText(), this);
+
+ std::uint32_t oprSize{ static_cast<std::uint32_t>(getOperand().size()) };
+ if(oprSize == 1U) {
+ RBAExpression* expr = getLhsOperand();
+ expr->createHierarchy();
+ }
+ else {
+ std::uint32_t num{ 0U };
+ for(RBAExpression* expr : getOperand()) {
+ // Add count to Constraint hierarchy for coverage
+ LOG_addHierarchy("#" + std::to_string(num++));
+ expr->createHierarchy();
+ // Remove count from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ }
+ }
+
+ // Remove count from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAOperator.hpp b/src/core/expression/RBAOperator.hpp
new file mode 100644
index 0000000..5d645f2
--- /dev/null
+++ b/src/core/expression/RBAOperator.hpp
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Operator class header
+ */
+
+#ifndef RBAOPERATOR_HPP
+#define RBAOPERATOR_HPP
+
+#include <vector>
+#include "RBAExpression.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAOperator : public RBAExpression
+{
+protected:
+ RBAOperator()=default;
+ RBAOperator(const RBAOperator&)=delete;
+ RBAOperator(const RBAOperator&&)=delete;
+ RBAOperator& operator=(const RBAOperator&)=delete;
+ RBAOperator& operator=(const RBAOperator&&)=delete;
+
+public:
+ const std::vector<RBAExpression*>& getOperand() const;
+ void addOperand(RBAExpression* const newExpr);
+ RBAExpression* getLhsOperand() const;
+ RBAExpression* getRhsOperand() const;
+
+ // Log
+#ifdef RBA_USE_LOG
+ virtual const std::string getSymbol() const;
+ void createHierarchy() override;
+#endif
+
+protected:
+ std::string const getPreMsg(const bool isPrevious) const;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::vector<RBAExpression*> operand_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAOperatorMaker.cpp b/src/core/expression/RBAOperatorMaker.cpp
new file mode 100644
index 0000000..7da2885
--- /dev/null
+++ b/src/core/expression/RBAOperatorMaker.cpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAOperatorMaker.cpp
+/// @brief Operator object generator abstract class
+
+#include "RBAOperatorMaker.hpp"
+#include "RBAOperator.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAOperatorMaker::RBAOperatorMaker(const std::string& label)
+ : RBAExpressionMaker{label}
+{
+}
+
+RBAModelElement*
+RBAOperatorMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ // Create expression
+ RBAOperator* const exprOpr {dynamic_cast<RBAOperator*>(element)};
+
+ // Set LetStatement
+ const auto pop_num = setLetStatement(model, exprOpr, jsonElem);
+
+ // Set operand
+ for(auto& param : jsonElem->findChildren("operand")->getChildren()) {
+ const auto expr = getFactory()->createElement(param->getClassName(), param.get());
+ exprOpr->addOperand(dynamic_cast<RBAExpression*>(expr));
+ }
+
+ // Pop variable
+ for(std::int32_t i{0}; i<pop_num; i++) {
+ getFactory()->popVariable();
+ }
+
+ return exprOpr;
+}
+
+}
diff --git a/src/core/expression/RBAOperatorMaker.hpp b/src/core/expression/RBAOperatorMaker.hpp
new file mode 100644
index 0000000..681ff65
--- /dev/null
+++ b/src/core/expression/RBAOperatorMaker.hpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAOperatorMaker.hpp
+/// @brief Operator object generator abstract class header
+
+#ifndef RBAOPERATORMAKER_HPP
+#define RBAOPERATORMAKER_HPP
+
+#include "RBAExpressionMaker.hpp"
+
+namespace rba
+{
+
+/// @brief Operator object generator abstract class
+class DLL_EXPORT RBAOperatorMaker : public RBAExpressionMaker
+{
+public:
+ explicit RBAOperatorMaker(const std::string& label="");
+ RBAOperatorMaker(const RBAOperatorMaker&)=delete;
+ RBAOperatorMaker(const RBAOperatorMaker&&)=delete;
+ RBAOperatorMaker& operator=(const RBAOperatorMaker&)=delete;
+ RBAOperatorMaker& operator=(const RBAOperatorMaker&&)=delete;
+ virtual ~RBAOperatorMaker()=default;
+
+protected:
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAOrOperator.cpp b/src/core/expression/RBAOrOperator.cpp
new file mode 100644
index 0000000..d55e4a0
--- /dev/null
+++ b/src/core/expression/RBAOrOperator.cpp
@@ -0,0 +1,100 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * OrOperator class definition
+ */
+
+#include "RBAOrOperator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAOrOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAOrOperator::getModelElementType() const
+{
+ return RBAModelElementType::OrOperator;
+}
+
+bool
+RBAOrOperator::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ std::uint32_t index {0U};
+ for (const RBAExpression* const ope : getOperand()) {
+ RBAConstraintInfo* const childInfo {info->getChild(index)};
+ // Add count to Constraint hierarchy for coverage
+ LOG_addHierarchy("#" + std::to_string(index));
+ const bool res {ope->execute(childInfo, arb)};
+ // Remove count from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ if (childInfo->isExceptionBeforeArbitrate() == true) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (res == true) {
+ isPassed = true;
+ } else {
+ ;
+ }
+ ++index;
+ }
+ if (isPassed == true) {
+ info->setExceptionBeforeArbitrate(false);
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + LOG_getExpressionText() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove count from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAOrOperator::getSymbol() const
+{
+ return "OR";
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAOrOperator.hpp b/src/core/expression/RBAOrOperator.hpp
new file mode 100644
index 0000000..a52aca4
--- /dev/null
+++ b/src/core/expression/RBAOrOperator.hpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * OrOperator class header
+ */
+
+#ifndef RBAOROPERATOR_HPP
+#define RBAOROPERATOR_HPP
+
+#include "RBALogicalOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAOrOperator : public RBALogicalOperator
+{
+ public:
+ RBAOrOperator()=default;
+ RBAOrOperator(const RBAOrOperator&)=delete;
+ RBAOrOperator(const RBAOrOperator&&)=delete;
+ RBAOrOperator& operator=(const RBAOrOperator&)=delete;
+ RBAOrOperator& operator=(const RBAOrOperator&&)=delete;
+ virtual ~RBAOrOperator()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAOrOperatorMaker.cpp b/src/core/expression/RBAOrOperatorMaker.cpp
new file mode 100644
index 0000000..934c7e1
--- /dev/null
+++ b/src/core/expression/RBAOrOperatorMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAOrOperatorMaker.cpp
+/// @brief OrOperator object generator
+
+#include "RBAOrOperatorMaker.hpp"
+#include "RBAOrOperator.hpp"
+
+namespace rba
+{
+
+RBAOrOperatorMaker::RBAOrOperatorMaker()
+ : RBAOperatorMaker{"OrOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAOrOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAOrOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAOrOperatorMaker.hpp b/src/core/expression/RBAOrOperatorMaker.hpp
new file mode 100644
index 0000000..def4d8f
--- /dev/null
+++ b/src/core/expression/RBAOrOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAOrOperatorMaker.hpp
+/// @brief OrOperator object generator class header
+
+#ifndef RBAOROPERATORMAKER_HPP
+#define RBAOROPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief OrOperator object generator class
+class RBAOrOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBAOrOperatorMaker();
+ RBAOrOperatorMaker(const RBAOrOperatorMaker&)=delete;
+ RBAOrOperatorMaker(const RBAOrOperatorMaker&&)=delete;
+ RBAOrOperatorMaker& operator=(const RBAOrOperatorMaker&)=delete;
+ RBAOrOperatorMaker& operator=(const RBAOrOperatorMaker&&)=delete;
+ virtual ~RBAOrOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAPlusOperator.cpp b/src/core/expression/RBAPlusOperator.cpp
new file mode 100644
index 0000000..8a6dbbb
--- /dev/null
+++ b/src/core/expression/RBAPlusOperator.cpp
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * PlusOperator class definition
+ */
+
+#include "RBAPlusOperator.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBAModelElementType
+RBAPlusOperator::getModelElementType() const
+{
+ return RBAModelElementType::PlusOperator;
+}
+
+}
diff --git a/src/core/expression/RBAPlusOperator.hpp b/src/core/expression/RBAPlusOperator.hpp
new file mode 100644
index 0000000..ab04ebb
--- /dev/null
+++ b/src/core/expression/RBAPlusOperator.hpp
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * PlusOperator class header
+ */
+
+#ifndef RBAPLUSOPERATOR_HPP
+#define RBAPLUSOPERATOR_HPP
+
+#include "RBAArithmeticOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAPlusOperator : public RBAArithmeticOperator
+{
+public:
+ RBAPlusOperator()=default;
+ RBAPlusOperator(const RBAPlusOperator&)=delete;
+ RBAPlusOperator(const RBAPlusOperator&&)=delete;
+ RBAPlusOperator& operator=(const RBAPlusOperator&)=delete;
+ RBAPlusOperator& operator=(const RBAPlusOperator&&)=delete;
+ virtual ~RBAPlusOperator()=default;
+
+public:
+ RBAModelElementType getModelElementType() const override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAPlusOperatorMaker.cpp b/src/core/expression/RBAPlusOperatorMaker.cpp
new file mode 100644
index 0000000..677d456
--- /dev/null
+++ b/src/core/expression/RBAPlusOperatorMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAPlusOperatorsMaker.cpp
+/// @brief PlusOperator object generator class definition
+
+#include "RBAPlusOperatorMaker.hpp"
+#include "RBAPlusOperator.hpp"
+
+namespace rba
+{
+
+RBAPlusOperatorMaker::RBAPlusOperatorMaker()
+ : RBAOperatorMaker{"PlusOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAPlusOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAPlusOperator>();
+}
+
+}
diff --git a/src/core/expression/RBAPlusOperatorMaker.hpp b/src/core/expression/RBAPlusOperatorMaker.hpp
new file mode 100644
index 0000000..aea1df7
--- /dev/null
+++ b/src/core/expression/RBAPlusOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAPlusOperatorsMaker.hpp
+/// @brief PlusOperator object generator class header
+
+#ifndef RBAPLUSOPERATORMAKER_HPP
+#define RBAPLUSOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief PlusOperator object generator class
+class RBAPlusOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBAPlusOperatorMaker();
+ RBAPlusOperatorMaker(const RBAPlusOperatorMaker&)=delete;
+ RBAPlusOperatorMaker(const RBAPlusOperatorMaker&&)=delete;
+ RBAPlusOperatorMaker& operator=(const RBAPlusOperatorMaker&)=delete;
+ RBAPlusOperatorMaker& operator=(const RBAPlusOperatorMaker&&)=delete;
+ virtual ~RBAPlusOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAPreviousModifier.cpp b/src/core/expression/RBAPreviousModifier.cpp
new file mode 100644
index 0000000..53a7112
--- /dev/null
+++ b/src/core/expression/RBAPreviousModifier.cpp
@@ -0,0 +1,97 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * PreviousModifier class definition
+ */
+
+#include "RBAPreviousModifier.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAPreviousObjectWrapper.hpp"
+
+namespace rba
+{
+
+RBAPreviousModifier::RBAPreviousModifier()
+ : RBAExpression(),
+ previousObj_{std::make_unique<RBAPreviousObjectWrapper>()}
+{
+}
+
+void
+RBAPreviousModifier::accept(RBAExpressionVisitor& visitor)
+{
+ // RBASceneAllocatableCollector,
+ // which is the only vistor that exists at the moment,
+ // does not pass this path because it does not accept the rule object.
+ // In the future, another visitor may accept, so implement this.
+ visitor.visit(*this);
+}
+
+void
+RBAPreviousModifier::setObjReference(RBAExpression* const newObjRef)
+{
+ objReference_ = newObjRef;
+}
+
+RBAExpression* const
+RBAPreviousModifier::getObjReference() const
+{
+ return objReference_;
+}
+
+const RBARuleObject*
+RBAPreviousModifier::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ previousObj_->setRefObject(objReference_->getReferenceObject(info, arb));
+ return previousObj_.get();
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAPreviousModifier::getSymbol() const
+{
+ return "(pre)";
+}
+
+void
+RBAPreviousModifier::createHierarchy()
+{
+ objReference_->createHierarchy();
+}
+
+const std::string
+RBAPreviousModifier::getExpressionText() const
+{
+ return getSymbol() + objReference_->getExpressionText();
+}
+
+const std::string
+RBAPreviousModifier::getCoverageExpressionText() const
+{
+ return getSymbol() + objReference_->getCoverageExpressionText();
+}
+
+RBAExpressionType
+RBAPreviousModifier::getUnderlyingType() const
+{
+ return objReference_->getUnderlyingType();
+}
+
+#endif
+
+}
diff --git a/src/core/expression/RBAPreviousModifier.hpp b/src/core/expression/RBAPreviousModifier.hpp
new file mode 100644
index 0000000..ff34deb
--- /dev/null
+++ b/src/core/expression/RBAPreviousModifier.hpp
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * PreviousModifier class header
+ */
+
+
+#ifndef RBAPREVIOUSMODIFIER_HPP
+#define RBAPREVIOUSMODIFIER_HPP
+
+#include <memory>
+#include "RBAExpression.hpp"
+
+namespace rba
+{
+
+class RBAPreviousObjectWrapper;
+
+class DLL_EXPORT RBAPreviousModifier : public RBAExpression
+{
+public:
+ RBAPreviousModifier();
+ RBAPreviousModifier(const RBAPreviousModifier&)=delete;
+ RBAPreviousModifier(const RBAPreviousModifier&&)=delete;
+ RBAPreviousModifier& operator=(const RBAPreviousModifier&)=delete;
+ RBAPreviousModifier& operator=(const RBAPreviousModifier&&)=delete;
+ virtual ~RBAPreviousModifier()=default;
+
+ void accept(RBAExpressionVisitor& visitor) override;
+ void setObjReference(RBAExpression* const newObjRef);
+ RBAExpression* const getObjReference() const;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ virtual const std::string getSymbol() const;
+ void createHierarchy() override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+private:
+ // This pointer is not "const" in order to call
+ // objReference_->getReferenceObject()
+ RBAExpression* objReference_;
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::unique_ptr<RBAPreviousObjectWrapper> previousObj_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAPreviousModifierMaker.cpp b/src/core/expression/RBAPreviousModifierMaker.cpp
new file mode 100644
index 0000000..764ef34
--- /dev/null
+++ b/src/core/expression/RBAPreviousModifierMaker.cpp
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAPreviousModifierMaker.cpp
+/// @brief PreviousModifier object generator class definition
+
+#include "RBAPreviousModifierMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAPreviousModifier.hpp"
+#include "RBAPreviousObjectWrapper.hpp"
+
+namespace rba
+{
+
+RBAPreviousModifierMaker::RBAPreviousModifierMaker()
+ : RBAExpressionMaker{"PreviousModifier"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAPreviousModifierMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAPreviousModifier>();
+}
+
+RBAModelElement*
+RBAPreviousModifierMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBAPreviousModifier* const prevMod {dynamic_cast<RBAPreviousModifier*>(element)};
+
+ // Set LetStatement
+ const std::int32_t pop_num {setLetStatement(model, prevMod, jsonElem)};
+
+ // Set object reference
+ const RBAJsonElement* const objRefElem {jsonElem->findChildren("objReference")};
+ RBAModelElement* const expr {getFactory()->createElement(objRefElem->getClassName(),
+ objRefElem)};
+ prevMod->setObjReference(dynamic_cast<RBAExpression*>(expr));
+
+ // Pop variable
+ for(std::int32_t i{0}; i<pop_num; i++) {
+ getFactory()->popVariable();
+ }
+
+ return prevMod;
+}
+
+}
diff --git a/src/core/expression/RBAPreviousModifierMaker.hpp b/src/core/expression/RBAPreviousModifierMaker.hpp
new file mode 100644
index 0000000..0f58892
--- /dev/null
+++ b/src/core/expression/RBAPreviousModifierMaker.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAPreviousModifierMaker.cpp
+/// @brief PreviousModifier object generator class header
+
+#ifndef RBAPREVIOUSMODIFIERMAKER_HPP
+#define RBAPREVIOUSMODIFIERMAKER_HPP
+
+#include "RBAExpressionMaker.hpp"
+
+namespace rba
+{
+
+/// @brief PreviousModifier object generator class
+class RBAPreviousModifierMaker : public RBAExpressionMaker
+{
+public:
+ RBAPreviousModifierMaker();
+ RBAPreviousModifierMaker(const RBAPreviousModifierMaker&)=delete;
+ RBAPreviousModifierMaker(const RBAPreviousModifierMaker&&)=delete;
+ RBAPreviousModifierMaker& operator=(const RBAPreviousModifierMaker&)=delete;
+ RBAPreviousModifierMaker& operator=(const RBAPreviousModifierMaker&&)=delete;
+ virtual ~RBAPreviousModifierMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAPreviousObjectWrapper.cpp b/src/core/expression/RBAPreviousObjectWrapper.cpp
new file mode 100644
index 0000000..348b05f
--- /dev/null
+++ b/src/core/expression/RBAPreviousObjectWrapper.cpp
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * PreviousObjectWrapper (Previous Wrapper of RuleObject)
+ * generator class definition
+ */
+
+#include "RBAPreviousObjectWrapper.hpp"
+
+namespace rba
+{
+
+bool
+RBAPreviousObjectWrapper::isPrevious() const
+{
+ return true;
+}
+
+const RBARuleObject*
+RBAPreviousObjectWrapper::getRawObject() const
+{
+ return refObject_->getRawObject();
+}
+
+void
+RBAPreviousObjectWrapper::setRefObject(const RBARuleObject* const obj)
+{
+ refObject_ = obj;
+}
+
+}
diff --git a/src/core/expression/RBAPreviousObjectWrapper.hpp b/src/core/expression/RBAPreviousObjectWrapper.hpp
new file mode 100644
index 0000000..571c450
--- /dev/null
+++ b/src/core/expression/RBAPreviousObjectWrapper.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * PreviousObjectWrapper (Previous Wrapper of RuleObject)
+ * generator class header
+ */
+
+#ifndef RBAPREVIOUSOBJECTWRAPPER_HPP
+#define RBAPREVIOUSOBJECTWRAPPER_HPP
+
+#include "RBARuleObject.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAPreviousObjectWrapper : public RBARuleObject
+{
+public:
+ RBAPreviousObjectWrapper()=default;
+ RBAPreviousObjectWrapper(const RBAPreviousObjectWrapper&)=delete;
+ RBAPreviousObjectWrapper(const RBAPreviousObjectWrapper&&)=delete;
+ RBAPreviousObjectWrapper& operator=(const RBAPreviousObjectWrapper&)=delete;
+ RBAPreviousObjectWrapper& operator=(const RBAPreviousObjectWrapper&&)=delete;
+ virtual ~RBAPreviousObjectWrapper()=default;
+
+public:
+ bool isPrevious() const override;
+ const RBARuleObject* getRawObject() const override;
+ void setRefObject(const RBARuleObject* const obj);
+
+private:
+ const RBARuleObject* refObject_ {nullptr};
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAPropertyOperator.hpp b/src/core/expression/RBAPropertyOperator.hpp
new file mode 100644
index 0000000..250e6a2
--- /dev/null
+++ b/src/core/expression/RBAPropertyOperator.hpp
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * PropertyOperator class definition
+ */
+
+#ifndef RBAPROPERTYOPERATOR_HPP
+#define RBAPROPERTYOPERATOR_HPP
+
+#include "RBAOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAPropertyOperator : public RBAOperator
+{
+protected:
+ RBAPropertyOperator()=default;
+ RBAPropertyOperator(const RBAPropertyOperator&)=delete;
+ RBAPropertyOperator(const RBAPropertyOperator&&)=delete;
+ RBAPropertyOperator& operator=(const RBAPropertyOperator&)=delete;
+ RBAPropertyOperator& operator=(const RBAPropertyOperator&&)=delete;
+
+public:
+ virtual ~RBAPropertyOperator()=default;
+
+};
+
+}
+
+#endif
+ \ No newline at end of file
diff --git a/src/core/expression/RBASceneCondition.hpp b/src/core/expression/RBASceneCondition.hpp
new file mode 100644
index 0000000..44f543c
--- /dev/null
+++ b/src/core/expression/RBASceneCondition.hpp
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * SceneCondition class header
+ */
+
+#ifndef RBASCENECONDITION_HPP
+#define RBASCENECONDITION_HPP
+
+#include "RBAExpression.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBASceneCondition : public RBAExpression
+{
+protected:
+ RBASceneCondition()=default;
+ RBASceneCondition(const RBASceneCondition&)=delete;
+ RBASceneCondition(const RBASceneCondition&&)=delete;
+ RBASceneCondition& operator=(const RBASceneCondition&)=delete;
+ RBASceneCondition& operator=(const RBASceneCondition&&)=delete;
+public:
+ virtual ~RBASceneCondition()=default;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBASceneOperator.hpp b/src/core/expression/RBASceneOperator.hpp
new file mode 100644
index 0000000..630c655
--- /dev/null
+++ b/src/core/expression/RBASceneOperator.hpp
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * SceneOperator class header
+ */
+
+#ifndef RBASCENEOPERATOR_HPP
+#define RBASCENEOPERATOR_HPP
+
+#include "RBADllExport.hpp"
+#include "RBAOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBASceneOperator : public RBAOperator
+{
+protected:
+ RBASceneOperator()=default;
+ RBASceneOperator(const RBASceneOperator&)=delete;
+ RBASceneOperator(const RBASceneOperator&&)=delete;
+ RBASceneOperator& operator=(const RBASceneOperator&)=delete;
+ RBASceneOperator& operator=(const RBASceneOperator&&)=delete;
+public:
+ ~RBASceneOperator()=default;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBASelectOperator.cpp b/src/core/expression/RBASelectOperator.cpp
new file mode 100644
index 0000000..be74fa5
--- /dev/null
+++ b/src/core/expression/RBASelectOperator.cpp
@@ -0,0 +1,140 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * SelectOperator class definition
+ */
+
+#include <memory>
+#include "RBASelectOperator.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentSet.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAAllocatableSet.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALambdaExpression.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBASelectOperator::RBASelectOperator()
+: RBALambdaContext(),
+ allocatableSet_{std::make_unique<RBAAllocatableSet>()},
+ contentSet_{std::make_unique<RBAContentSet>()}
+{
+}
+
+void
+RBASelectOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBASelectOperator::getModelElementType() const
+{
+ return RBAModelElementType::SelectOperator;
+}
+
+const RBARuleObject* RBASelectOperator::getReferenceObjectCore(
+ RBAConstraintInfo* info, RBAArbitrator* arb) const
+{
+ LOG_addHierarchy(LOG_getSymbol());
+ const RBARuleObject* returnObj {nullptr};
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const lhsObj {getLhsOperand()->getReferenceObject(leftInfo,
+ arb)};
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (lhsObj != nullptr) {
+ if (dynamic_cast<const RBAAllocatableSet*>(lhsObj) != nullptr) {
+ std::list<const RBAAllocatable*> objs {
+ dynamic_cast<const RBAAllocatableSet*>(lhsObj)->getLeafAllocatable()};
+ allocatableSet_->clear();
+ std::uint32_t i {0U};
+ RBALambdaExpression* const lambda {getLambda()};
+ for (auto& obj : objs) {
+ LOG_addHierarchy("#" + std::to_string(i));
+ ++i;
+ RBAConstraintInfo* const childInfo {info->getChild(i)};
+ lambda->setRuleObj(obj);
+ const bool isPassed {lambda->execute(childInfo, arb)};
+ LOG_removeHierarchy();
+ if (isPassed && (!childInfo->isExceptionBeforeArbitrate())) {
+ allocatableSet_->addTarget(obj);
+ }
+ }
+ returnObj = allocatableSet_.get();
+ } else {
+ std::list<const RBAContent*> objs {
+ dynamic_cast<const RBAContentSet*>(lhsObj)->getLeafContent()};
+ contentSet_->clear();
+ std::uint32_t i {0U};
+ RBALambdaExpression* const lambda {getLambda()};
+ for (auto& obj : objs) {
+ LOG_addHierarchy("#" + std::to_string(i));
+ ++i;
+ RBAConstraintInfo* const childInfo {info->getChild(i)};
+ lambda->setRuleObj(obj);
+ const bool isPassed {lambda->execute(childInfo, arb)};
+ LOG_removeHierarchy();
+ if (isPassed && (!childInfo->isExceptionBeforeArbitrate())) {
+ contentSet_->addTarget(obj);
+ }
+ }
+ returnObj = contentSet_.get();
+ }
+ } else {
+ ;
+ }
+#ifdef RBA_USE_LOG
+ std::string objName = "NULL";
+ if (returnObj != nullptr) {
+ objName = returnObj->getElementName();
+ if (objName == "") {
+ objName = returnObj->getDynamicName();
+ }
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + LOG_getExpressionText() + " is " + objName);
+#endif
+ LOG_removeHierarchy();
+ return returnObj;
+}
+#ifdef RBA_USE_LOG
+const std::string RBASelectOperator::getSymbol() const
+{
+ return ".select";
+}
+
+const std::string RBASelectOperator::getExpressionText() const
+{
+ return getLhsOperand()->getExpressionText() + getSymbol()
+ + getLambda()->getExpressionText();
+}
+
+const std::string RBASelectOperator::getCoverageExpressionText() const
+{
+ getLambda()->clearRuleObj();
+ return getLhsOperand()->getCoverageExpressionText() + getSymbol()
+ + getLambda()->getCoverageExpressionText();
+}
+#endif
+
+} // namespace rba
diff --git a/src/core/expression/RBASelectOperator.hpp b/src/core/expression/RBASelectOperator.hpp
new file mode 100644
index 0000000..9c85fb0
--- /dev/null
+++ b/src/core/expression/RBASelectOperator.hpp
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * SelectOperator class header
+ */
+
+#ifndef RBASELECTOPERATOR_HPP
+#define RBASELECTOPERATOR_HPP
+
+#include "RBALambdaContext.hpp"
+
+namespace rba
+{
+
+class RBAAllocatableSet;
+class RBAContentSet;
+
+class RBASelectOperator : public RBALambdaContext
+{
+ public:
+ RBASelectOperator();
+ RBASelectOperator(const RBASelectOperator&)=delete;
+ RBASelectOperator(const RBASelectOperator&&)=delete;
+ RBASelectOperator& operator=(const RBASelectOperator&)=delete;
+ RBASelectOperator& operator=(const RBASelectOperator&&)=delete;
+ virtual ~RBASelectOperator()=default;
+
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+ private:
+ std::unique_ptr<RBAAllocatableSet> allocatableSet_;
+ std::unique_ptr<RBAContentSet> contentSet_;
+};
+
+} /* namespace rba */
+
+#endif /* RBASELECTOPERATOR_HPP */
diff --git a/src/core/expression/RBASelectOperatorMaker.cpp b/src/core/expression/RBASelectOperatorMaker.cpp
new file mode 100644
index 0000000..d7c1a35
--- /dev/null
+++ b/src/core/expression/RBASelectOperatorMaker.cpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBASelectOperatorMaker.cpp
+/// @brief SelectOperator object generator class definition
+
+#include "RBASelectOperatorMaker.hpp"
+#include "RBASelectOperator.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBALambdaExpression.hpp"
+
+namespace rba
+{
+
+RBASelectOperatorMaker::RBASelectOperatorMaker()
+ : RBALambdaContextMaker{"SelectOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBASelectOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBASelectOperator>();
+}
+
+RBAModelElement*
+RBASelectOperatorMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(
+ RBALambdaContextMaker::setProperty(element, jsonElem, model, owner));
+
+ return element;
+}
+
+std::unique_ptr<RBALambdaContext>
+RBASelectOperatorMaker::createLambdaContext()
+{
+ return std::make_unique<RBASelectOperator>();
+}
+
+}
diff --git a/src/core/expression/RBASelectOperatorMaker.hpp b/src/core/expression/RBASelectOperatorMaker.hpp
new file mode 100644
index 0000000..0415331
--- /dev/null
+++ b/src/core/expression/RBASelectOperatorMaker.hpp
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBASelectOperatorMaker.cpp
+/// @brief SelectOperator object generator class header
+
+#ifndef RBASELECTOPERATORMAKER_HPP
+#define RBASELECTOPERATORMAKER_HPP
+
+#include "RBALambdaContextMaker.hpp"
+
+namespace rba
+{
+
+/// @brief SelectOperator object generator class
+class RBASelectOperatorMaker : public RBALambdaContextMaker
+{
+public:
+ RBASelectOperatorMaker();
+ RBASelectOperatorMaker(const RBASelectOperatorMaker&)=delete;
+ RBASelectOperatorMaker(const RBASelectOperatorMaker&&)=delete;
+ RBASelectOperatorMaker& operator=(const RBASelectOperatorMaker&)=delete;
+ RBASelectOperatorMaker& operator=(const RBASelectOperatorMaker&&)=delete;
+ virtual ~RBASelectOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner) override;
+
+ /// @brief generate an empty object of LambdaContext
+ /// @details generate an empty object of unique_ptr
+ /// @return unique_ptr for object of LambdaContext
+ std::unique_ptr<RBALambdaContext> createLambdaContext() override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBASetExpression.hpp b/src/core/expression/RBASetExpression.hpp
new file mode 100644
index 0000000..5ad1de4
--- /dev/null
+++ b/src/core/expression/RBASetExpression.hpp
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * SetExpression class header
+ */
+
+#ifndef RBASETEXPRESSION_HPP
+#define RBASETEXPRESSION_HPP
+
+#include "RBAExpression.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBASetExpression : public RBAExpression
+{
+protected:
+ RBASetExpression()=default;
+ RBASetExpression(const RBASetExpression&)=delete;
+ RBASetExpression(const RBASetExpression&&)=delete;
+ RBASetExpression& operator=(const RBASetExpression&)=delete;
+ RBASetExpression& operator=(const RBASetExpression&&)=delete;
+public:
+ virtual ~RBASetExpression()=default;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBASetOfOperator.cpp b/src/core/expression/RBASetOfOperator.cpp
new file mode 100644
index 0000000..03e82eb
--- /dev/null
+++ b/src/core/expression/RBASetOfOperator.cpp
@@ -0,0 +1,194 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBASetOfOperator class definition
+ */
+
+#include <sstream>
+#include "RBASetOfOperator.hpp"
+#include "RBARuleObject.hpp"
+#include "RBAAllocatableSet.hpp"
+#include "RBAContentSet.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAContent.hpp"
+#include "RBALogManager.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+RBASetOfOperator::RBASetOfOperator()
+ : RBAOperator(),
+ allocatableSet_{std::make_unique<RBAAllocatableSet>()},
+ contentSet_{std::make_unique<RBAContentSet>()}
+{
+}
+
+void
+RBASetOfOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBASetOfOperator::getModelElementType() const
+{
+ return RBAModelElementType::SetOfOperator;
+}
+
+const RBARuleObject*
+RBASetOfOperator::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ allocatableSet_->clear();
+ contentSet_->clear();
+
+ bool isAllocatableSet {false};
+ bool isContentSet {false};
+
+ std::uint32_t i {0U};
+ for(const RBAExpression* const expr : getOperand()) {
+ RBAConstraintInfo* const childInfo {info->getChild(i)};
+ const RBARuleObject* const obj {expr->getReferenceObject(childInfo,arb)};
+ if(childInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ return nullptr;
+ }
+ if(obj != nullptr) {
+ if (obj->isModelElementType(RBAModelElementType::Area) ||
+ obj->isModelElementType(RBAModelElementType::Zone)) {
+ allocatableSet_->addTarget(dynamic_cast<const RBAAllocatable*>(obj));
+ isAllocatableSet = true;
+ }
+ else if (obj->isModelElementType(RBAModelElementType::ViewContent) ||
+ obj->isModelElementType(RBAModelElementType::SoundContent)) {
+ contentSet_->addTarget(dynamic_cast<const RBAContent*>(obj));
+ isContentSet = true;
+ }
+ else if (dynamic_cast<const RBAAllocatableSet*>(obj) != nullptr) {
+ for (const RBAAllocatable* const a : dynamic_cast<const RBAAllocatableSet*>(obj)->getLeafAllocatable()) {
+ allocatableSet_->addTarget(a);
+ }
+ isAllocatableSet = true;
+ } else {
+ for (const RBAContent* const c : dynamic_cast<const RBAContentSet*>(obj)->getLeafContent()) {
+ contentSet_->addTarget(c);
+ }
+ isContentSet = true;
+ }
+ }
+ i++;
+ }
+ if (isAllocatableSet) {
+ return allocatableSet_.get();
+ } else if (isContentSet){
+ return contentSet_.get();
+ } else {
+ return nullptr;
+ }
+}
+
+void
+RBASetOfOperator::doActionCore(RBAConstraintInfo* info, RBAArbitrator* arb)
+{
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy("SetOf");
+
+ std::uint32_t i {0U};
+ for(RBAExpression* const expr : getOperand()) {
+ // Add number of element to Constraint hierarchy for coverage
+ LOG_addHierarchy("#" + std::to_string(i) + ":");
+
+ // Since it should only execute Action, info is as it is
+ expr->doAction(info, arb);
+ i++;
+
+ // Remove number of element from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ }
+ // Remove itself from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+
+ return;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBASetOfOperator::getExpressionText() const
+{
+ std::ostringstream oss;
+ oss << "{";
+ const auto& exprList = getOperand();
+ const auto& lastExpr = exprList.back();
+ for (const auto& expr : exprList) {
+ oss << expr->getExpressionText();
+ if (expr != lastExpr) {
+ oss << ", ";
+ }
+ }
+ oss << "}";
+
+ return oss.str();
+}
+
+const std::string
+RBASetOfOperator::getCoverageExpressionText() const
+{
+ std::ostringstream oss;
+ oss << "{";
+ const auto& exprList = getOperand();
+ const auto& lastExpr = exprList.back();
+ for (const auto& expr : exprList) {
+ oss << expr->getCoverageExpressionText();
+ if (expr != lastExpr) {
+ oss << ", ";
+ }
+ }
+ oss << "}";
+
+ return oss.str();
+}
+
+void
+RBASetOfOperator::createHierarchy()
+{
+ // Add itself to Constraint hierarchy for coverage
+ LOG_addHierarchy("SetOf");
+ RBALogManager::coverageHierarchyOfConstraintExpressionLog(getCoverageExpressionText(), this);
+ uint32_t idx=0;
+ for(RBAExpression* expr : getOperand()) {
+ // Add number of element to Constraint hierarchy for coverage
+ LOG_addHierarchy("#"+std::to_string(idx)+":");
+ expr->createHierarchy();
+ // Remove number of element from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ idx++;
+ }
+ // Remove itself from Constraint hierarchy for coverage
+ LOG_removeHierarchy();
+}
+
+RBAExpressionType
+RBASetOfOperator::getUnderlyingType() const
+{
+ return getLhsOperand()->getUnderlyingType();
+}
+#endif
+
+}
diff --git a/src/core/expression/RBASetOfOperator.hpp b/src/core/expression/RBASetOfOperator.hpp
new file mode 100644
index 0000000..d73e1f7
--- /dev/null
+++ b/src/core/expression/RBASetOfOperator.hpp
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBASetOfOperator class header
+ */
+
+#ifndef RBASETOFOPERATOR_HPP
+#define RBASETOFOPERATOR_HPP
+
+#include <memory>
+#include "RBAOperator.hpp"
+
+namespace rba
+{
+
+class RBAAllocatableSet;
+class RBAContentSet;
+
+class DLL_EXPORT RBASetOfOperator : public RBAOperator
+{
+public:
+ RBASetOfOperator();
+ RBASetOfOperator(const RBASetOfOperator&)=delete;
+ RBASetOfOperator(const RBASetOfOperator&&)=delete;
+ RBASetOfOperator& operator=(const RBASetOfOperator&)=delete;
+ RBASetOfOperator& operator=(const RBASetOfOperator&&)=delete;
+ virtual ~RBASetOfOperator()=default;
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+ void createHierarchy() override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+protected:
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+ void doActionCore(RBAConstraintInfo* info, RBAArbitrator* arb) override;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::unique_ptr<RBAAllocatableSet> allocatableSet_;
+ std::unique_ptr<RBAContentSet> contentSet_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBASetOfOperatorMaker.cpp b/src/core/expression/RBASetOfOperatorMaker.cpp
new file mode 100644
index 0000000..f17f17d
--- /dev/null
+++ b/src/core/expression/RBASetOfOperatorMaker.cpp
@@ -0,0 +1,39 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBASetOfOperatorMaker.cpp
+/// @brief SetOfOperator object generator class
+
+#include "RBASetOfOperatorMaker.hpp"
+#include "RBASetOfOperator.hpp"
+#include "RBAAllocatableSet.hpp"
+#include "RBAContentSet.hpp"
+
+namespace rba
+{
+
+RBASetOfOperatorMaker::RBASetOfOperatorMaker()
+ : RBAOperatorMaker{"SetOfOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBASetOfOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBASetOfOperator>();
+}
+
+}
diff --git a/src/core/expression/RBASetOfOperatorMaker.hpp b/src/core/expression/RBASetOfOperatorMaker.hpp
new file mode 100644
index 0000000..87905fa
--- /dev/null
+++ b/src/core/expression/RBASetOfOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBASetOfOperatorMaker.cpp
+/// @brief SetOfOperator object generator class header
+
+#ifndef RBASETOFOPERATORMAKER_HPP
+#define RBASETOFOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief SetOfOperator object generator class
+class RBASetOfOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBASetOfOperatorMaker();
+ RBASetOfOperatorMaker(const RBASetOfOperatorMaker&)=delete;
+ RBASetOfOperatorMaker(const RBASetOfOperatorMaker&&)=delete;
+ RBASetOfOperatorMaker& operator=(const RBASetOfOperatorMaker&)=delete;
+ RBASetOfOperatorMaker& operator=(const RBASetOfOperatorMaker&&)=delete;
+ virtual ~RBASetOfOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBASetOperator.hpp b/src/core/expression/RBASetOperator.hpp
new file mode 100644
index 0000000..ded7a16
--- /dev/null
+++ b/src/core/expression/RBASetOperator.hpp
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * SetOperator class header
+ */
+
+#ifndef RBASETOPERATOR_HPP
+#define RBASETOPERATOR_HPP
+
+#include "RBAOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBASetOperator : public RBAOperator
+{
+protected:
+ RBASetOperator()=default;
+ RBASetOperator(const RBASetOperator&)=delete;
+ RBASetOperator(const RBASetOperator&&)=delete;
+ RBASetOperator& operator=(const RBASetOperator&)=delete;
+ RBASetOperator& operator=(const RBASetOperator&&)=delete;
+public:
+ virtual ~RBASetOperator()=default;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBASizeOperator.cpp b/src/core/expression/RBASizeOperator.cpp
new file mode 100644
index 0000000..c928bcf
--- /dev/null
+++ b/src/core/expression/RBASizeOperator.cpp
@@ -0,0 +1,84 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// SizeOperator class definition
+//
+
+#include "RBASizeOperator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBALogManager.hpp"
+#include "RBAAllocatableSet.hpp"
+#include "RBAContentSet.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void RBASizeOperator::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+RBAModelElementType RBASizeOperator::getModelElementType() const
+{
+ return RBAModelElementType::SizeOperator;
+}
+std::int32_t RBASizeOperator::getValueCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ LOG_addHierarchy(LOG_getSymbol());
+ std::int32_t returnValue {-99};
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const lhsObj {getLhsOperand()->getReferenceObject(leftInfo,
+ arb)};
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (lhsObj != nullptr) {
+ if (dynamic_cast<const RBAAllocatableSet*>(lhsObj) != nullptr) {
+ returnValue = static_cast<std::int32_t>(dynamic_cast<const RBAAllocatableSet*>(lhsObj)
+ ->getLeafAllocatable().size());
+ } else {
+ returnValue = static_cast<std::int32_t>(dynamic_cast<const RBAContentSet*>(lhsObj)->getLeafContent()
+ .size());
+ }
+ } else {
+ ;
+ }
+#ifdef RBA_USE_LOG
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + LOG_getExpressionText() + " is " + std::to_string(returnValue));
+#endif
+ LOG_removeHierarchy();
+ return returnValue;
+}
+
+#ifdef RBA_USE_LOG
+const std::string RBASizeOperator::getSymbol() const
+{
+ return ".size()";
+}
+const std::string RBASizeOperator::getExpressionText() const
+{
+ return getLhsOperand()->getExpressionText() + getSymbol();
+}
+const std::string RBASizeOperator::getCoverageExpressionText() const
+{
+ return getLhsOperand()->getCoverageExpressionText() + getSymbol();
+}
+#endif
+
+} /* namespace rba */
diff --git a/src/core/expression/RBASizeOperator.hpp b/src/core/expression/RBASizeOperator.hpp
new file mode 100644
index 0000000..26f22fa
--- /dev/null
+++ b/src/core/expression/RBASizeOperator.hpp
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// SizeOperator class header
+//
+
+#ifndef RBASIZEOPERATOR_HPP
+#define RBASIZEOPERATOR_HPP
+
+#include "RBASetOperator.hpp"
+
+namespace rba
+{
+
+class RBASizeOperator : public RBASetOperator
+{
+ public:
+ RBASizeOperator()=default;
+ RBASizeOperator(const RBASizeOperator&)=delete;
+ RBASizeOperator(const RBASizeOperator&&)=delete;
+ RBASizeOperator& operator=(const RBASizeOperator&)=delete;
+ RBASizeOperator& operator=(const RBASizeOperator&&)=delete;
+ virtual ~RBASizeOperator()=default;
+
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ std::int32_t getValueCore(RBAConstraintInfo* info, RBAArbitrator* arb) const override;
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+};
+
+} /* namespace rba */
+
+#endif /* SRC_CORE_EXPRESSION_RBASIZEOPERATOR_HPP_ */
diff --git a/src/core/expression/RBASizeOperatorMaker.cpp b/src/core/expression/RBASizeOperatorMaker.cpp
new file mode 100644
index 0000000..2a905c7
--- /dev/null
+++ b/src/core/expression/RBASizeOperatorMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBASizeOperatorMaker.cpp
+/// @brief SizeOperator object generator class definition
+
+#include "RBASizeOperatorMaker.hpp"
+#include "RBASizeOperator.hpp"
+
+namespace rba
+{
+
+RBASizeOperatorMaker::RBASizeOperatorMaker()
+ : RBAOperatorMaker{"SizeOperator"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBASizeOperatorMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBASizeOperator>();
+}
+
+}
diff --git a/src/core/expression/RBASizeOperatorMaker.hpp b/src/core/expression/RBASizeOperatorMaker.hpp
new file mode 100644
index 0000000..b5dd0f6
--- /dev/null
+++ b/src/core/expression/RBASizeOperatorMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBASizeOperatorMaker.hpp
+/// @brief SizeOperator object generator abstract class header
+
+#ifndef RBASIZEOPERATORMAKER_HPP
+#define RBASIZEOPERATORMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief SizeOperator object generator class
+class RBASizeOperatorMaker : public RBAOperatorMaker
+{
+public:
+ RBASizeOperatorMaker();
+ RBASizeOperatorMaker(const RBASizeOperatorMaker&)=delete;
+ RBASizeOperatorMaker(const RBASizeOperatorMaker&&)=delete;
+ RBASizeOperatorMaker& operator=(const RBASizeOperatorMaker&)=delete;
+ RBASizeOperatorMaker& operator=(const RBASizeOperatorMaker&&)=delete;
+ virtual ~RBASizeOperatorMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAStateValue.cpp b/src/core/expression/RBAStateValue.cpp
new file mode 100644
index 0000000..f2fe5cb
--- /dev/null
+++ b/src/core/expression/RBAStateValue.cpp
@@ -0,0 +1,107 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /// StateValue class denition
+
+#include <string>
+#include "RBAStateValue.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentState.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void RBAStateValue::accept(RBAExpressionVisitor& visitor)
+{
+ // RBASceneAllocatableCollector which is the only existing vistor
+ // does not pass this path because it does not accept
+ // the expression that returns Value. But, in the future,
+ // another visitor may accept, so implement this.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAStateValue::getModelElementType() const
+{
+ return RBAModelElementType::StateValue;
+}
+
+std::int32_t
+RBAStateValue::getValueCore(RBAConstraintInfo* info, RBAArbitrator* arb) const
+{
+ std::int32_t result { -99 };
+ const auto leftInfo = info->getChild(0U);
+ const auto r = getLhsOperand()->getReferenceObject(leftInfo, arb);
+ const RBAContent* c { nullptr };
+ const RBAContentState* cs { nullptr };
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ if (r != nullptr) {
+ c = dynamic_cast<const RBAContent*>(r->getRawObject());
+ if (c != nullptr) {
+ if (r->isPrevious()) {
+ cs = arb->getResult()->getPreActiveState(c);
+ } else {
+ cs = arb->getResult()->getActiveState(c);
+ }
+ if (cs != nullptr) {
+ result = cs->getContentStatePriority();
+ }
+ }
+ }
+ }
+#ifdef RBA_USE_LOG
+ std::string pre;
+ std::string cName { "NULL" };
+ std::string resultText{ "no Content skip" };
+ if (r != nullptr) {
+ cName = r->getElementName();
+ pre = getPreMsg(r->isPrevious());
+ }
+ if (info->isExceptionBeforeArbitrate()) {
+ resultText = "before arbitrate skip";
+ } else {
+ if (cs != nullptr) {
+ resultText = cs->getElementName() + " : " + std::to_string(result);
+ }
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " "
+ + pre
+ + "Content["
+ + cName
+ + "] state value ["
+ + resultText
+ + "]");
+#endif
+ return result;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAStateValue::getSymbol() const
+{
+ return ".stateValue()";
+}
+#endif
+
+}
diff --git a/src/core/expression/RBAStateValue.hpp b/src/core/expression/RBAStateValue.hpp
new file mode 100644
index 0000000..52cf8fc
--- /dev/null
+++ b/src/core/expression/RBAStateValue.hpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /// StateValue class header
+
+#ifndef RBASTATEVALUE_HPP
+#define RBASTATEVALUE_HPP
+
+#include <cstdint>
+#include "RBAContentOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAStateValue : public RBAContentOperator
+{
+public:
+ RBAStateValue()=default;
+ RBAStateValue(const RBAStateValue&)=delete;
+ RBAStateValue(RBAStateValue&&)=delete;
+ RBAStateValue& operator=(const RBAStateValue&)=delete;
+ RBAStateValue& operator=(RBAStateValue&&)=delete;
+ virtual ~RBAStateValue()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ std::int32_t getValueCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAStateValueMaker.cpp b/src/core/expression/RBAStateValueMaker.cpp
new file mode 100644
index 0000000..22a0c81
--- /dev/null
+++ b/src/core/expression/RBAStateValueMaker.cpp
@@ -0,0 +1,37 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAStateValueMaker.cpp
+/// @brief StateValue object generator class
+
+#include "RBAStateValueMaker.hpp"
+#include "RBAStateValue.hpp"
+
+namespace rba
+{
+
+RBAStateValueMaker::RBAStateValueMaker()
+ : RBAOperatorMaker{"StateValue"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAStateValueMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAStateValue>();
+}
+
+}
diff --git a/src/core/expression/RBAStateValueMaker.hpp b/src/core/expression/RBAStateValueMaker.hpp
new file mode 100644
index 0000000..8b01e09
--- /dev/null
+++ b/src/core/expression/RBAStateValueMaker.hpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAStateValueMaker.cpp
+/// @brief StateValue object generator class header
+
+#ifndef RBASTATEVALUEMAKER_HPP
+#define RBASTATEVALUEMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+/// @brief StateValue object generator class
+class RBAStateValueMaker : public RBAOperatorMaker
+{
+public:
+ RBAStateValueMaker();
+ RBAStateValueMaker(const RBAStateValueMaker&)=delete;
+ RBAStateValueMaker(const RBAStateValueMaker&&)=delete;
+ RBAStateValueMaker& operator=(const RBAStateValueMaker&)=delete;
+ RBAStateValueMaker& operator=(const RBAStateValueMaker&&)=delete;
+ virtual ~RBAStateValueMaker()=default;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAValueExpression.hpp b/src/core/expression/RBAValueExpression.hpp
new file mode 100644
index 0000000..111ad02
--- /dev/null
+++ b/src/core/expression/RBAValueExpression.hpp
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ValueExpression class header
+ */
+
+#ifndef RBAVALUEEXPRESSION_HPP
+#define RBAVALUEEXPRESSION_HPP
+
+#include "RBAExpression.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAValueExpression : public RBAExpression
+{
+protected:
+ RBAValueExpression()=default;
+ RBAValueExpression(const RBAValueExpression&)=delete;
+ RBAValueExpression(const RBAValueExpression&&)=delete;
+ RBAValueExpression& operator=(const RBAValueExpression&)=delete;
+ RBAValueExpression& operator=(const RBAValueExpression&&)=delete;
+public:
+ virtual ~RBAValueExpression()=default;
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAVariable.cpp b/src/core/expression/RBAVariable.cpp
new file mode 100644
index 0000000..9220c0a
--- /dev/null
+++ b/src/core/expression/RBAVariable.cpp
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Variable class defintion
+ */
+
+#include "RBAVariable.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBAVariable::RBAVariable(const std::string& name)
+ : RBARuleObject{name}
+{
+}
+
+RBAModelElementType
+RBAVariable::getModelElementType() const
+{
+ return RBAModelElementType::Variable;
+}
+
+const RBARuleObject*
+RBAVariable::getRuleObj() const
+{
+ return ruleObj_;
+}
+
+void
+RBAVariable::setRuleObj(const RBARuleObject* const ruleObj)
+{
+ ruleObj_ = ruleObj;
+}
+
+void
+RBAVariable::clearRuleObj()
+{
+ ruleObj_ = nullptr;
+}
+
+RBAConstraintInfo*
+RBAVariable::createConstraintInfo()
+{
+ // When the "Let" expression is written in a lambda expression such as
+ // "For-All", the expansion result of the "Let" expression also changes
+ // each time the variable of "For-All" changes. Even if the Let expression
+ // is written in "For-All", there is only one valiable object.
+ // Therefore, "constraintInfo" cannot be cleared and reused, and it is
+ // necessary to do "make_shared" each time the "Let" expression is evaluated.
+ // The ownership of the "ConstraintInfo" of the "Let" expression is
+ // transferred to the "ConstraintInfo" of the "RBAObjectReference"
+ // when the RBAObjectReference that refers to the definition of the Let
+ // expression is evaluated.
+ constraintInfo_ = std::make_shared<RBAConstraintInfo>();
+ return constraintInfo_.get();
+}
+
+std::shared_ptr<RBAConstraintInfo>
+RBAVariable::getConstraintInfo() const
+{
+ return constraintInfo_;
+}
+
+}
diff --git a/src/core/expression/RBAVariable.hpp b/src/core/expression/RBAVariable.hpp
new file mode 100644
index 0000000..88f071e
--- /dev/null
+++ b/src/core/expression/RBAVariable.hpp
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Variable class header
+ */
+
+#ifndef RBAVARIABLE_HPP
+#define RBAVARIABLE_HPP
+
+#include <memory>
+#include "RBARuleObject.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAVariable : public RBARuleObject
+{
+public:
+ explicit RBAVariable(const std::string& name="");
+ RBAVariable(const RBAVariable&)=delete;
+ RBAVariable(const RBAVariable&&)=delete;
+ RBAVariable& operator=(const RBAVariable&)=delete;
+ RBAVariable& operator=(const RBAVariable&&)=delete;
+ virtual ~RBAVariable()=default;
+
+public:
+ RBAModelElementType getModelElementType() const override;
+
+ const RBARuleObject* getRuleObj() const;
+ void setRuleObj(const RBARuleObject* const ruleObj);
+ void clearRuleObj();
+ RBAConstraintInfo* createConstraintInfo();
+ std::shared_ptr<RBAConstraintInfo> getConstraintInfo() const;
+
+private:
+ const RBARuleObject* ruleObj_ {nullptr};
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::shared_ptr<RBAConstraintInfo> constraintInfo_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/expression/RBAVariableMaker.cpp b/src/core/expression/RBAVariableMaker.cpp
new file mode 100644
index 0000000..aa7d5e8
--- /dev/null
+++ b/src/core/expression/RBAVariableMaker.cpp
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAVariableMaker.cpp
+/// @brief Variable object generator class definition
+
+#include "RBAVariableMaker.hpp"
+#include "RBAVariable.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAVariableMaker::RBAVariableMaker()
+ : RBAModelElementMaker::RBAModelElementMaker{"Variable"}
+{
+}
+
+RBAModelElement*
+RBAVariableMaker::create(const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ // Register the instance without a name, because Variable has the same name
+ std::unique_ptr<RBAModelElement> inst
+ {createInstance(jsonElem->findChildren("name")->getString())};
+ const auto element = inst.get();
+ static_cast<void>(model->addModelElement(std::move(inst)));
+
+ return setProperty(element, jsonElem, model, owner);
+}
+
+std::unique_ptr<RBAModelElement>
+RBAVariableMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAVariable>(name);
+}
+
+RBAModelElement*
+RBAVariableMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ return element;
+}
+
+}
diff --git a/src/core/expression/RBAVariableMaker.hpp b/src/core/expression/RBAVariableMaker.hpp
new file mode 100644
index 0000000..e3d52e6
--- /dev/null
+++ b/src/core/expression/RBAVariableMaker.hpp
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAVariableMaker.cpp
+/// @brief Variable object generator class header
+
+#ifndef RBAVARIABLEMAKER_HPP
+#define RBAVARIABLEMAKER_HPP
+
+#include "RBAModelElementMaker.hpp"
+
+namespace rba
+{
+
+/// @brief Variable object generator class
+class RBAVariableMaker : public RBAModelElementMaker
+{
+public:
+ RBAVariableMaker();
+ RBAVariableMaker(const RBAVariableMaker&)=delete;
+ RBAVariableMaker(const RBAVariableMaker&&)=delete;
+ RBAVariableMaker& operator=(const RBAVariableMaker&)=delete;
+ RBAVariableMaker& operator=(const RBAVariableMaker&&)=delete;
+ virtual ~RBAVariableMaker()=default;
+
+public:
+ /// @brief Create ModelElement object
+ /// @details Create ModelElement object and register unique_ptr to model.
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store created object
+ /// @param[in,out] owner Parent object (Not in use)
+ /// @return ModelElement object
+ RBAModelElement* create(const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+protected:
+ /// @brief generate an empty instance
+ /// @details generate an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set attributes of model element for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store created object
+ /// @param[in,out] owner Parent object (Not in use)
+ /// @return ModelElement object
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/logic/RBAAffectInfo.cpp b/src/core/logic/RBAAffectInfo.cpp
new file mode 100644
index 0000000..6cf4e98
--- /dev/null
+++ b/src/core/logic/RBAAffectInfo.cpp
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AffectInfo class definition
+ */
+
+#include "RBAAffectInfo.hpp"
+
+namespace rba
+{
+
+/**
+ * @brief Returns whether the allocable already affects the target allocable
+ * @param allocatable Influential Allocatable
+ * @param affectAllocatable Affected Allocatable
+ * @return bool
+ */
+bool
+RBAAffectInfo::alreadyKnowsThatFormerHasAffectedToLatter(const RBAAllocatable* const allocatable,
+ const RBAAllocatable* const affectAllocatable) const
+{
+ for(const auto& alloc : reaffected_[allocatable]) {
+ if(alloc == affectAllocatable) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * @brief Register Affect information
+ * @param allocatable Influential Allocatable
+ * @param affectAllocatable Affected Allocatable
+ */
+void
+RBAAffectInfo::addInfoThatFormerAffectedToLatter(const RBAAllocatable* const allocatable,
+ const RBAAllocatable* const affectAllocatable)
+{
+ static_cast<void>(reaffected_[allocatable].insert(affectAllocatable));
+}
+
+/**
+ * @brief Deletes the Affect information of "allocatable" registered by
+ *        other allocatables registered by arbitration of the specified
+ *        recursion hierarchy of the specified "allocatable".
+ * @param affectAllocatable
+ */
+void RBAAffectInfo::removeAffectInfo(const RBAAllocatable* const affectAllocatable)
+{
+ static_cast<void>(reaffected_.erase(affectAllocatable));
+}
+
+}
diff --git a/src/core/logic/RBAAffectInfo.hpp b/src/core/logic/RBAAffectInfo.hpp
new file mode 100644
index 0000000..c9c73be
--- /dev/null
+++ b/src/core/logic/RBAAffectInfo.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AffectInfo class header
+ */
+
+#ifndef RBAAFFECTINFO_HPP
+#define RBAAFFECTINFO_HPP
+
+#include <unordered_map>
+#include <set>
+
+namespace rba
+{
+
+class RBAAllocatable;
+
+class RBAAffectInfo
+{
+public:
+ RBAAffectInfo()=default;
+ RBAAffectInfo(const RBAAffectInfo&)=delete;
+ RBAAffectInfo(const RBAAffectInfo&&)=delete;
+ RBAAffectInfo& operator=(const RBAAffectInfo&)=delete;
+ RBAAffectInfo& operator=(const RBAAffectInfo&&)=delete;
+ virtual ~RBAAffectInfo()=default;
+
+public:
+ bool alreadyKnowsThatFormerHasAffectedToLatter(const RBAAllocatable* const allocatable,
+ const RBAAllocatable* const affectAllocatable) const;
+ void addInfoThatFormerAffectedToLatter(const RBAAllocatable* const allocatable,
+ const RBAAllocatable* const affectAllocatable);
+ void removeAffectInfo(const RBAAllocatable* const affectAllocatable);
+
+private:
+ // Information of other "allocatable" affected by "allocatable"
+ mutable std::unordered_map<const RBAAllocatable*,
+ std::set<const RBAAllocatable*>>reaffected_;
+
+};
+
+}
+
+#endif
diff --git a/src/core/logic/RBAArbitrator.cpp b/src/core/logic/RBAArbitrator.cpp
new file mode 100644
index 0000000..9fdd7d3
--- /dev/null
+++ b/src/core/logic/RBAArbitrator.cpp
@@ -0,0 +1,1987 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * Arbitrator class definition
+ */
+
+#include <algorithm>
+#include <sstream>
+#include "RBAArbitrator.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAResult.hpp"
+#include "RBAResultSet.hpp"
+#include "RBAAffectInfo.hpp"
+#include "RBAConstraintImpl.hpp"
+#include "RBAViewAction.hpp"
+#include "RBAViewTransition.hpp"
+#include "RBAViewMove.hpp"
+#include "RBARollbacker.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba {
+
+RBAArbitrator::RBAArbitrator(RBAModel* newModel)
+{
+ setModel(newModel);
+}
+
+#ifdef RBA_USE_LOG
+RBAArbitrator::RBAArbitrator(RBAModel* newModel, RBALogManager* logManager)
+{
+ setModel(newModel);
+ RBALogManager::setLogManager(logManager);
+ // Even if the argument logManager is null, it may be setLogManager()
+ // from outside the rba, so it is determined by getLogManager() instead of
+ // the argument determination.
+ if (RBALogManager::getLogManager() != nullptr) {
+ setSimulationMode(true);
+ }
+}
+#endif
+
+RBAArbitrator::~RBAArbitrator() noexcept
+{
+}
+
+void
+RBAArbitrator::setModel(RBAModel* newModel)
+{
+ setModel(dynamic_cast<RBAModelImpl*>(newModel));
+}
+
+const RBAModel*
+RBAArbitrator::getModel() const
+{
+ return dynamic_cast<RBAModel*>(model_);
+}
+
+void
+RBAArbitrator::initialize(std::list<std::string>& contexts)
+{
+ const std::lock_guard<std::recursive_mutex> lock{getMutex()};
+ setRequestData(contexts, true);
+}
+
+std::unique_ptr<RBAResult>
+RBAArbitrator::execute(const std::string& contextName, bool require)
+{
+ const std::lock_guard<std::recursive_mutex> lock {getMutex()};
+ if (isValidContext(contextName) == false) {
+ // In case of error, creates a copy of "Result",
+ // sets the error flag in it and returns
+ std::unique_ptr<RBAResultImpl> result {std::make_unique<RBAResultImpl>(
+ this, std::make_unique<RBAResultSet>(*getBackupResultSet()))};
+ result->setStatusType(RBAResultStatusType::UNKNOWN_CONTENT_STATE);
+ return std::move(result);
+ } else {
+ static_cast<void>(setRequestData(contextName, require, nullptr,
+ static_cast<std::uint32_t>(getRequestQue().size())));
+ return arbitrateMain();
+ }
+}
+
+std::unique_ptr<RBAResult>
+RBAArbitrator::execute(std::list<std::string>& contexts,
+ bool require)
+{
+ const std::lock_guard<std::recursive_mutex> lock {getMutex()};
+ if (isValidContext(contexts) == false) {
+ // In case of error, creates a copy of "Result",
+ // sets the error flag in it and returns
+ std::unique_ptr<RBAResultImpl> result {std::make_unique<RBAResultImpl>(
+ this, std::make_unique<RBAResultSet>(*getBackupResultSet()))};
+ result->setStatusType(RBAResultStatusType::UNKNOWN_CONTENT_STATE);
+ return std::move(result);
+ } else {
+ setRequestData(contexts, require);
+ return arbitrateMain();
+ }
+}
+
+std::unique_ptr<RBAResult>
+RBAArbitrator::execute(const std::string& sceneName,
+ std::list<std::pair<std::string,std::int32_t>>& properties)
+{
+ const std::lock_guard<std::recursive_mutex> lock {getMutex()};
+ // Check argument
+ if (isValidContext(sceneName) == false) {
+ // In case of error, creates a copy of "Result",
+ // sets the error flag in it and returns
+ std::unique_ptr<RBAResultImpl> result {std::make_unique<RBAResultImpl>(
+ this, std::make_unique<RBAResultSet>(*getBackupResultSet()))};
+ result->setStatusType(RBAResultStatusType::UNKNOWN_CONTENT_STATE);
+ return std::move(result);
+ } else {
+ static_cast<void>(setRequestData(sceneName, true, &properties,
+ static_cast<std::uint32_t>(getRequestQue().size())));
+ return arbitrateMain();
+ }
+}
+
+std::unique_ptr<RBAResult>
+RBAArbitrator::setResultContentState(const std::string& allocatableName,
+ const std::string& contextName)
+{
+ const std::lock_guard<std::recursive_mutex> lock{getMutex()};
+ RBAResultSet* const backupResultSetTmp {getBackupResultSet().get()};
+ if (getReservedResultSet() == nullptr) {
+ setResult(std::make_unique<RBAResultImpl>(this,
+ std::make_unique<RBAResultSet>(),
+ std::move(getBackupResultSet())));
+ } else {
+ RBAResultSet* const reservedResultSetTmp {getReservedResultSet().get()};
+ setResult(std::make_unique<RBAResultImpl>(this,
+ std::move(getReservedResultSet()),
+ std::move(getBackupResultSet())));
+ setReservedResultSet(std::make_unique<RBAResultSet>(*reservedResultSetTmp));
+ }
+ setBackupResultSet(std::make_unique<RBAResultSet>(*backupResultSetTmp));
+
+ // find allocatable
+ const RBAAllocatable* alloc {nullptr};
+ const RBAAreaImpl* const area {model_->findAreaImpl(allocatableName)};
+ if(area != nullptr) {
+ alloc = area;
+ }
+ else {
+ const RBAZoneImpl* const zone {model_->findZoneImpl(allocatableName)};
+ if(zone != nullptr) {
+ alloc = zone;
+ }
+ }
+ // find content state
+ const RBAContentState* state {nullptr};
+ const RBAViewContentStateImpl* const viewState
+ {model_->findViewContentStateImpl(contextName)};
+ if(viewState != nullptr) {
+ state = viewState;
+ }
+ else {
+ const RBASoundContentStateImpl* const soundState
+ {model_->findSoundContentStateImpl(contextName)};
+ if(soundState != nullptr) {
+ state = soundState;
+ }
+ }
+ if( (alloc == nullptr) || (state == nullptr) ) {
+ // Unknown context or allocatable
+ getResult()->setStatusType(RBAResultStatusType::UNKNOWN_CONTENT_STATE);
+ return std::move(getResultRef());
+ }
+ // Set alloc and state to result
+ const RBAContentState* const beforeContentState {alloc->getState()};
+ const_cast<RBAAllocatable*>(alloc)->setState(state);
+ const_cast<RBAAllocatable*>(alloc)->setChecked(true);
+ getResult()->setActive(state, true);
+ getResult()->setContentState(alloc, state);
+
+ // ----------------------------------------------------------
+ // Post processing of Arbitration
+ // ----------------------------------------------------------
+ postArbitrate();
+
+ // Excecute offline constraint
+#ifdef RBA_USE_LOG
+ checkAllConstraints();
+#endif
+
+ // ----------------------------------------------------------
+ // Update the state of Content
+ // ----------------------------------------------------------
+ if (beforeContentState != nullptr) {
+ // Update the state of the Content originally assigned to
+ // the requested Allocatable
+ dynamic_cast<RBAContent*>(beforeContentState->getOwner())->updateStatus(getResultRef().get());
+ }
+ // Update the state of requested Content
+ dynamic_cast<RBAContent*>(state->getOwner())->updateStatus(getResultRef().get());
+
+ // Cancel processing of Content
+ checkCancelContent();
+
+ // Update display and non-display Area
+ updateResult();
+
+ // Generate Result
+ createResultData();
+
+ // Store backup of current arbitration result set
+ setBackupResultSet(getResult()->createBackupCurrentResultSet());
+ // Create next arbitration result set
+ setNextResultSet(getResult()->createNextCurrentResultSet());
+
+ return std::move(getResultRef());
+}
+
+std::unique_ptr<RBAResult>
+RBAArbitrator::cancelArbitration()
+{
+ const std::lock_guard<std::recursive_mutex> lock{getMutex()};
+ if(getReservedResultSet() == nullptr) {
+ std::unique_ptr<RBAResultImpl> res
+ {std::make_unique<RBAResultImpl>(this,
+ std::make_unique<RBAResultSet>())};
+ res->setStatusType(RBAResultStatusType::CANCEL_ERROR);
+ return std::move(res);
+ }
+
+ setResult(
+ std::make_unique<RBAResultImpl>(this,
+ std::make_unique<RBAResultSet>(),
+ std::move(getReservedResultSet())));
+ setBackupResultSet(getResult()->createBackupCurrentResultSet());
+ setNextResultSet(getResult()->createNextCurrentResultSet());
+
+ return std::move(getResultRef());
+}
+
+void
+RBAArbitrator::clearArbitration()
+{
+ std::lock_guard<std::recursive_mutex> lock {getMutex()};
+ getCancelChecked().clear();
+ setReservedResultSet(nullptr);
+ setBackupResultSet(std::make_unique<RBAResultSet>());
+ for(const auto& scene : model_->getSceneImpls()) {
+ for(const std::string propertyName : scene->getPropertyNames()) {
+ const std::int32_t value {scene->getPropertyValue(propertyName)};
+ getBackupResultSet()->setSceneProperty(scene, propertyName, value);
+ }
+ }
+ setNextResultSet(
+ std::make_unique<RBAResultSet>(*getBackupResultSet().get()));
+ setResult(std::make_unique<RBAResultImpl>(
+ this,
+ std::make_unique<RBAResultSet>(*getBackupResultSet().get())));
+
+ model_->clearElementsStatus();
+}
+
+bool
+RBAArbitrator::setScene(const std::string& sceneName, bool require,
+ std::list<std::pair<std::string, std::int32_t>>& properties)
+{
+ const std::lock_guard<std::recursive_mutex> lock{getMutex()};
+ return setRequestData(sceneName, require, &properties);
+}
+
+bool
+RBAArbitrator::setContentState(const std::string& contextName, bool require)
+{
+ const std::lock_guard<std::recursive_mutex> lock{getMutex()};
+ const std::deque<std::unique_ptr<RBARequestQueMember>>& requestQue{getRequestQue()};
+ std::uint32_t syncIndex{static_cast<std::uint32_t>(requestQue.size())};
+ if (syncIndex > 0U ) {
+ const std::unique_ptr<RBARequestQueMember>& prevReq{requestQue.back()};
+ if (prevReq->isOn() == require) {
+ syncIndex = prevReq->getSyncIndex();
+ }
+ }
+ return setRequestData(contextName, require, nullptr, syncIndex);
+}
+
+bool
+RBAArbitrator::setAllocatableResult(const std::string& allocatableName,
+ const std::string& contextName)
+{
+ std::lock_guard<std::recursive_mutex> lock {getMutex()};
+ // Get allocatable
+ const auto alloc = model_->findAllocatable(allocatableName);
+ if(alloc == nullptr) {
+ return false;
+ }
+
+ // Get context
+ const auto state = model_->findContentState(contextName);
+ if(state == nullptr) {
+ return false;
+ }
+
+ // Set state to allocatable
+ const auto beforeContentState = alloc->getState();
+ const_cast<RBAAllocatable*>(alloc)->setState(state);
+ RBAResultSet* const nextResultSet {getNextResultSet().get()};
+ RBAResultSet* const prevResultSet {getBackupResultSet().get()};
+ nextResultSet->setContentState(alloc, state);
+ prevResultSet->setContentState(alloc, state);
+ nextResultSet->setActive(state, true);
+ prevResultSet->setActive(state, true);
+
+ // ----------------------------------------------------------
+ // Update the state of Content
+ // ----------------------------------------------------------
+ // Create "result" and update state, because updating the content state
+ // determines the transition destination this time
+ // based on previous state.
+ setResult(std::make_unique<RBAResultImpl>(
+ this,
+ std::make_unique<RBAResultSet>(*getBackupResultSet()),
+ std::make_unique<RBAResultSet>(*getNextResultSet())));
+ RBAContent* const content {dynamic_cast<RBAContent*>(state->getOwner())};
+ content->updateRequestStatus(getResult()->getCurResultSet().get(), true);
+ if (beforeContentState != nullptr) {
+ // Update the state of the content originally assigned to
+ // the requested Allocatable
+ dynamic_cast<RBAContent*>(beforeContentState->getOwner())->updateStatus(getResultRef().get());
+ }
+ // Update the state of requested Content
+ content->updateStatus(getResultRef().get());
+
+ setBackupResultSet(std::make_unique<RBAResultSet>(*getResult()->getPreResultSet()));
+ setNextResultSet(getResult()->createNextCurrentResultSet());
+
+ return true;
+}
+
+bool
+RBAArbitrator::RBAArbitrator::evaluate(RBAExpression* expression)
+{
+ if(expression == nullptr) {
+ return false;
+ }
+ const std::lock_guard<std::recursive_mutex> lock{getMutex()};
+ RBAConstraintInfo info;
+ // Constraint expression evaluation
+ return expression->execute(&info, this);
+}
+
+const RBARuleObject*
+RBAArbitrator::evaluateObject(RBAExpression* expression)
+{
+ if(expression == nullptr) {
+ return nullptr;
+ }
+ const std::lock_guard<std::recursive_mutex> lock{getMutex()};
+ RBAConstraintInfo info;
+ // Constraint expression evaluation
+ const RBARuleObject* const ruleObj
+ {expression->getReferenceObject(&info, this)};
+ if (ruleObj != nullptr) {
+ return ruleObj->getRawObject();
+ } else {
+ return nullptr;
+ }
+}
+
+int32_t
+RBAArbitrator::evaluateValue(RBAExpression* expression)
+{
+ if(expression == nullptr) {
+ return -99;
+ }
+ const std::lock_guard<std::recursive_mutex> lock{getMutex()};
+ RBAConstraintInfo info;
+ // Constraint expression evaluation
+ return expression->getValue(&info, this);
+}
+
+
+void
+RBAArbitrator::setModel(RBAModelImpl* const newModel)
+{
+ std::lock_guard<std::recursive_mutex> lock {getMutex()};
+ model_ = newModel;
+ model_->createSortedAllocatables();
+ clearArbitration();
+}
+
+bool
+RBAArbitrator::
+satisfiesConstraints() const
+{
+ const std::lock_guard<std::recursive_mutex> lock{mutex_};
+ // Temporarily store the actual result_
+ // because result_ is used for evaluation
+ std::unique_ptr<RBAResultImpl> tmpResult {std::move(result_)};
+ result_ = std::make_unique<RBAResultImpl>(
+ this,
+ std::make_unique<RBAResultSet>(*(reservedResultSet_.get())),
+ std::make_unique<RBAResultSet>(*(resultSetForSatisfiesConstraints_.get())));
+ bool result {true};
+ for(const RBAConstraintImpl*& constraint : model_->getConstraintImpls()) {
+ if (constraint->isRuntime() == true) {
+ result = const_cast<RBAConstraintImpl*>(constraint)->execute(const_cast<RBAArbitrator*>(this));
+ if (result == false) {
+ break;
+ }
+ }
+ }
+ result_ = std::move(tmpResult);
+ return result;
+}
+
+/**
+ * Execute arbitration
+ */
+std::unique_ptr<RBAResult>
+RBAArbitrator::arbitrateMain()
+{
+ // Store request state before arbitration,
+ // in case cancelArbitration() is executed
+ reservedResultSet_ = std::make_unique<RBAResultSet>(*backupResultSet_);
+
+ // Differential arbitration for each request
+ if (requestQue_.empty()) {
+ // Prepare Result here because it will be used in differenceArbitrate.
+ result_ = std::make_unique<RBAResultImpl>(this,
+ std::move(backupResultSet_),
+ std::move(nextResultSet_));
+ // Arbitration request without arguments.
+ // there is a possibility of being queued in "requestQue_"
+ // due to "onDisplayed" in this,
+ differenceArbitrate();
+ }
+ if (!requestQue_.empty()) {
+ result_ = std::make_unique<RBAResultImpl>(this,
+ std::move(backupResultSet_),
+ std::move(nextResultSet_));
+ do {
+ const std::unique_ptr<RBARequestQueMember> request {std::move(requestQue_.front())};
+ requestQue_.pop_front();
+ result_->setActive(request->getContentState(), request->isOn());
+ // Update the state of Content
+ RBAContent* const content {dynamic_cast<RBAContent*>(request->getContentState()->getOwner())};
+ content->updateRequestStatus(result_->getCurResultSet().get(), request->isOn());
+ if (requestQue_.empty()) {
+ differenceArbitrate();
+ if (!requestQue_.empty()) {
+ // Update "result_" for the next differenceArbitrate().
+ result_ = std::make_unique<RBAResultImpl>(this,
+ std::move(backupResultSet_),
+ std::move(nextResultSet_));
+ }
+ } else if (requestQue_.front()->getSyncIndex() != request->getSyncIndex()) {
+ differenceArbitrate();
+ // Update "result_" for the next differenceArbitrate().
+ result_ = std::make_unique<RBAResultImpl>(this,
+ std::move(backupResultSet_),
+ std::move(nextResultSet_));
+ } else {
+ // No Operation
+ }
+ } while (!requestQue_.empty());
+ }
+
+ result_ = std::make_unique<RBAResultImpl>(
+ this, std::make_unique<RBAResultSet>(*reservedResultSet_),
+ result_->createBackupCurrentResultSet());
+
+ // Cancel processing of Content
+ checkCancelContent();
+
+ // Update displayed and non-displayed Area
+ updateResult();
+
+#ifdef RBA_USE_LOG
+ RBALogManager::setType(RBALogManager::TYPE_RESULT);
+ logResultArbitration();
+
+ setLogToResult();
+ RBALogManager::setType(RBALogManager::TYPE_NOTHING);
+#endif
+
+ createResultData();
+ // Store backup of current arbitration result set
+ backupResultSet_ = result_->createBackupCurrentResultSet();
+ // Create next arbitration result set
+ nextResultSet_ = result_->createNextCurrentResultSet();
+
+ // The "result_" of the return value is changed to another name,
+ // because "result_" will be used for storing.
+ auto retResult = std::move(result_);
+
+ // Hold the arbitration result because the arbitration result may be used
+ // in cases other than arbitration.
+ result_ = std::make_unique<RBAResultImpl>(retResult.get());
+
+ // A compile error occurs if std::move() is missing because
+ // std::unique_ptr<RBAResultImpl> is cast to std::unique_ptr<RBAResult>
+ return std::move(retResult);
+}
+
+bool
+RBAArbitrator::
+isValidContext(const std::string& context)
+{
+ if (context != "") {
+ const RBAContentState* const state {model_->findContentState(context)};
+ if (state == nullptr) {
+ const RBASceneImpl* const scene {model_->findSceneImpl(context)};
+ if (scene == nullptr) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
+bool
+RBAArbitrator::
+isValidContext(std::list<std::string>& contexts)
+{
+ for(const std::string contextName : contexts) {
+ if(isValidContext(contextName) == false) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Reflect input information
+ */
+
+bool
+RBAArbitrator::setRequestData(
+ const std::string& context, bool require,
+ std::list<std::pair<std::string, std::int32_t>>* const properties,
+ std::uint32_t syncIndex)
+{
+ bool isSet {false};
+ if (context != "") {
+ // When content state is specified
+ // If contextName is the only content name, pop the first content state
+ const RBAContentState* state {model_->findContentState(context)};
+ if (state != nullptr) {
+ requestQue_.push_back( std::make_unique<RBARequestQueMember>(state, require, syncIndex));
+ isSet = true;
+ } else {
+ // When Scene is specified
+ const RBASceneImpl* const scene {model_->findSceneImpl(context)};
+ if (scene != nullptr) {
+ // for next arbitration
+ nextResultSet_->setActive(scene, require);
+ // For when "Result" is referenced before the next arbitration
+ result_->setActive(scene, require);
+ isSet = true;
+ if (properties != nullptr) {
+ for (auto& p : *properties) {
+ const RBAAbstractProperty* const ap {scene->getProperty(p.first)};
+ if (ap != nullptr) {
+ // for next arbitration
+ nextResultSet_->setSceneProperty(ap, p.second);
+ // For when "Result" is referenced before the next arbitration
+ result_->setSceneProperty(ap, p.second);
+ }
+ }
+ }
+ }
+ }
+ }
+ return isSet;
+}
+
+void
+RBAArbitrator::setRequestData(const RBAContentState* state,
+ bool require)
+{
+ if (requestQue_.empty()){
+ requestQue_.push_back( std::make_unique<RBARequestQueMember>(state, require, 0U));
+ } else {
+ requestQue_.push_back( std::make_unique<RBARequestQueMember>(state, require, requestQue_.back()->getSyncIndex()));
+ }
+}
+
+void
+RBAArbitrator::setRequestData(const RBAContent* const content,
+ bool require)
+{
+ if (requestQue_.empty()){
+ requestQue_.push_back( std::make_unique<RBARequestQueMember>(content->getStates().front(), require, 0U));
+ } else {
+ requestQue_.push_back( std::make_unique<RBARequestQueMember>(content->getStates().front(), require, requestQue_.back()->getSyncIndex()));
+ }
+}
+
+void
+RBAArbitrator::setActive(const RBASceneImpl* const scene, const bool require)
+{
+ if (nextResultSet_ != nullptr) {
+ // Update nextResultSet_" when onScene is done in onRequest or onWithdrawn
+ nextResultSet_->setActive(scene, require);
+ } else {
+ result_->setActive(scene, require);
+ }
+}
+
+void
+RBAArbitrator::setSceneProperty(const RBAAbstractProperty* const prop, const std::int32_t value)
+{
+ if (nextResultSet_ != nullptr) {
+ // Update nextResultSet_" when onScene is done in onRequest or onWithdrawn
+ nextResultSet_->setSceneProperty(prop, value);
+ } else {
+ result_->getCurResultSet()->setSceneProperty(prop, value);
+ }
+}
+
+void
+RBAArbitrator::setRequestData(std::list<std::string>& contexts,
+ const bool require)
+{
+ const std::uint32_t syncIndex {static_cast<std::uint32_t>(requestQue_.size())};
+ for (auto& c : contexts) {
+ static_cast<void>(setRequestData(c, require, nullptr, syncIndex));
+ }
+}
+
+/**
+ * @brief Execute an extended version of arbitration that allows arbitration
+ when the "implication" is false
+ * @param areas
+ */
+void
+RBAArbitrator::
+arbitrate(std::list<RBAAllocatable*>& allocatables)
+{
+ LOG_arbitrateAreaLogLine("----Arbitrate----");
+ std::set<const RBAAllocatable*> revisitedInitSet;
+
+ std::set<const RBAAllocatable*> revisited;
+ for (auto& alloc : allocatables) {
+ revisited = revisitedInitSet;
+ // -------------------------------------------------------------------------
+ // To prevent an infinite loop, generate information to limit registration
+   // of other "allocable" that affected the target "allocatable"
+ // during arbitration
+ // -------------------------------------------------------------------------
+ RBAAffectInfo affectInfo;
+ LOG_arbitrateAreaLogLine(
+ alloc->getSymbol() + "[" + alloc->getElementName() + "] check start");
+ arbitrateAllocatable(alloc, revisited, 0, &affectInfo, nullptr);
+ }
+ for (auto& a : model_->getSortedAllocatables()) {
+ result_->setContentState(a, a->getState());
+ }
+}
+
+/**
+ * @brief Recursively arbitrate "allocatable"
+ * @param allocatable Allocatable that you want to arbitrate
+ * @param revisited Allocatable that re-arbitration is complete
+ * @param nest Re-arbitration nesting hierarchy (first arbitration is zero)
+ * @param affectInfo Allocatable information affected by "allocatable"
+ */
+void RBAArbitrator::arbitrateAllocatable(
+ RBAAllocatable* allocatable,
+ std::set<const RBAAllocatable*>& revisited,
+ const std::int32_t nest,
+ RBAAffectInfo* const affectInfo,
+ RBARollbacker* const parentRollbacker)
+{
+#ifdef RBA_USE_LOG
+ RBALogManager::setIndent(nest);
+#endif
+ // "Allocable" affected by "Allocable" which is the target of this arbitration
+ // during the recursive process until this variable is defined,
+ std::set<const RBAAllocatable*> affectAllocatables;
+ affectAllocatables.insert(allocatable->getAllocatablesAffectedByYou().begin(),
+ allocatable->getAllocatablesAffectedByYou().end());
+
+ const RBAContentState* const beforeState {allocatable->getState()};
+
+ // Mark Content allocation for target Allocable" as "checked"
+ allocatable->setChecked(true);
+ // Get content status sorted by arbitration policy
+ // (only active requests)
+ std::list<const RBAContentState*> contentStates;
+ getSortedContentStates(allocatable, contentStates);
+ for(const RBAContentState* const contentState : contentStates) {
+ // Allocate Content to Area
+ allocatable->setState(contentState);
+#ifdef RBA_USE_LOG
+ {
+ std::string str = " Content[";
+ if (contentState == nullptr) {
+ str += "null";
+ } else {
+ str += contentState->getOwner()->getElementName() + "::"
+ + contentState->getElementName();
+ }
+ str += "] check online constraints start";
+ RBALogManager::arbitrateContentLogLine(str);
+ }
+#endif
+ bool isSkipped {false};
+ const bool isPassed {checkConstraintAndReArbitrate(
+ allocatable, revisited, nest, affectInfo, parentRollbacker,
+ allocatable->getConstraints(), &isSkipped, false)};
+ if (isPassed == true) {
+
+ // ----------------------------------------------------------
+ // Check if self-allocatable should be hidden
+ // by constraint expression after content allocation process.
+ // Check even if content is not assigned because there is contentValue()
+ // ----------------------------------------------------------
+#ifdef RBA_USE_LOG
+ std::string alloSymbol = allocatable->getSymbol();
+ std::string alloName = allocatable->getElementName();
+ if (allocatable->isArea() == true) {
+ LOG_arbitrateAreaLogLine(
+ " check online constraints to confirm area hidden state");
+ } else {
+ LOG_arbitrateAreaLogLine(
+ " check online constraints to confirm zone muted state");
+ }
+#endif
+ // Mark "hidden" of target "Allocable" as "checked"
+ allocatable->setHiddenChecked(true);
+ // Set "hidden" of target "Allocable" to false
+ allocatable->setHidden(false);
+ bool hiddenIsPassed {checkConstraintAndReArbitrate(
+ allocatable, revisited, nest, affectInfo, parentRollbacker,
+ allocatable->getHiddenFalseCheckConstraints(), &isSkipped,
+ !allocatable->isZone())};
+ if (hiddenIsPassed == false) {
+ allocatable->setHidden(true);
+ hiddenIsPassed = checkConstraintAndReArbitrate(
+ allocatable, revisited, nest, affectInfo, parentRollbacker,
+ allocatable->getHiddenTrueCheckConstraints(), &isSkipped,
+ !allocatable->isZone());
+ if (hiddenIsPassed == false) {
+ // Clear hiding state of Allocatable
+ allocatable->setHiddenChecked(false);
+ } else {
+ LOG_arbitrateAreaLogLine(
+ alloSymbol + "[" + alloName + "] change "
+ + allocatable->getHiddenSymbol());
+ }
+ }
+
+ // -------------------------------------
+ // For Zone, judge attenuation after hiding (mute)
+ // -------------------------------------
+ bool attenuateIsPassed {true};
+ if (allocatable->isZone()) {
+ RBAZoneImpl* const zone {dynamic_cast<RBAZoneImpl*>(allocatable)};
+ // Mark "attenuattion" of target "Zone" as checked"
+ zone->setAttenuateChecked(true);
+ // Set "attenuattion" of target "Zone" to false
+ zone->setAttenuated(false);
+ LOG_arbitrateAreaLogLine(
+ " check online constraints to confirm zone attenuated state");
+ attenuateIsPassed = checkConstraintAndReArbitrate(
+ allocatable, revisited, nest, affectInfo, parentRollbacker,
+ allocatable->getAttenuateFalseCheckConstraints(), &isSkipped, true);
+ if (attenuateIsPassed == false) {
+ zone->setAttenuated(true);
+ attenuateIsPassed = checkConstraintAndReArbitrate(
+ allocatable, revisited, nest, affectInfo, parentRollbacker,
+ allocatable->getAttenuateTrueCheckConstraints(), &isSkipped, true);
+ if (attenuateIsPassed == false) {
+ allocatable->setAttenuateChecked(false);
+ } else {
+ LOG_arbitrateAreaLogLine(
+ alloSymbol + "[" + alloName + "] change attenuated");
+ }
+ }
+ }
+#ifdef RBA_USE_LOG
+ {
+ std::string str = alloSymbol + "[" + alloName + "] ";
+ if (allocatable->isArea() == true) {
+ str += "displays";
+ } else {
+ str += "outputs";
+ }
+ str += " Content[";
+ const RBAContentState* state = allocatable->getState();
+ if (state == nullptr) {
+ str += "null";
+ } else {
+ str += state->getOwner()->getElementName() + "::"
+ + state->getElementName();
+ }
+ str += "] " + allocatable->getHiddenSymbol() + "["
+ + RBALogManager::boolToString(allocatable->isHidden()) + "]";
+ if (allocatable->isZone() == true) {
+ str += " attenuated["
+ + RBALogManager::boolToString(allocatable->isAttenuated()) + "]";
+ }
+ str += "\n";
+ LOG_arbitrateAreaLogLine(str);
+ }
+#endif
+ if ((hiddenIsPassed == true) && (attenuateIsPassed == true)) {
+ break;
+ }
+ }
+ }
+ // ---------------------------------------------------------------------
+ // Re-arbitration of the Allocatable that influenced
+ // ---------------------------------------------------------------------
+ if ((beforeState != allocatable->getState())
+ || allocatable->isHidden()
+ || allocatable->isAttenuated()) {
+
+ // Re-arbitration is performed in a state other than "hidden"
+ // When allocating content. Therefore, if state become "hidden" or
+ // "attenuation", re-arbitration is required for the "allocatable"
+ // that was affected by re-arbitration during content allocation.
+ // Update the increased Area that influenced
+ if (allocatable->isHidden() || allocatable->isAttenuated()) {
+ for (const auto& a : allocatable->getAllocatablesAffectedByYou()) {
+ static_cast<void>(affectAllocatables.insert(a));
+ }
+ }
+
+ // If the re-arbitration source of Area/Zone (including any re-arbitration
+ // sources, if any reconciliation nests) becomes an Area/Zone affected by
+ // the re-arbitration area/zone, such Area/Zone is excluded from
+ // the re-arbitration target and the affected Area/Zone is re-arbitrated.
+ // Further, even if the affected Area/Zone is unarbitrated Allocatable
+ // at that time, it is excluded from the re-arbitration target of
+ // the affected Area. This is because it is sufficient to arbitrate
+ // during normal arbitration.
+ for (const auto& a : revisited) {
+ if (affectAllocatables.find(a) != affectAllocatables.end()
+ || (!a->isChecked())) {
+ static_cast<void>(affectAllocatables.erase(a));
+ }
+ }
+ std::list<const RBAAllocatable*> sortedAllocatables(affectAllocatables.begin(),affectAllocatables.end());
+ sortedAllocatables.sort(&RBAAllocatable::compareIndex);
+ if (parentRollbacker != nullptr) {
+ std::shared_ptr<RBARollbacker> rollbacker {std::make_shared<RBARollbacker>()};
+ parentRollbacker->addChild(rollbacker);
+ rollbacker->backup(sortedAllocatables);
+ }
+
+ for (auto& affect : sortedAllocatables) {
+ // Remove Allocatable which will be re-arbitration from Allocatable
+ // that influenced Allocable during arbitration.
+ allocatable->removeAffectAllocatable(affect);
+ }
+ static_cast<void>(revisited.insert(allocatable)); // Add to arbitrated Area
+ for (auto& affectAllocatable : sortedAllocatables) {
+ // @Deviation (EXP55-CPP,Rule-5_2_5,A5-2-3)
+ // [Contents that deviate from the rules]
+ // This is a 'const_cast' expression that strips away a 'const' or
+ // 'volatile' qualifier.
+ // [Why there is no problem if it deviate from the rules]
+   // Confirmed that there is no problem from the design point of view.
+ // We won't fix it now because we need to redesign the class, but
+ // no much effort as of now.
+ RBAAllocatable* allo {const_cast<RBAAllocatable*>(affectAllocatable)};
+
+ // Initialize the check flag of the Allocatable that performs the
+ // re-arbitration of the affetcted Allocatable
+ // If the affected Allocables are cleared in advance, a skip occurred in
+ // the constraint expression evaluation during the re-arbitration of
+ // the affected Allocatable that was carried out earlier, after that
+ // re-arbitration will work during re-arbitration of affected Allocatable.
+ // Therefore, clear check flag individually
+ // before re-arbitration of affected Allocable
+ allo->clearChecked();
+
+ LOG_arbitrateAreaLogLine( " " +
+ affectAllocatable->getSymbol() + "["
+ + affectAllocatable->getElementName()
+ + "] affect allocatable check start");
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // Recursively calling arbitrateAllocatable()
+ // [Why there is no problem if it deviate from the rules]
+ // - This process is necessary for re-arbitration of the affected Area,
+ // - stack overflow will not occur becasue the infinite loop
+ // prevention process is imeplemented.
+ arbitrateAllocatable(allo, revisited, nest + 1, affectInfo,
+ parentRollbacker);
+ }
+ for(const RBAAllocatable* const revisitAllocatable : sortedAllocatables) {
+ static_cast<void>(revisited.erase(revisitAllocatable));
+ }
+ }
+
+ // --------------------------------------------------
+ // Delete temporary affect information
+ // to prevent infinite loop during re-arbitration
+ // --------------------------------------------------
+ affectInfo->removeAffectInfo(allocatable);
+#ifdef RBA_USE_LOG
+ RBALogManager::setIndent(nest-1);
+#endif
+}
+
+/**
+ * @brief Sort content state based on arbitration policy
+ * @param allocatable
+ * @param contentStates
+ * @return success/failure of sort
+ */
+bool
+RBAArbitrator::
+sortContentStates(const RBAAllocatable* const allocatable,
+ std::list<const RBAContentState*>& states) const
+{
+ bool isResult {true};
+ switch(allocatable->getAllocatableArbitrationPolicy()) {
+ case RBAArbitrationPolicy::FIRST_COME_FIRST:
+ states.sort(&RBAContentState::compareFirstComeFirst);
+ break;
+ case RBAArbitrationPolicy::LAST_COME_FIRST:
+ states.sort(&RBAContentState::compareLastComeFirst);
+ break;
+ case RBAArbitrationPolicy::PRIORITY_FIRST_COME_FIRST:
+ states.sort(&RBAContentState::comparePriorityFirstComeFirst);
+ break;
+ case RBAArbitrationPolicy::DEFAULT:
+ case RBAArbitrationPolicy::PRIORITY_LAST_COME_FIRST:
+ states.sort(&RBAContentState::comparePriorityLastComeFirst);
+ break;
+ default:
+ isResult = false;
+ break;
+ }
+
+ return isResult;
+}
+
+/**
+ * @brief Get re-arbitration list from judgment NG constraint
+ * @param totalRevisitAllocatables
+ * @param allocatable
+ * @param falseConstraints
+ * @param revisited
+ */
+void
+RBAArbitrator::
+collectRevisitAllocatable(std::list<const RBAAllocatable*>* const totalRevisitAllocatables,
+ RBAAllocatable*& allocatable,
+ std::list<RBAConstraintImpl*>& falseConstraints,
+ std::set<const RBAAllocatable*>& revisited)
+{
+ std::set<const RBAAllocatable*> revisitAllocatablesSet;
+
+  // Determine if re-arbitration should be done based on the constraint
+ // that the determination was NG
+ for(RBAConstraintImpl*& constraint : falseConstraints) {
+ // Get Contraint information
+ const RBAConstraintInfo* const info {constraint->getInfo()};
+ // Allocatable, a candidate for re-arbitration
+ std::set<const RBAAllocatable*> rightFalseAllocatables;
+
+ if (info->needsRearbitrationFor(allocatable)) {
+ info->collectRearbitrationTargetFor(allocatable, rightFalseAllocatables, false);
+ }
+ if (rightFalseAllocatables.empty()) {
+ // Non-implication constraint expression
+ // To ensure that "currently arbitrated allocable" does not lose to lower
+ // priority allocable, arbitration of low priority Allocable is performed
+ // if low priority Allocable is included in
+ // "re-arbitration candidate Allocable".
+ info->collectFalseAllocatables(rightFalseAllocatables);
+ bool isContainsLowPriorityAllocatable {false};
+ for(const RBAAllocatable* const rightFalseAllocatable
+ : rightFalseAllocatables) {
+ if(RBAAllocatable::compareIndex(allocatable,rightFalseAllocatable)) {
+ // index is smaller for higher priority allocable
+ isContainsLowPriorityAllocatable = true;
+ break;
+ }
+ }
+ if(!isContainsLowPriorityAllocatable) {
+ continue;
+ }
+ }
+
+ // Remove Allocable during arbitration from re-arbitration target
+ static_cast<void>(rightFalseAllocatables.erase(allocatable));
+
+ // If even one Allocable candidate for re-arbitration has been
+ // re-arbitrated, re-arbitration will not be performed again.
+ // Go to next content assignment
+ for(const RBAAllocatable* const rightFalseAllocatable : rightFalseAllocatables) {
+ if(revisited.find(rightFalseAllocatable) != revisited.end()) {
+ return;
+ }
+ }
+
+ // Set re-arbitration Allocable
+ for(const RBAAllocatable* const alloc : rightFalseAllocatables) {
+ static_cast<void>(revisitAllocatablesSet.insert(alloc));
+ }
+ }
+
+ // Re-arbitration Allocatable exists
+ if(!(revisitAllocatablesSet.empty())) {
+ // copy std::set to std::list
+ static_cast<void>(totalRevisitAllocatables->insert(totalRevisitAllocatables->end(),
+ revisitAllocatablesSet.begin(),
+ revisitAllocatablesSet.end()));
+ // Sort re-arbitration Areas in ascending order based on priority
+ // It is necessary to sort by index comparison considering the order of models.
+ totalRevisitAllocatables->sort(&RBAAllocatable::compareIndex);
+ }
+}
+
+/**
+ * Confirm cancellation of all content status
+ * to cancel Request which lost in arbitration
+ */
+void
+RBAArbitrator::
+postArbitrate()
+{
+#ifdef RBA_USE_LOG
+ RBALogManager::cancelRequestLogLine("----Cancel Request----");
+#endif
+ for(const RBAContentState* const state : model_->getContentStates()) {
+#ifdef RBA_USE_LOG
+ RBALogManager::cancelRequestLogLine("Content["+
+ state->getOwner()->getElementName()+"::"+
+ state->getElementName()+
+ "] check start");
+#endif
+ static_cast<void>(cancelChecked_.insert(state));
+ if(!result_->isActive(state)) {
+#ifdef RBA_USE_LOG
+ RBALogManager::cancelRequestLogLine(" Content["+
+ state->getOwner()->getElementName()+"::"+
+ state->getElementName()+
+ "] is not Active skip");
+#endif
+ continue;
+ }
+ if(result_->isAlreadyOutputting(state)) {
+#ifdef RBA_USE_LOG
+ std::string contTypeName;
+ if(state->isViewContentState()) {
+ contTypeName = "Visible";
+ }
+ else {
+ contTypeName = "Sounding";
+ }
+ RBALogManager::cancelRequestLogLine(" Content["+
+ state->getOwner()->getElementName()+"::"+
+ state->getElementName()+
+ "] is "+contTypeName+" skip");
+#endif
+ continue;
+ }
+
+ changeContentStateCancelWithPolicy(state);
+ }
+
+#ifdef RBA_USE_LOG
+ // Log output for coverage of request cancellation
+ for(const RBAContentState* state : model_->getContentStates()) {
+ std::string contentName = state->getOwner()->getElementName();
+ std::string stateName = state->getElementName();
+ std::string canceled = isCancel(state) ? "t" : "f";
+ RBALogManager::coverageCanceledRequestLogLine(
+ contentName + "," + stateName + ',' +canceled);
+ }
+#endif
+}
+
+/**
+ * @brief Change the cancellation information of hidden Content status
+ based on arbitration results and cancellation policy
+ * @param state
+ */
+void
+RBAArbitrator::
+changeContentStateCancelWithPolicy(const RBAContentState* const state)
+{
+ switch(dynamic_cast<RBAContent*>(state->getOwner())->getContentLoserType()) {
+ case RBAContentLoserType::GOOD_LOSER:
+#ifdef RBA_USE_LOG
+ RBALogManager::cancelRequestLogLine(" Content["+
+ state->getOwner()->getElementName()+"::"+
+ state->getElementName()+
+ "] is Canceled because GOOD_LOSER");
+#endif
+ setCancel(state, true);
+ break;
+ case RBAContentLoserType::NEVER_GIVEUP:
+#ifdef RBA_USE_LOG
+ RBALogManager::cancelRequestLogLine(" Content["+
+ state->getOwner()->getElementName()+"::"+
+ state->getElementName()+
+ "] is not Canceled because NEVER_GIVEUP");
+#endif
+ setCancel(state, false);
+ break;
+ case RBAContentLoserType::DO_NOT_GIVEUP_UNTIL_WIN:
+ if(state->isModelElementType(RBAModelElementType::ViewContentState)) {
+ if(result_->isPreVisible(dynamic_cast<const RBAViewContentStateImpl*>(state))) {
+#ifdef RBA_USE_LOG
+ RBALogManager::cancelRequestLogLine(" Content["+
+ state->getOwner()->getElementName()+"::"+
+ state->getElementName()+
+ "] is Canceled because DO_NOT_GIVEUP_UNTIL_WIN");
+#endif
+ setCancel(state, true);
+ } else {
+#ifdef RBA_USE_LOG
+ RBALogManager::cancelRequestLogLine(" Content["+
+ state->getOwner()->getElementName()+"::"+
+ state->getElementName()+
+ "] is not Canceled because DO_NOT_GIVEUP_UNTIL_WIN");
+#endif
+ setCancel(state, false);
+ }
+ }
+ else {
+ if(result_->isPreSounding(dynamic_cast<const RBASoundContentStateImpl*>(state))) {
+ setCancel(state, true);
+ } else {
+ setCancel(state, false);
+ }
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+#ifdef RBA_USE_LOG
+void
+RBAArbitrator::
+checkAllConstraints()
+{
+ std::string log;
+ LOG_arbitrateConstraintLogLine("----Check All Constraint----");
+
+ if(simulationMode_) {
+ for(const RBAConstraintImpl* constraint : model_->getConstraintImpls()) {
+ bool result = const_cast<RBAConstraintImpl*>(constraint)->execute(this);
+ if(result == false) {
+ result_->addFailedConstraint(constraint);
+ }
+ if (constraint->isRuntime() == true) {
+ log += "online ";
+ } else {
+ log += "offline ";
+ }
+ log += "constraint[" + constraint->getElementName() + "] ";
+ log += "result[" + RBALogManager::boolToString(result) + "]\n";
+ }
+ if (log.empty() != true ) {
+ log.erase(log.end() - 1, log.end()); // Remove last line break
+ }
+ }
+
+}
+#endif
+
+void
+RBAArbitrator::
+checkCancelContent() const
+{
+ for(const RBAViewContentState* const viewState
+ : result_->getActiveViewContentStates()) {
+ if(result_->isCancel(viewState)) {
+ result_->cancelContentState(dynamic_cast<const RBAContentState*>(viewState));
+ }
+ }
+ for(const RBASoundContentState* const soundState
+ : result_->getActiveSoundContentStates()) {
+ if(result_->isCancel(soundState)) {
+ result_->cancelContentState(dynamic_cast<const RBAContentState*>(soundState));
+ }
+ }
+}
+
+/**
+ * @brief Update display and non-dislay Allocatable List
+ */
+void
+RBAArbitrator::
+updateResult()
+{
+ // Deactivate canceled Content
+ result_->updateActiveContentStates();
+
+ // Update coordinates of Area
+ for(auto& area : result_->getVisibleAreas()) {
+ const RBAAreaImpl* const areaImpl {dynamic_cast<const RBAAreaImpl*>(area)};
+ const auto posCont = model_->findPositionContainerImpl(area->getName());
+ const auto sizeObj = result_->getSize(area);
+ if((posCont != nullptr) && (sizeObj != nullptr)) {
+ const auto offset = posCont->getOffset(sizeObj->getName());
+ const_cast<RBAAreaImpl*>(areaImpl)->setOffsetX(offset.first);
+ const_cast<RBAAreaImpl*>(areaImpl)->setOffsetY(offset.second);
+ }
+ }
+
+ // Set output Content state list
+ std::set<const RBAContentState*> outputtingContentStateSet;
+ for(auto& alloc : result_->getOutputtingAllocatables()) {
+ const auto state = result_->getAllocatedContentState(alloc);
+ static_cast<void>(outputtingContentStateSet.insert(state));
+ }
+ for(auto& state : outputtingContentStateSet) {
+ static_cast<void>(result_->addOutputtingContentState(state));
+ }
+
+ for(auto& state : result_->getActiveContentStates()) {
+ // If the Area allocated in the display request is not displayed,
+ // set it to "Stanby Content".
+ const auto allocs = result_->getAllocatable(state);
+ if(allocs.empty()) {
+ result_->addStandbyContent(dynamic_cast<RBAContent*>(state->getOwner()));
+ }
+ }
+}
+
+/**
+ * ### Generate result information
+ *
+ * Generate animation information (RBAViewAction) and register it in the
+ * viewActions list of RBAResult.
+ * The animation information generation pattern is as follows.
+ * | Area A(pre) | Area B(pre) | Area A(cur) | Area B(cur) | type |
+ * |:-: |:-: |:-: |:-: |:---- |
+ * | (none) | - | **content** | - | TRANSITON_ADD |
+ * | **content** | - | (none) | - | TRANSITION_REMOVE |
+ * | **contentA** | - | **contentB** | - | TRANSITION_REPLACE |
+ * | **content** | (none) | (none) | **content** | MOVE |
+ */
+void
+RBAArbitrator::
+createResultData()
+{
+ std::list<std::unique_ptr<RBAViewAction>> actions;
+ // Check the Areas that have not changed
+ std::set<const RBAArea*> stableAreas;
+ for(const RBAArea* const preArea : result_->getPreVisibleAreas()) {
+ if(result_->isVisible(preArea)) {
+ const RBAViewContent* const curContent {result_->getContentState(preArea)->getOwner()};
+ const RBAViewContent* const preContent {result_->getPreContentState(preArea)->getOwner()};
+ if(curContent == preContent) {
+ static_cast<void>(stableAreas.insert(preArea));
+ }
+ }
+ }
+ // Check "MOVE"
+ std::set<const RBAViewContent*> movedContents;
+ for(const RBAArea* curArea : result_->getVisibleAreas()) {
+ // Current display Area
+ const RBAViewContentState* curState {result_->getContentState(curArea)};
+ const RBAViewContent* const curContent {curState->getOwner()};
+ // Skip stable Area
+ if(stableAreas.find(curArea) != stableAreas.end()) {
+ continue;
+ }
+ for(const RBAArea* preArea : result_->getPreVisibleAreas()) {
+ // Do not consider stable areas to have changed
+ if (stableAreas.find(preArea) != stableAreas.end()) {
+ continue;
+ }
+ // Previous display Area
+ const RBAViewContent* const preContent {result_->getPreContentState(preArea)->getOwner()};
+ if(curContent == preContent) {
+ // "MOVE" if there is matching content
+ actions.push_back(std::make_unique<RBAViewMove>(preArea, curArea,
+ curState));
+ // Check moved Content
+ static_cast<void>(movedContents.insert(curState->getOwner()));
+ }
+ }
+ }
+ // Check "REMOVE"
+ for(const RBAArea* preArea : result_->getPreVisibleAreas()) {
+ // Skip stable Area
+ if(stableAreas.find(preArea) != stableAreas.end()) {
+ continue;
+ }
+ const RBAViewContentState* preState {result_->getPreContentState(preArea)};
+ // Skip if Content is "MOVE"
+ if(movedContents.find(preState->getOwner())
+ != movedContents.end()) {
+ continue;
+ }
+ if(!result_->isVisible(preArea)) {
+ // If the previously displayed Area isn't displayed, it is REMOVE.
+ actions.push_back(std::make_unique<RBAViewTransition>(
+ RBAViewActionType::TRANSITION_REMOVE, preArea, preState));
+ }
+ }
+ // Check Examine ADD/REMOVE and REPLACE related to MOVE
+ for(const RBAArea* curArea : result_->getVisibleAreas()) {
+ // Display Area at this time
+ // Skip stable Area
+ if(stableAreas.find(curArea) != stableAreas.end()) {
+ continue;
+ }
+ const RBAViewContentState* curState {result_->getContentState(curArea)};
+ const RBAViewContent* const curContent {curState->getOwner()};
+ const RBAViewContentState* preState {result_->getPreContentState(curArea)};
+
+ if(movedContents.find(curContent) != movedContents.end()) {
+ if((preState != nullptr) && (!result_->isVisible(preState))) {
+ // If the previously displayed content isn't displayed, it is REMOVE.
+ actions.push_back(std::make_unique<RBAViewTransition>(
+ RBAViewActionType::TRANSITION_REMOVE,
+ curArea, preState));
+ }
+ else {
+ continue;
+ }
+ }
+ else if(result_->isPreVisible(curArea)) {
+ // It was the display Area last time
+ // If pre is MOVE content
+ const RBAViewContent* const preContent {preState->getOwner()};
+ if(movedContents.find(preContent) != movedContents.end()) {
+ // Content at this time is ADD
+ actions.push_back(std::make_unique<RBAViewTransition>(
+ RBAViewActionType::TRANSITION_ADD,
+ curArea, curState));
+ }
+ else if(curContent != preContent) {
+ // REPLACE because the content is different
+ actions.push_back(std::make_unique<RBAViewTransition>(
+ RBAViewActionType::TRANSITION_REPLACE,
+ curArea, preState, curState));
+ } else {
+ ;
+ }
+ }
+ else {
+ // ADD because it was not the display Area last time
+ actions.push_back(std::make_unique<RBAViewTransition>(
+ RBAViewActionType::TRANSITION_ADD,
+ curArea, curState));
+ }
+ }
+
+ // Sort and register
+ actions.sort(&compareViewAction);
+ for(auto& action : actions) {
+ result_->addViewAction(action);
+ }
+}
+
+void
+RBAArbitrator::differenceArbitrate()
+{
+#ifdef RBA_USE_LOG
+ // Set request information in log
+ RBALogManager::setType(RBALogManager::TYPE_REQUEST);
+ logRequestArbitration();
+ RBALogManager::setType(RBALogManager::TYPE_PREVIOUS_RESULT);
+ logPreResultArbitration();
+ logRequestForCoverage();
+#endif
+
+ for (auto& a : model_->getSortedAllocatables()) {
+ a->clearStatus();
+ }
+
+ // ----------------------------------------------------------
+ // Arbitration
+ // ----------------------------------------------------------
+ // Priority and post-win arbitoration
+ // (Value arbitration is the same as priority arbitration)
+#ifdef RBA_USE_LOG
+RBALogManager::setType(RBALogManager::TYPE_ARBITRATE);
+#endif
+ arbitrate(model_->getSortedAllocatables());
+
+ // ----------------------------------------------------------
+ // Post processing of arbitration
+ // ----------------------------------------------------------
+#ifdef RBA_USE_LOG
+RBALogManager::setType(RBALogManager::TYPE_CANCEL_REQUEST);
+#endif
+ // when the constraint expression is evaluated by satisfiesConstraints(),
+ // if the cancel state is different from the time when execute() is executed,
+ // the result may be false. Therefore, it is necessary to store
+ // the state before cancellation processing.
+ // When performing the constraint expression evaluation in
+ // satisfiedConstraints(), restore to this value and evaluate.
+ resultSetForSatisfiesConstraints_ = std::make_unique<RBAResultSet>(
+ *result_->getCurResultSet());
+ postArbitrate();
+
+ // Move offline Constraint
+#ifdef RBA_USE_LOG
+RBALogManager::setType(RBALogManager::TYPE_CHECK_ALL_CONSTRAINTS);
+ checkAllConstraints();
+#endif
+
+ // ----------------------------------------------------------
+ // Update Content state
+ // ----------------------------------------------------------
+ for (auto& c : model_->getContents()){
+ const_cast<RBAContent*>(c)->updateStatus(result_.get());
+ }
+
+ backupResultSet_ = result_->createBackupCurrentResultSet();
+ nextResultSet_ = result_->createNextCurrentResultSet();
+
+#ifdef RBA_USE_LOG
+ logResultForCoverage();
+#endif
+}
+
+bool
+RBAArbitrator::
+checkConstraints( std::list<RBAConstraintImpl*>& constraints,
+ std::list<RBAConstraintImpl*>& falseConstraints,
+ const RBAAllocatable* const allocatable)
+{
+ bool containsSkip {false};
+ for (const auto& constraint : constraints) {
+ const bool isPassed {constraint->execute(this)};
+ if (isPassed == false) {
+ falseConstraints.push_back(constraint);
+ }
+ if (constraint->getInfo()->isExceptionBeforeArbitrate()) {
+ if (constraint->getInfo()->needsReRearbitrationFor(allocatable)) {
+ containsSkip = true;
+ }
+ }
+ }
+ return containsSkip;
+}
+
+bool
+RBAArbitrator::
+checkConstraintAndReArbitrate(RBAAllocatable* allocatable,
+ std::set<const RBAAllocatable*>& revisited,
+ const std::int32_t nest,
+ RBAAffectInfo* const affectInfo,
+ RBARollbacker* const parentRollbacker,
+ std::list<RBAConstraintImpl*>& constraints,
+ bool * const isSkipped,
+ const bool isFinal)
+{
+ bool isPassed {false};
+ std::list<RBAConstraintImpl*> falseConstraints;
+ const bool containsSkip {checkConstraints(constraints, falseConstraints, allocatable)};
+ if(falseConstraints.empty()) {
+ *isSkipped = (*isSkipped || containsSkip);
+ if(!containsSkip && !*isSkipped && isFinal) {
+ static_cast<void>(revisited.insert(allocatable));
+ }
+ isPassed = true;
+ } else {
+ std::list<const RBAAllocatable*> revisitAllocatables;
+ collectRevisitAllocatable(&revisitAllocatables, allocatable, falseConstraints, revisited);
+ if(!(revisitAllocatables.empty())) {
+ // There is re-arbitration Allocatable.
+ // Generates backup information for rollback when re-arbitration fails.
+ // For efficiency, instantiate only once when re-arbitration is needed
+ // for the first time.
+ // Since it is backed up after content allocation,
+ // it is necessary to set NULL to the allocated content after rollback.
+
+ // Rollback information when arbitration fails
+ std::shared_ptr<RBARollbacker> rollbacker {std::make_shared<RBARollbacker>()};
+ if (parentRollbacker != nullptr) {
+ parentRollbacker->addChild(rollbacker);
+ }
+ rollbacker->backup(revisitAllocatables);
+ // Initialize all re-arbitration Allocatable
+ for (auto& a : revisitAllocatables) {
+ const_cast<RBAAllocatable*>(a)->clearChecked();
+ }
+ // --------------------------------------------------
+ // Re-arbitrate "Allocatable" that has not been re-arbitrated
+ // in the re-arbitration candidate list
+ // --------------------------------------------------
+ static_cast<void>(revisited.insert(allocatable));
+ for(const RBAAllocatable* const revisitAllocatable : revisitAllocatables) {
+ LOG_arbitrateAreaLogLine( " " +
+ revisitAllocatable->getSymbol() + "["
+ + revisitAllocatable->getElementName()
+ + "] revisit allocatable check start");
+ arbitrateAllocatable(const_cast<RBAAllocatable*>(revisitAllocatable),
+ revisited, nest + 1, affectInfo, rollbacker.get());
+ }
+ for(const RBAAllocatable* const revisitAllocatable : revisitAllocatables) {
+ static_cast<void>(revisited.erase(revisitAllocatable));
+ }
+ // --------------------------------------------------
+ // Check if content allocation succeeded as a result of re-arbitration
+ // --------------------------------------------------
+ falseConstraints.clear();
+ static_cast<void>(checkConstraints(constraints, falseConstraints, allocatable));
+ if (falseConstraints.empty()) {
+ // The content of the allocatable allocation is fixed by re-arbitration,
+ // so exit the loop and proceed to the next allocatable.
+ // In some cases, "Allocatable" is re-arbitrated due to recursion and
+ // allocated Content is lost, but go to the next Allocable because
+ // all contents have been checked
+ isPassed = true;
+ } else {
+ // Roll back arbitration status and affected information
+ rollbacker->rollback();
+ if (parentRollbacker != nullptr) {
+ parentRollbacker->removeChild(rollbacker);
+ }
+ }
+ }
+ }
+ if (isPassed == false) {
+ //Collect Areas that affected the area in arbitration status
+ std::set<const RBAAllocatable*> allocatablesWhichHaveAffectedToThisAllocatable;
+
+ for (const RBAConstraintImpl* const constraint : falseConstraints) {
+ constraint->getInfo()->collectAffectedAllocatables(
+ false, allocatablesWhichHaveAffectedToThisAllocatable, false,
+ false);
+ }
+ static_cast<void>(allocatablesWhichHaveAffectedToThisAllocatable.erase(allocatable));
+
+ // Record fact that affected the area being arbitrated on Area that
+ // affected Area during arbitration.
+ // The re-arbitration of the affected area is recorded in AffectInfo,
+ // so it does not record the re-arbitrated area.
+ for (const RBAAllocatable* const a : allocatablesWhichHaveAffectedToThisAllocatable) {
+ if (!(affectInfo->alreadyKnowsThatFormerHasAffectedToLatter(a,
+ allocatable))) {
+ const_cast<RBAAllocatable*>(a)->addAllocatableWhichHasBeenAffectedByYou(
+ allocatable);
+ affectInfo->addInfoThatFormerAffectedToLatter(a, allocatable);
+ }
+ }
+ }
+ return isPassed;
+}
+
+void
+RBAArbitrator::
+setCancel(const RBAContentState* const state, const bool checked)
+{
+ result_->setCancel(state, checked);
+}
+
+bool
+RBAArbitrator::
+isCancel(const RBAContentState* const state) const
+{
+ if(state->isViewContentState()) {
+ return result_->isCancel(state);
+ }
+ else {
+ return result_->isCancel(state);
+ }
+}
+
+void
+RBAArbitrator::
+getSortedContentStates(const RBAAllocatable* const allocatable,
+ std::list<const RBAContentState*>& contentStates) const
+{
+ for (const RBAContent* const content : allocatable->getInternalContents()) {
+ const RBAContentState* const state {result_->getActiveState(content)};
+ if (state != nullptr) {
+ contentStates.push_back(state);
+#ifdef RBA_USE_LOG
+ } else {
+ RBALogManager::arbitrateContentLogLine(
+ " Content[" + content->getElementName() + "] is not Active skip");
+#endif
+ }
+ }
+ static_cast<void>(sortContentStates(allocatable, contentStates));
+ // Add null at the end, to evaluate constraint expression when unassigned
+ contentStates.push_back(nullptr);
+}
+
+std::int32_t
+RBAArbitrator::
+getViewActionPriority(const RBAViewActionType viewActionType)
+{
+ std::int32_t result{0};
+
+ switch(viewActionType) {
+ case RBAViewActionType::TRANSITION_REMOVE:
+ result = 4;
+ break;
+ case RBAViewActionType::MOVE:
+ result = 3;
+ break;
+ case RBAViewActionType::TRANSITION_ADD:
+ result = 2;
+ break;
+ case RBAViewActionType::TRANSITION_REPLACE:
+ result = 1;
+ break;
+ default:
+ break;
+ }
+
+ return result;
+}
+
+bool
+RBAArbitrator::
+compareViewAction(const std::unique_ptr<RBAViewAction>& lhs,
+ const std::unique_ptr<RBAViewAction>& rhs)
+{
+ const std::int32_t lval {getViewActionPriority(lhs->getViewActionType())};
+ const std::int32_t rval {getViewActionPriority(rhs->getViewActionType())};
+
+ return lval > rval;
+}
+
+RBAResultImpl*
+RBAArbitrator::getResult() const
+{
+ return result_.get();
+}
+
+void RBAArbitrator::setResult(std::unique_ptr<RBAResultImpl> result)
+{
+ result_ = std::move(result);
+}
+
+std::set<const RBAContentState*>& RBAArbitrator::getCancelChecked()
+{
+ return cancelChecked_;
+}
+
+std::unique_ptr<RBAResultImpl>& RBAArbitrator::getResultRef() const
+{
+ return result_;
+}
+
+std::unique_ptr<RBAResultSet>& RBAArbitrator::getNextResultSet()
+{
+ return nextResultSet_;
+}
+
+void RBAArbitrator::setNextResultSet(std::unique_ptr<RBAResultSet> nextResultSet)
+{
+ nextResultSet_ = std::move(nextResultSet);
+}
+
+std::unique_ptr<RBAResultSet>& RBAArbitrator::getBackupResultSet()
+{
+ return backupResultSet_;
+}
+
+void RBAArbitrator::setBackupResultSet(std::unique_ptr<RBAResultSet> backupResultSet)
+{
+ backupResultSet_ = std::move(backupResultSet);
+}
+
+std::unique_ptr<RBAResultSet>& RBAArbitrator::getReservedResultSet()
+{
+ return reservedResultSet_;
+}
+
+void RBAArbitrator::setReservedResultSet(std::unique_ptr<RBAResultSet> reservedResultSet)
+{
+ reservedResultSet_ = std::move(reservedResultSet);
+}
+
+std::recursive_mutex& RBAArbitrator::getMutex() const
+{
+ return mutex_;
+}
+
+#ifdef RBA_USE_LOG
+void RBAArbitrator::setSimulationMode(bool simulationMode)
+{
+ simulationMode_ = simulationMode;
+}
+#endif
+
+std::deque<std::unique_ptr<RBARequestQueMember>>& RBAArbitrator::getRequestQue()
+{
+ return requestQue_;
+}
+
+#ifdef RBA_USE_LOG
+/**
+ * Output request information for log view
+ */
+void
+RBAArbitrator::logRequestArbitration()
+{
+ const std::list<const RBAAllocatable*> allocatables =
+ model_->getAllocatables();
+ RBALogManager::requestLogLine("----Request Information----");
+ RBALogManager::requestLogLine(
+ "Allocatable Count:" + std::to_string(allocatables.size()));
+ for (const RBAAllocatable* allocatable : allocatables) {
+ RBALogManager::requestLogLine(
+ " " + allocatable->getSymbol() + "[" + allocatable->getElementName()
+ + "] policy[" + allocatable->getArbitrationPolicyString()
+ + "] visibility[" + allocatable->getVisibilityString() + "]");
+ }
+
+ const std::list<const RBAContentState*> contentStates = model_
+ ->getContentStates();
+ RBALogManager::requestLogLine(
+ "ContentState Count:" + std::to_string(contentStates.size()));
+ for (const RBAContentState* contentState : contentStates) {
+ std::string active;
+ if (contentState->getModelElementType() == RBAModelElementType::ViewContentState) {
+ active = RBALogManager::boolToString(
+ result_->isActive(
+ dynamic_cast<const RBAViewContentState*>(contentState)));
+ } else {
+ active = RBALogManager::boolToString(
+ result_->isActive(
+ dynamic_cast<const RBASoundContentState*>(contentState)));
+ }
+ RBALogManager::requestLogLine(
+ " " + dynamic_cast<RBAContent*>(contentState->getOwner())->getSymbol() + "["
+ + contentState->getOwner()->getElementName() + "::"
+ + contentState->getElementName() + "] priority["
+ + contentState->getPriorityString() + "] isActive[" + active
+ + "] order[" + contentState->getOrderString() + "]");
+ }
+
+ const std::list<const RBAScene*> scenes = model_->getScenes();
+ RBALogManager::requestLogLine("Scene Count:" + std::to_string(scenes.size()));
+ for (const RBAScene* scene : scenes) {
+ RBALogManager::requestLogLine(
+ " Scene[" + scene->getName() + "] isActive["
+ + RBALogManager::boolToString(result_->isActive(scene))
+ + "]");
+ }
+
+ std::list<RBAConstraint*> constraints = model_->getConstraints();
+ RBALogManager::requestLogLine(
+ "Constraint Count:" + std::to_string(constraints.size()));
+ for (RBAConstraint* constraint : constraints) {
+ RBAConstraintImpl* impl = dynamic_cast<RBAConstraintImpl*>(constraint);
+ RBALogManager::requestLogLine(
+ " Constraint[" + impl->getName() + "] Expression["
+ + impl->getExpression()->getExpressionText() + "] runtime["
+ + RBALogManager::boolToString(impl->isRuntime()) + "]");
+ }
+
+}
+
+/**
+ * Output previous arbitration result for log view
+ */
+void
+RBAArbitrator::logPreResultArbitration()
+{
+ RBALogManager::resultLogLine("----Previous Result Information----");
+
+ auto allocs = model_->getAllocatables();
+ RBALogManager::resultLogLine("Allocatable TotalCount:"
+ + std::to_string(allocs.size()));
+ for (auto& alloc : allocs) {
+ auto contentState = result_->getPreContentState(alloc);
+ auto hidden = result_->isPreHidden(alloc);
+ std::string str = " " + alloc->getSymbol()
+ + "[" + alloc->getElementName() + "] Content[";
+ if (contentState == nullptr) {
+ str += "null";
+ } else {
+ str += contentState->getOwner()->getElementName()
+ + "::" + contentState->getElementName();
+ }
+ str += "] " + alloc->getHiddenSymbol()
+ + "[" + RBALogManager::boolToString(hidden) + "]";
+ if (alloc->isZone() == true) {
+ str += " attenuated[";
+ str += RBALogManager::boolToString(
+ result_->isPreAttenuated(dynamic_cast<const RBAZone*>(alloc)));
+ str += "]";
+ }
+ RBALogManager::resultLogLine(str);
+ if (contentState && !hidden) {
+ RBALogManager::coveragePrevResultLogLine(
+ "A," + alloc->getElementName() + ","
+ + contentState->getOwner()->getElementName() + ","
+ + contentState->getElementName());
+ }
+ }
+
+ auto contents = model_->getContents();
+ RBALogManager::resultLogLine("Content TotalCount:"
+ + std::to_string(contents.size()));
+ for (auto& content : contents) {
+ auto state = result_->getPreActiveState(content);
+ bool isOutputting = false;
+ bool isActive = false;
+ if (state != nullptr) {
+ isActive = true;
+ isOutputting = result_->isPreOutputting(state);
+ }
+ RBALogManager::resultLogLine(
+ " " + content->getSymbol() + "[" + content->getElementName() + "] "
+ + content->getVisibleSymbol() + "["
+ + RBALogManager::boolToString(isOutputting) + "] active["
+ + RBALogManager::boolToString(isActive) + "]");
+ for (auto alloc : content->getAllocatables()) {
+ auto allocatedState = result_->getPreContentState(alloc);
+ if ((allocatedState != nullptr)
+ && (allocatedState->getOwner() == content)) {
+ RBALogManager::resultLogLine(
+ " allocated " + alloc->getSymbol() + "["
+ + alloc->getElementName() + "]");
+ }
+ }
+ }
+}
+
+/**
+ * Output current arbitration result for log view
+ */
+void
+RBAArbitrator::logResultArbitration()
+{
+ RBALogManager::resultLogLine("----Result Information----");
+
+ const std::list<const RBAAllocatable*> allocatables
+ = model_->getAllocatables();
+ RBALogManager::resultLogLine("Allocatable TotalCount:" + std::to_string(allocatables.size()));
+ for(const RBAAllocatable* allocatable : allocatables) {
+ const RBAContentState* contentState = result_->getContentState(allocatable);
+ std::string str = " ";
+ str += allocatable->getSymbol();
+ str += "[";
+ str += allocatable->getElementName();
+ str += "] Content[";
+ if (contentState == nullptr) {
+ str += "null";
+ } else {
+ str += contentState->getOwner()->getElementName() + "::"
+ + contentState->getElementName();
+ }
+ str += "] ";
+ str += allocatable->getHiddenSymbol();
+ str += "[";
+ str += RBALogManager::boolToString(result_->isHidden(allocatable));
+ str += "]";
+ if (allocatable->isZone() == true) {
+ str += " attenuated[";
+ str += RBALogManager::boolToString(result_->isAttenuated(dynamic_cast<const RBAZone*>(allocatable)));
+ str += "]";
+ }
+ RBALogManager::resultLogLine(str);
+ }
+
+ const std::list<const RBAContent*> contents = model_->getContents();
+ RBALogManager::resultLogLine("Content TotalCount:" + std::to_string(contents.size()));
+ for(const RBAContent* content : contents) {
+ bool isOutputting = false;
+ bool isCancel = false;
+ const RBAContentState* state = result_->getActiveState(content);
+ if(state != nullptr) {
+ isOutputting = result_->isOutputting(state);
+ } else {
+ for(const RBAContentState* state : content->getStates()) {
+ isCancel |= result_->isCancel(state);
+ }
+ }
+ RBALogManager::resultLogLine(" "
+ + content->getSymbol()
+ + "["
+ + content->getElementName()
+ + "] "
+ + content->getVisibleSymbol()
+ + "["
+ + RBALogManager::boolToString(isOutputting)
+ + "] cancel["
+ + RBALogManager::boolToString(isCancel)
+ + "]");
+ for(const RBAAllocatable* allocatable : content->getAllocatables()) {
+ const RBAContentState* allocatedState
+ = result_->getContentState(allocatable);
+ if((allocatedState != nullptr) && (allocatedState->getOwner() == content)) {
+ RBALogManager::resultLogLine(" allocated "
+ + allocatable->getSymbol() + "["
+ + allocatable->getElementName() + "]");
+ }
+ }
+ }
+}
+
+/**
+ * For coverage: Output request information
+ */
+void
+RBAArbitrator::logRequestForCoverage()
+{
+ for(const RBAContentState* contentState : model_->getContentStates()) {
+ std::ostringstream oss;
+ oss << "C,";
+ if(result_->isActive(contentState)) {
+ oss << "on,";
+ }
+ else {
+ oss << "off,";
+ }
+ oss << contentState->getOwner()->getElementName() << ",";
+ oss << contentState->getElementName() << ",";
+ oss << contentState->getContentStateOrder();
+ RBALogManager::coverageRequestLogLine(oss.str());
+ }
+ for(const RBAScene* scene : model_->getScenes()) {
+ std::ostringstream oss;
+ oss << "S,";
+ if(result_->isActive(scene)) {
+ oss << "on,";
+ }
+ else {
+ oss << "off,";
+ }
+ oss << scene->getName();
+ for(const auto& name : scene->getPropertyNames()) {
+ std::int32_t value {result_->getSceneProperty(scene, name)};
+ oss << ",";
+ oss << name;
+ oss << ":";
+ oss << value;
+ }
+ RBALogManager::coverageRequestLogLine(oss.str());
+ }
+}
+
+/**
+ * For coverage: Output result information
+ */
+void
+RBAArbitrator::logResultForCoverage()
+{
+ for(const RBAAllocatable* allocatable : model_->getAllocatables()) {
+ std::ostringstream oss;
+ oss << "A,";
+ oss << allocatable->getElementName() + ",";
+ const RBAContentState* contentState = result_->getContentState(allocatable);
+ if((contentState != nullptr) && (!result_->isHidden(allocatable))) {
+ oss << contentState->getOwner()->getElementName();
+ }
+ RBALogManager::coverageResultLogLine(oss.str());
+ }
+}
+
+void
+RBAArbitrator::setLogToResult()
+{
+ std::ostringstream oss;
+ oss << RBALogManager::getAllConstraintLog();
+ oss << RBALogManager::getRequestLog();
+ oss << RBALogManager::getPreviousResultLog();
+ oss << RBALogManager::getArbitrateLog();
+ oss << RBALogManager::getCancelRequestLog();
+ oss << RBALogManager::getCheckAllConstraintLog();
+ oss << RBALogManager::getResultLog();
+ result_->setLog(oss.str());
+}
+#endif
+
+}
diff --git a/src/core/logic/RBABackUpAllocatable.cpp b/src/core/logic/RBABackUpAllocatable.cpp
new file mode 100644
index 0000000..2843db1
--- /dev/null
+++ b/src/core/logic/RBABackUpAllocatable.cpp
@@ -0,0 +1,33 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * BackUpAllocatable class
+ */
+
+#include "RBABackUpAllocatable.hpp"
+
+namespace rba
+{
+
+RBABackUpAllocatable::RBABackUpAllocatable(const std::string& name)
+ : RBARuleObject{name},
+ RBAAllocatable{name}
+{
+}
+
+}
+
diff --git a/src/core/logic/RBABackUpAllocatable.hpp b/src/core/logic/RBABackUpAllocatable.hpp
new file mode 100644
index 0000000..a57aa01
--- /dev/null
+++ b/src/core/logic/RBABackUpAllocatable.hpp
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * BackUpAllocatable class header
+ */
+
+#ifndef RBABACKUPALLOCATABLE_HPP
+#define RBABACKUPALLOCATABLE_HPP
+
+#include "RBAAllocatable.hpp"
+
+namespace rba
+{
+class RBABackUpAllocatable : public RBAAllocatable
+{
+public:
+ explicit RBABackUpAllocatable(const std::string& name);
+ RBABackUpAllocatable(const RBABackUpAllocatable&)=delete;
+ RBABackUpAllocatable(const RBABackUpAllocatable&&)=delete;
+ RBABackUpAllocatable& operator=(const RBABackUpAllocatable&)=delete;
+ RBABackUpAllocatable& operator=(const RBABackUpAllocatable&&)=delete;
+ virtual ~RBABackUpAllocatable()=default;
+
+};
+
+}
+
+#endif
diff --git a/src/core/logic/RBACommonMakerTable.cpp b/src/core/logic/RBACommonMakerTable.cpp
new file mode 100644
index 0000000..dde13b7
--- /dev/null
+++ b/src/core/logic/RBACommonMakerTable.cpp
@@ -0,0 +1,126 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBACommonMakerTable.cpp
+/// @brief Expression element maker table class definition file
+
+#include "RBACommonMakerTable.hpp"
+#include "RBAActiveStateMaker.hpp"
+#include "RBAAllocatedContentMaker.hpp"
+#include "RBAActiveContentsMaker.hpp"
+#include "RBAAndOperatorMaker.hpp"
+#include "RBAContentValueMaker.hpp"
+#include "RBAExistsOperatorMaker.hpp"
+#include "RBAForAllOperatorMaker.hpp"
+#include "RBAGetAllocatablesMaker.hpp"
+#include "RBAGetContentsListMaker.hpp"
+#include "RBAGetPropertyMaker.hpp"
+#include "RBAHasBeenDisplayedMaker.hpp"
+#include "RBAHasComeEarlierThanMaker.hpp"
+#include "RBAHasComeLaterThanMaker.hpp"
+#include "RBAIfStatementMaker.hpp"
+#include "RBAImpliesOperatorMaker.hpp"
+#include "RBAIntegerValueMaker.hpp"
+#include "RBAIsActiveMaker.hpp"
+#include "RBAIsEqualToOperatorMaker.hpp"
+#include "RBAIsGreaterThanEqualOperatorMaker.hpp"
+#include "RBAIsGreaterThanOperatorMaker.hpp"
+#include "RBAIsLowerThanEqualOperatorMaker.hpp"
+#include "RBAIsLowerThanOperatorMaker.hpp"
+#include "RBAIsOnMaker.hpp"
+#include "RBAIsTypeOfOperatorMaker.hpp"
+#include "RBALambdaExpressionMaker.hpp"
+#include "RBAMaxOperatorMaker.hpp"
+#include "RBAMemberFeatureReferenceMaker.hpp"
+#include "RBAMinOperatorMaker.hpp"
+#include "RBASelectOperatorMaker.hpp"
+#include "RBANotOperatorMaker.hpp"
+#include "RBAObjectCompareMaker.hpp"
+#include "RBAObjectReferenceMaker.hpp"
+#include "RBAOrOperatorMaker.hpp"
+#include "RBAPlusOperatorMaker.hpp"
+#include "RBAPreviousModifierMaker.hpp"
+#include "RBASetOfOperatorMaker.hpp"
+#include "RBASizeOperatorMaker.hpp"
+#include "RBAStateValueMaker.hpp"
+#include "RBAVariableMaker.hpp"
+#include "RBAConstraintMaker.hpp"
+#include "RBASceneMaker.hpp"
+#include "RBAModelElement.hpp"
+
+namespace rba
+{
+
+RBACommonMakerTable::RBACommonMakerTable()
+ : RBAAbstractMakerTable{}
+{
+ addTag("scenes");
+ addTag("constraints");
+ addTag("postconstraints");
+ addTag("rules");
+}
+
+std::list<std::unique_ptr<RBAModelElementMaker>>
+RBACommonMakerTable::getMakers() const
+{
+ std::list<std::unique_ptr<RBAModelElementMaker>> makers;
+ makers.push_back(std::make_unique<RBAActiveStateMaker>());
+ makers.push_back(std::make_unique<RBAAllocatedContentMaker>());
+ makers.push_back(std::make_unique<RBAActiveContentsMaker>());
+ makers.push_back(std::make_unique<RBAAndOperatorMaker>());
+ makers.push_back(std::make_unique<RBAContentValueMaker>());
+ makers.push_back(std::make_unique<RBAExistsOperatorMaker>());
+ makers.push_back(std::make_unique<RBAForAllOperatorMaker>());
+ makers.push_back(std::make_unique<RBAGetAllocatablesMaker>());
+ makers.push_back(std::make_unique<RBAGetContentsListMaker>());
+ makers.push_back(std::make_unique<RBAGetPropertyMaker>());
+ makers.push_back(std::make_unique<RBAHasBeenDisplayedMaker>());
+ makers.push_back(std::make_unique<RBAHasComeEarlierThanMaker>());
+ makers.push_back(std::make_unique<RBAHasComeLaterThanMaker>());
+ makers.push_back(std::make_unique<RBAIfStatementMaker>());
+ makers.push_back(std::make_unique<RBAImpliesOperatorMaker>());
+ makers.push_back(std::make_unique<RBAIntegerValueMaker>());
+ makers.push_back(std::make_unique<RBAIsActiveMaker>());
+ makers.push_back(std::make_unique<RBAIsEqualToOperatorMaker>());
+ makers.push_back(std::make_unique<RBAIsGreaterThanEqualOperatorMaker>());
+ makers.push_back(std::make_unique<RBAIsGreaterThanOperatorMaker>());
+ makers.push_back(std::make_unique<RBAIsLowerThanEqualOperatorMaker>());
+ makers.push_back(std::make_unique<RBAIsLowerThanOperatorMaker>());
+ makers.push_back(std::make_unique<RBAIsOnMaker>());
+ makers.push_back(std::make_unique<RBAIsTypeOfOperatorMaker>());
+ makers.push_back(std::make_unique<RBALambdaExpressionMaker>());
+ makers.push_back(std::make_unique<RBAMaxOperatorMaker>());
+ makers.push_back(std::make_unique<RBAMemberFeatureReferenceMaker>());
+ makers.push_back(std::make_unique<RBAMinOperatorMaker>());
+ makers.push_back(std::make_unique<RBASelectOperatorMaker>());
+ makers.push_back(std::make_unique<RBANotOperatorMaker>());
+ makers.push_back(std::make_unique<RBAObjectCompareMaker>());
+ makers.push_back(std::make_unique<RBAObjectReferenceMaker>());
+ makers.push_back(std::make_unique<RBAOrOperatorMaker>());
+ makers.push_back(std::make_unique<RBAPlusOperatorMaker>());
+ makers.push_back(std::make_unique<RBAPreviousModifierMaker>());
+ makers.push_back(std::make_unique<RBASetOfOperatorMaker>());
+ makers.push_back(std::make_unique<RBASizeOperatorMaker>());
+ makers.push_back(std::make_unique<RBAStateValueMaker>());
+ makers.push_back(std::make_unique<RBAVariableMaker>());
+ makers.push_back(std::make_unique<RBAConstraintMaker>());
+ makers.push_back(std::make_unique<RBASceneMaker>());
+ RBAModelElementMaker::addMaker("SCENE", std::make_unique<RBASceneMaker>());
+
+ return makers;
+}
+
+}
diff --git a/src/core/logic/RBACommonMakerTable.hpp b/src/core/logic/RBACommonMakerTable.hpp
new file mode 100644
index 0000000..ae18dad
--- /dev/null
+++ b/src/core/logic/RBACommonMakerTable.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBACommonMakerTable.hpp
+/// @brief Expression element maker table class header
+
+#ifndef RBACOMMONMAKERTABLE_HPP
+#define RBACOMMONMAKERTABLE_HPP
+
+#include "RBAAbstractMakerTable.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBACommonMakerTable : public RBAAbstractMakerTable
+{
+public:
+ RBACommonMakerTable();
+ RBACommonMakerTable(const RBACommonMakerTable&)=delete;
+ RBACommonMakerTable(const RBACommonMakerTable&&)=delete;
+ RBACommonMakerTable& operator=(const RBACommonMakerTable&)=delete;
+ RBACommonMakerTable& operator=(const RBACommonMakerTable&&)=delete;
+ virtual ~RBACommonMakerTable()=default;
+
+public:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<std::unique_ptr<RBAModelElementMaker>> getMakers() const override;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/logic/RBAConstraintInfo.cpp b/src/core/logic/RBAConstraintInfo.cpp
new file mode 100644
index 0000000..b208c5f
--- /dev/null
+++ b/src/core/logic/RBAConstraintInfo.cpp
@@ -0,0 +1,695 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// ConstraintInfo class
+
+#include <algorithm>
+#include "RBAAllocatable.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAExpression.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void RBAConstraintInfo::setExpression(const RBAExpression* const expression)
+{
+ expression_ = expression;
+}
+
+const RBAExpression*
+RBAConstraintInfo::getExpression() const
+{
+ return expression_;
+}
+
+void RBAConstraintInfo::addOperandAllocatable(const RBAAllocatable* const operandAllocatable)
+{
+ static_cast<void>(operandAllocatable_.insert(operandAllocatable));
+}
+
+void RBAConstraintInfo::setResult(const RBAExecuteResult result)
+{
+ result_ = result;
+}
+
+RBAConstraintInfo*
+RBAConstraintInfo::getChild(const std::uint32_t index) const
+{
+ const std::size_t requiredSize {static_cast<std::size_t>(index + 1U)};
+ if (children_.size() < requiredSize) {
+ children_.resize(requiredSize, std::make_unique<RBAConstraintInfo>());
+ }
+ // Use "[]" instead of "at" because it doesn't access out of range
+ return children_[static_cast<std::size_t>(index)].get();
+}
+
+void RBAConstraintInfo::setChild(const std::shared_ptr<RBAConstraintInfo> info)
+{
+ // This function is used in "let" expressions, which generate a new
+ // "ConstraintInfo" on each evaluation.
+ // Therefore, in the case of "add", "children" will be added for each arbitration,
+ // so use "set" to set "children" for each arbitration.
+ children_ = { info };
+}
+
+void RBAConstraintInfo::addTrueAllocatable(const RBAAllocatable* const allocatable)
+{
+ static_cast<void>(trueAllocatables_.insert(allocatable));
+}
+
+void RBAConstraintInfo::addFalseAllocatable(const RBAAllocatable* const allocatable)
+{
+ static_cast<void>(falseAllocatables_.insert(allocatable));
+}
+
+void RBAConstraintInfo::addTrueAllocatableFromOperand()
+{
+ for (const auto& c : children_) {
+ for (const auto& a : c->operandAllocatable_) {
+ static_cast<void>(trueAllocatables_.insert(a));
+ }
+ }
+}
+
+void RBAConstraintInfo::addFalseAllocatableFromOperand()
+{
+ for (const auto& c : children_) {
+ for (const auto& a : c->operandAllocatable_) {
+ static_cast<void>(falseAllocatables_.insert(a));
+ }
+ }
+}
+
+void RBAConstraintInfo::clearFalseAllocatable()
+{
+ falseAllocatables_.clear();
+}
+
+/// TCheck whether to invert True/False
+/// @return
+bool RBAConstraintInfo::isRevert() const
+{
+ if ((expression_ != nullptr)
+ && expression_->isModelElementType(RBAModelElementType::NotOperator)) {
+ return true;
+ }
+ return false;
+}
+
+bool RBAConstraintInfo::isSizeOperator() const
+{
+ if ((expression_ != nullptr)
+ && (expression_->isModelElementType(RBAModelElementType::SizeOperator))) {
+ return true;
+ }
+ return false;
+}
+
+const bool RBAConstraintInfo::isImplies() const
+{
+ if ((expression_ != nullptr)
+ && (expression_->isModelElementType(RBAModelElementType::ImpliesOperator)
+ || expression_->isModelElementType(RBAModelElementType::IfStatement))) {
+ return true;
+ }
+ return false;
+}
+
+void RBAConstraintInfo::clear()
+{
+ for (const std::shared_ptr<RBAConstraintInfo>& child : children_) {
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // recursively calling clear()
+ //  [Reason that there is no problem if the rule is deviated]
+ // ConstraintInfo is created for each node in the Constraint expression
+ // tree. The Constraint expression tree is determined by the constraint
+ // expressions written in the model file, and its depth is finite.
+ // Therefore, stack overflow does not occur and there is no problem
+ child->clear();
+ }
+ result_ = RBAExecuteResult::SKIP;
+ exceptionBeforeArbitrate_ = false;
+ trueAllocatables_.clear();
+ falseAllocatables_.clear();
+ operandAllocatable_.clear();
+}
+
+bool RBAConstraintInfo::isExceptionBeforeArbitrate() const
+{
+ return exceptionBeforeArbitrate_;
+}
+
+void RBAConstraintInfo::setExceptionBeforeArbitrate(
+ const bool exceptionBeforeArbitrate)
+{
+ exceptionBeforeArbitrate_ = exceptionBeforeArbitrate;
+}
+
+bool RBAConstraintInfo::needsReRearbitrationFor(
+ const RBAAllocatable* const allocatable) const
+{
+ bool result {false};
+ if (children_.empty() == false) {
+ switch (expression_->getModelElementType()) {
+ case RBAModelElementType::ImpliesOperator:
+ if (children_.front()->isExceptionBeforeArbitrate()) {
+ result = children_.back()->needsReRearbitrationFor(allocatable);
+ }
+ break;
+ case RBAModelElementType::IfStatement:
+ if (children_.front()->isExceptionBeforeArbitrate()) {
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // Function '::rba::RBAConstraintInfo::needsReRearbitrationFor=(_,
+ // p={c::rba::RBAAllocatable})' is recursive.
+ //  [Reason that there is no problem if the rule is deviated]
+ // Recursive call is required as a feature
+ result = children_.back()->needsReRearbitrationFor(allocatable);
+ }
+ break;
+ default:
+ for (const auto& child : children_) {
+ result = (result || child->needsReRearbitrationFor(allocatable));
+ }
+ result =
+ (result || (trueAllocatables_.find(allocatable) != trueAllocatables_.end())
+ || (falseAllocatables_.find(allocatable) != falseAllocatables_.end()));
+ break;
+ }
+ }
+ return result;
+}
+
+bool RBAConstraintInfo::needsRearbitrationFor(const RBAAllocatable* const allocatable,
+ bool isImplies) const
+{
+ bool result {false}; // 再調停要否
+ if (children_.empty() == false) {
+ // When the syntax of the constraint expression is
+ // - ImpliesOperator
+ // - IfStatement
+ // - other than the above
+ switch (expression_->getModelElementType()) {
+ case RBAModelElementType::ImpliesOperator:
+ // If the left side of the implication is true and
+ // the left side contains an Allocatable during arbitration,
+ // re-arbitration is required.
+ //
+ // If the left side of the implication is true and
+ // the left side contains an allocatable state reference expression,
+ // re-arbitration is NOT required.
+ if (children_.front()->isTrue()) {
+ if (children_.front()->contains(allocatable)) {
+ result = true;
+ } else {
+ if (children_.front()->contains(nullptr)) {
+ isImplies = true;
+ }
+ result = (result || children_.back()->needsRearbitrationFor(allocatable,
+ isImplies));
+ }
+ }
+ break;
+ case RBAModelElementType::IfStatement:
+ // If the IF condition includes Allocatble in arbitration,
+ // re-arbitration is required.
+ // If the IF condition includes an Allocatable state reference
+ // expression, re-arbitration is NOT required.
+ // If the IF condition does not include an allocatable state reference
+ // expression, search the child syntax.
+ if (children_.front()->contains(allocatable)) {
+ result = true;
+ } else {
+ if (children_.front()->contains(nullptr)) {
+ isImplies = true;
+ }
+ result = (result || children_.back()->needsRearbitrationFor(allocatable,
+ isImplies));
+ }
+ break;
+ default:
+ for (const auto& child : children_) {
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // Function '::rba::RBAConstraintInfo::needsRearbitrationFor=(_,
+ // p={c::rba::RBAAllocatable},_o)' is recursive.
+ //  [Reason that there is no problem if the rule is deviated]
+ // Recursive call is required as a feature
+ result = (result || child->needsRearbitrationFor(allocatable, isImplies));
+ }
+ // The Constraint expression does not include IF or implication,
+ // or
+ // the Allocatable state reference expression is not included in the
+ // left side of the IF condition of the parent syntax or
+ // the implication of the parent syntax,
+ // or
+ // "Allocable" during arbitration is included in the left side of
+ // the IF condition of the parent syntax or the implication of the
+ // parent syntax,
+ //
+ // re-arbitration is required.
+ if (!isImplies && contains(allocatable)) {
+ result = true;
+ }
+ break;
+ }
+ }
+ return result;
+}
+
+/// @brief Collect "Allocatable" whose right side is false.
+/// @details
+/// - Do not collect if an exception has occurred
+/// - When expression_ is nullptr or When expression_ is implication
+/// - If the left side is satisfied and there is a condition on the left
+/// side that is affected by the allocatable state, collect the
+/// allocatable that caused the right side to be false.
+/// - If the left side is satisfied and there is NO condition affected by
+/// the allocatable state on the left side, this function is called on
+/// the right side. (To correspond to implication or IF nest)
+/// - When expression_ is IF
+/// - If there is a condition on the left side that is affected by the
+/// "Allocatable" state, collect the "Allocatable that caused the
+/// right side to be false.
+/// - If there is no condition affected by the allocatable state on the left
+/// side, call this function for the right side.
+/// (To correspond to the implication or nest of IF)
+/// - When expression_ is negative
+/// - Call this function with "isNot" inverted for the left side.
+/// (To deal with implications or IFs present in children.)
+/// - When expression_ is above
+/// - Call this function for the child ConstraintInfo.
+/// (To deal with implications or IFs present in children.)
+/// @param[in] allocatable "Allcatable" during arbitration
+/// @param[out] targets "Allocatable" for re-arbitration
+/// @param[in] isNot Inversion state of right and wrong by negation operator.
+void RBAConstraintInfo::collectRearbitrationTargetFor(
+ const RBAAllocatable* const allocatable, std::set<const RBAAllocatable*>& targets,
+ const bool isNot) const
+{
+ if (isExceptionBeforeArbitrate()) {
+ return;
+ }
+ if (children_.empty() == false) {
+ switch (expression_->getModelElementType()) {
+ case RBAModelElementType::ImpliesOperator:
+ if (children_.front()->isTrue()) {
+ if (isNot) {
+ children_.back()->collectTrueAllocatables(targets);
+ } else {
+ children_.back()->collectFalseAllocatables(targets);
+ }
+ } else if (!children_.front()->isFalse()) {
+ children_.back()->collectRearbitrationTargetFor(allocatable, targets,
+ isNot);
+ } else {
+ }
+ break;
+ case RBAModelElementType::IfStatement:
+ if (isNot) {
+ children_.back()->collectTrueAllocatables(targets);
+ } else {
+ children_.back()->collectFalseAllocatables(targets);
+ }
+ break;
+ case RBAModelElementType::NotOperator:
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // Function '::rba::RBAConstraintInfo::collectRearbitrationTargetFor=(_,p={c::rba::RBAAllocatable},
+ // &{c::std::set<p={c::rba::RBAAllocatable},{c::std::less<p={c::rba::RBAAllocatable}>},
+ // {c::std::allocator<p={c::rba::RBAAllocatable}>}>},_o)' is recursive.
+ //  [Reason that there is no problem if the rule is deviated]
+ // Recursive call is required as a feature
+ children_.front()->collectRearbitrationTargetFor(allocatable, targets,
+ !isNot);
+ break;
+ default:
+ for (const auto& child : children_) {
+ child->collectRearbitrationTargetFor(allocatable, targets, isNot);
+ }
+ break;
+ }
+ }
+}
+
+void RBAConstraintInfo::collectTrueAllocatables(
+ std::set<const RBAAllocatable*>& allocatables) const
+{
+ if (isExceptionBeforeArbitrate() || isFalse()) {
+ return;
+ }
+ if (isRevert()) {
+ for (const auto& child : children_) {
+ child->collectFalseAllocatables(allocatables);
+ }
+ allocatables.insert(falseAllocatables_.begin(), falseAllocatables_.end());
+ } else if (isImplies()) {
+ children_.back()->collectTrueAllocatables(allocatables);
+ } else if (isSizeOperator()) {
+ // Since the size operator evaluates the number of sets,
+ // the Allocatable that combines FalseAllocatable and TrueAllocatable
+ // becomes TrueAllocatables.
+ children_.back()->collectTrueAllocatables(allocatables);
+ children_.back()->collectFalseAllocatables(allocatables);
+ } else {
+ for (const auto& child : children_) {
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // Function '::rba::RBAConstraintInfo::collectTrueAllocatables=(_,
+ // &{c::std::set<p={c::rba::RBAAllocatable},
+ // {c::std::less<p={c::rba::RBAAllocatable}>},
+ // {c::std::allocator<p={c::rba::RBAAllocatable}>}>})' is recursive.
+ //  [Reason that there is no problem if the rule is deviated]
+ // Recursive call is required as a feature
+ child->collectTrueAllocatables(allocatables);
+ }
+ allocatables.insert(trueAllocatables_.begin(), trueAllocatables_.end());
+ }
+ return;
+}
+
+void RBAConstraintInfo::collectFalseAllocatables(
+ std::set<const RBAAllocatable*>& allocatables) const
+{
+ if (isExceptionBeforeArbitrate() || isTrue()) {
+ return;
+ }
+ if (isRevert()) {
+ for (const auto& child : children_) {
+ child->collectTrueAllocatables(allocatables);
+ }
+ allocatables.insert(trueAllocatables_.begin(), trueAllocatables_.end());
+ } else if (isImplies()) {
+ children_.back()->collectFalseAllocatables(allocatables);
+ } else if (isSizeOperator()) {
+ // The size operator evaluates the number of sets, so "Allocatable",
+ // which is a combination of "FalseAllocatable" and "TrueAllocatable",
+ // becomes "FalseAllocatables".
+ children_.back()->collectTrueAllocatables(allocatables);
+ children_.back()->collectFalseAllocatables(allocatables);
+ } else {
+ for (const auto& child : children_) {
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // Function '::rba::RBAConstraintInfo::collectFalseAllocatables=(_,
+ // &{c::std::set<p={c::rba::RBAAllocatable},
+ // {c::std::less<p={c::rba::RBAAllocatable}>},
+ // {c::std::allocator<p={c::rba::RBAAllocatable}>}>})'
+ // is recursive.
+ //  [Reason that there is no problem if the rule is deviated]
+ // Recursive call is required as a feature
+ child->collectFalseAllocatables(allocatables);
+ }
+ allocatables.insert(falseAllocatables_.begin(), falseAllocatables_.end());
+ }
+ return;
+}
+
+bool RBAConstraintInfo::contains(const RBAAllocatable* const allocatable) const
+{
+ if (allocatable != nullptr) {
+ if (trueAllocatables_.find(allocatable) != trueAllocatables_.end()) {
+ return true;
+ }
+ if (falseAllocatables_.find(allocatable) != falseAllocatables_.end()) {
+ return true;
+ }
+ } else {
+ if (!trueAllocatables_.empty() || !falseAllocatables_.empty()) {
+ return true;
+ }
+ }
+ for (const auto& child : children_) {
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // Function '::rba::RBAConstraintInfo::contains=(_,
+ // p={c::rba::RBAAllocatable})'
+ // is recursive.
+ //  [Reason that there is no problem if the rule is deviated]
+ // Recursive call is required as a feature
+ if (child->contains(allocatable)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool RBAConstraintInfo::isTrue() const
+{
+ return (result_ == RBAExecuteResult::TRUE);
+}
+
+bool RBAConstraintInfo::isFalse() const
+{
+ return (result_ == RBAExecuteResult::FALSE);
+}
+
+void RBAConstraintInfo::collectAffectedAllocatables(
+ const bool isRevert, std::set<const RBAAllocatable*>& affectAllocatables,
+ const bool collecting,
+ const bool forObject)
+{
+ // Collect the allocatable that caused the constraint expression to be False.
+ // It is implemented by recursively calling ConstraintInfo of the tree
+ // structure created at the time of "Constraint" expression evaluation.
+ // with this function.
+ // Collect True because the success or failure of ConstraintInfo below
+ // "negative" is reversed.
+ switch (getExpression()->getModelElementType()) {
+ case RBAModelElementType::NotOperator:
+ // ConstraintInfo below negative negates success or failure,
+ // so invert isRevert and call child Info.
+ children_[0U]->collectAffectedAllocatables(!isRevert, affectAllocatables,
+ collecting, forObject);
+ break;
+ case RBAModelElementType::SizeOperator:
+ // Since the size operator evaluates the number of sets,
+ // "Allocatable" which is a combination of "FalseAllocatable" and
+ // "TrueAllocatable" becomes "affectAllocatables".
+ children_[0U]->collectAffectedAllocatables(false, affectAllocatables,
+ true, true);
+ break;
+ case RBAModelElementType::OrOperator:
+ case RBAModelElementType::ExistsOperator:
+ // the same processing is performed, because "Exists {A,B}{x|x.isXXX}"
+ // is equivalent to "A.isXXX OR B.isXXX"
+ if (!isRevert) {
+ // Processing when "Info" of "OR" in which evaluation result that is not
+ // qualified by an odd number of negative is "Skip" or evaluation reslt
+ // that is not qualified by an odd number of negative is "False".
+ if (!isTrue()) {
+ // Collect the Allocatable of child Info whose
+ // whose evaluation result is False.
+ // When "A.isXXX OR B.isXXX", if the evaluation result of A is True,
+ // the evaluation result of OR will be True even if the evaluation
+ // result of B is False. Therefore, A affects B.
+ // Conversely, B also affects A.
+ // Therefore, set "collecting" to True and
+ // search "child Info" for allocatable.
+ for (auto& i : children_) {
+ i->collectAffectedAllocatables(isRevert, affectAllocatables, true,
+ forObject); // Collct when "OR"
+ }
+ }
+ } else {
+ // Processing when "Info" of "OR" in which evaluation result that is not
+ // qualified by an odd number of negative is "Skip" or evaluation reslt
+ // that is not qualified by an odd number of negative is "False".
+ // "!(A.isXXX OR B.isXXX)" can be decomposed into
+ // "!A.isXXX AND !B.isXXX", so if "NOT", perform the same processing
+ // as "AND".
+ if (!isFalse()) {
+ for (auto& i : children_) {
+ i->collectAffectedAllocatables(isRevert, affectAllocatables,
+ collecting, forObject);
+ }
+ }
+ }
+ break;
+ case RBAModelElementType::AndOperator:
+ case RBAModelElementType::ForAllOperator:
+ //"For-All {A,B}{x|x.isXXX}" is equivalent to "A.isXXX AND B.isXXX",
+ // so the same processing is performed
+ if (isRevert) {
+ // Processing when "Info" of "AND" in which evaluation result that
+ // is not qualified by an odd number of "negative" is "Skip" or
+ // evaluation reslt that is not qualified by an odd number of negative
+ // is "True".
+ //
+ // "!(A.isXXX AND B.isXXX)" can be decomposed into
+ // "!A.isXXX OR !B.isXXX", so if "NOT", perform the same processing
+ // as "OR".
+ if (!isFalse()) {
+ for (auto& i : children_) {
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // Function '::rba::RBAConstraintInfo::collectAffectedAllocatables(_,_o,&{c::std::set<p={c::rba::RBAAllocatable},
+ // {c::std::less<p={c::rba::RBAAllocatable}>},{c::std::allocator<p={c::rba::RBAAllocatable}>}>},_o)' is recursive.
+ //  [Reason that there is no problem if the rule is deviated]
+ // Recursive call is required as a feature
+ i->collectAffectedAllocatables(isRevert, affectAllocatables, true,
+ forObject);
+ }
+ }
+ } else {
+ // Processing when "Info" of "AND" in which evaluation result that
+ // is not qualified by an odd number of "negative" is "Skip" or
+ // evaluation reslt that is not qualified by an odd number of negative
+ // is "True".
+ //
+ // When "A.isXXX AND B.isXXX", the evaluation result of "AND" does not
+ // become True unless the evaluation result of B becomes True,
+ // regardless of the evaluation result of A. Therefore, A does not
+ // affect B, and B does not affect A.
+ // Therefore, "collecting" is as it is, and the "child Info" is
+ // searched for an allocable influence.
+ if (!isTrue()) {
+ for (auto& i : children_) {
+ i->collectAffectedAllocatables(isRevert, affectAllocatables,
+ collecting, forObject);
+ }
+ }
+ }
+ break;
+ case RBAModelElementType::MaxOperator:
+ case RBAModelElementType::MinOperator:
+ {
+ // When the <set> expression is "IF(A.isDisplayed) THEN {B,C} ELSE {D,E}",
+ // scan the left side to extract A as the area of influence
+ children_[0U]->collectAffectedAllocatables(false, affectAllocatables,
+ collecting,forObject);
+ // All the operands that are "x" in the lambda expression affect
+ // each other, so it is necessary to extract them as the affected Area.
+ for (std::uint8_t i { 1U }; i < children_.size(); ++i) {
+ children_[i]->collectAffectedAllocatables(isRevert, affectAllocatables,
+ true, true);
+ }
+ break;
+ }
+ // "A -> B" is the same as "!A OR B".
+ case RBAModelElementType::ImpliesOperator:
+ if (!isRevert) {
+ if (!isTrue()) {
+ // "A.isXXX -> B.isXXX" can be decomposed into "!A.isXXX OR B.isXXX",
+ // so the same process as OR is performed
+ // For the above reason, the acquisition target on the left side
+ // inverts isRevert.
+ children_[0U]->collectAffectedAllocatables(!isRevert,
+ affectAllocatables, true,
+ forObject);
+ children_[1U]->collectAffectedAllocatables(isRevert,
+ affectAllocatables, true,
+ forObject);
+ }
+ } else {
+ if (!isFalse()) {
+ // "!(A.isXXX -> B.isXXX)" can be decomposed into "A.isXXX OR !B.isXXX"
+ // For the above reason, the acquisition target on the left side
+ // inverts isRevert.
+ children_[0U]->collectAffectedAllocatables(!isRevert,
+ affectAllocatables,
+ collecting, forObject);
+ children_[1U]->collectAffectedAllocatables(isRevert,
+ affectAllocatables,
+ collecting, forObject);
+ }
+ }
+ break;
+ case RBAModelElementType::IfStatement:
+ // "IF(A) THEN B ELSE C" is the same as "!A OR B" if A is True,
+ // and the same as "A OR C" if A is False
+ if (children_[0U]->isTrue()) {
+ if (!isRevert) {
+ if (!isTrue()) {
+ // "IF(A.isXXX) THEN B.isXXX ELSE C.isXXX" can be decomposed into
+ // "(!A.isXXX OR B.isXXX)" when A is True.
+ // For the above reason, the acquisition target on the left side
+ // inverts isRevert.
+ children_[0U]->collectAffectedAllocatables(!isRevert,
+ affectAllocatables, true,
+ forObject);
+ children_[1U]->collectAffectedAllocatables(isRevert,
+ affectAllocatables, true,
+ forObject);
+ }
+ } else {
+ if (!isFalse()) {
+ // "!(IF(A.isXXX) THEN B.isXXX ELSE C.isXXX)" can be decomposed into
+ // "(!A.isXXX OR !B.isXXX)" when A is True.
+ // For the above reason, the acquisition target on the left side
+ // inverts isRevert.
+ children_[0U]->collectAffectedAllocatables(isRevert,
+ affectAllocatables, true,
+ forObject);
+ children_[1U]->collectAffectedAllocatables(isRevert,
+ affectAllocatables, true,
+ forObject);
+ }
+ }
+ } else {
+ if (!isRevert) {
+ if (!isTrue()) {
+ // "IF(A.isXXX) THEN B.isXXX ELSE C.isXXX" can be decomposed into
+ // "(A.isXXX OR C.isXXX)" when A is False.
+ children_[0U]->collectAffectedAllocatables(isRevert,
+ affectAllocatables, true,
+ forObject);
+ children_[1U]->collectAffectedAllocatables(isRevert,
+ affectAllocatables, true,
+ forObject);
+ }
+ } else {
+ if (!isFalse()) {
+ // "!(IF(A.isXXX) THEN B.isXXX ELSE C.isXXX)" can be decomposed into
+ // "(A.isXXX OR !C.isXXX)" when A is False.
+ children_[0U]->collectAffectedAllocatables(!isRevert,
+ affectAllocatables, true,
+ forObject);
+ children_[1U]->collectAffectedAllocatables(isRevert,
+ affectAllocatables, true,
+ forObject);
+ }
+ }
+ }
+ break;
+ default: // Collect Allocatable
+ if (collecting) {
+ if (isRevert) {
+ affectAllocatables.insert(trueAllocatables_.begin(),
+ trueAllocatables_.end());
+ } else {
+ affectAllocatables.insert(falseAllocatables_.begin(),
+ falseAllocatables_.end());
+ }
+ if (forObject) {
+ for (const auto& a : operandAllocatable_) {
+ affectAllocatables.insert(a);
+ }
+ }
+ }
+ for (auto& i : children_) {
+ i->collectAffectedAllocatables(isRevert, affectAllocatables, collecting,
+ forObject);
+ }
+ break;
+ }
+ return;
+}
+
+}
+
diff --git a/src/core/logic/RBAConstraintInfo.hpp b/src/core/logic/RBAConstraintInfo.hpp
new file mode 100644
index 0000000..8ab88dd
--- /dev/null
+++ b/src/core/logic/RBAConstraintInfo.hpp
@@ -0,0 +1,119 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// ConstraintInfo (Constraint expression Information) class header
+
+#ifndef RBACONSTRAINTINFO_HPP
+#define RBACONSTRAINTINFO_HPP
+
+#include <cstdint>
+#include <memory>
+#include <set>
+#include <vector>
+#include "RBAExecuteResult.hpp"
+#include "RBADllExport.hpp"
+
+namespace rba {
+
+class RBAAllocatable;
+class RBAExpression;
+
+class DLL_EXPORT RBAConstraintInfo
+{
+public:
+ RBAConstraintInfo()=default;
+ RBAConstraintInfo(const RBAConstraintInfo&)=delete;
+ RBAConstraintInfo(const RBAConstraintInfo&&)=delete;
+ RBAConstraintInfo& operator=(const RBAConstraintInfo&)=delete;
+ RBAConstraintInfo& operator=(const RBAConstraintInfo&&)=delete;
+ virtual ~RBAConstraintInfo()=default;
+
+public:
+ void setExpression(const RBAExpression* const expression);
+ const RBAExpression* getExpression() const;
+ void addOperandAllocatable(const RBAAllocatable* const operandAllocatable);
+ void setResult(const RBAExecuteResult result);
+ RBAConstraintInfo* getChild(const std::uint32_t index) const;
+ void setChild(const std::shared_ptr<RBAConstraintInfo> info);
+ void addTrueAllocatable(const RBAAllocatable* const allocatable);
+ void addFalseAllocatable(const RBAAllocatable* const allocatable);
+ void addTrueAllocatableFromOperand();
+ void addFalseAllocatableFromOperand();
+ void clearFalseAllocatable();
+ const bool isImplies() const;
+ void clear();
+
+ bool isExceptionBeforeArbitrate() const;
+ void setExceptionBeforeArbitrate(const bool exceptionBeforeArbitrate);
+
+ /// @brief Determine the need for re-arbitration
+ /// @param [in] allocatable Allcatable druing arbitration
+ /// @param [in] isImplies Whether the constraint expression contains
+ /// implication syntax.
+ /// @return Necessity of re-arbitration (true: need / false: No need)
+ bool needsRearbitrationFor(const RBAAllocatable* const allocatable,
+ bool isImplies = false) const;
+
+ bool needsReRearbitrationFor(const RBAAllocatable* const allocatable) const;
+ void collectRearbitrationTargetFor(const RBAAllocatable* const allocatable,
+ std::set<const RBAAllocatable*>& targets,
+ const bool isNot) const;
+ void collectTrueAllocatables(std::set<const RBAAllocatable*>& allocatables) const;
+ void collectFalseAllocatables(std::set<const RBAAllocatable*>& allocatables) const;
+ bool contains(const RBAAllocatable* const allocatable) const;
+ bool isTrue() const;
+ bool isFalse() const;
+
+ /// @brief Extraction of affected Area/Zone
+ /// @param [in] isRevert Negative context (true: inside / false: outside)
+ /// @param [out] affectAllocatables List of affected Allcatable
+ /// @param [out] collecting Collection target context
+ /// (true: inside / false: outside)
+ /// @param [out] forObject ReferenceObject context
+ /// (true: inside / false: outside)
+ /// @return Necessity of re-arbitration (true: need / false: No need)
+ void collectAffectedAllocatables(
+ const bool isRevert, std::set<const RBAAllocatable*>& affectAllocatables,
+ const bool collecting,
+ const bool forObject);
+
+private:
+ bool isRevert() const;
+ bool isSizeOperator() const;
+
+private:
+ bool exceptionBeforeArbitrate_ {false};
+ const RBAExpression* expression_ {nullptr};
+ RBAExecuteResult result_ {RBAExecuteResult::SKIP};
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::set<const RBAAllocatable*> trueAllocatables_;
+ std::set<const RBAAllocatable*> falseAllocatables_;
+ std::set<const RBAAllocatable*> operandAllocatable_;
+ // use to respond with an empty set
+ const std::set<const RBAAllocatable*> emptyAllocatables_;
+ mutable std::vector<std::shared_ptr<RBAConstraintInfo>> children_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+};
+
+}
+
+#endif
diff --git a/src/core/logic/RBAConstraintMap.hpp b/src/core/logic/RBAConstraintMap.hpp
new file mode 100644
index 0000000..6f37694
--- /dev/null
+++ b/src/core/logic/RBAConstraintMap.hpp
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBAConstraintMap.hpp
+ */
+
+#ifndef RBACONSTRAINTMAP_HPP
+#define RBACONSTRAINTMAP_HPP
+
+namespace rba
+{
+
+enum class RBAConstraintMap : std::uint8_t
+{
+ CONTENT_ALLOCATE_CONSTRAINTS,
+ HIDDEN_TRUE_CHECK_CONSTRAINTS,
+ HIDDEN_FALSE_CHECK_CONSTRAINTS,
+ ATTENUATE_TRUE_CHECK_CONSTRAINTS,
+ ATTENUATE_FALSE_CHECK_CONSTRAINTS,
+};
+
+}
+
+#endif
diff --git a/src/core/logic/RBAContentStatus.cpp b/src/core/logic/RBAContentStatus.cpp
new file mode 100644
index 0000000..04ed6d9
--- /dev/null
+++ b/src/core/logic/RBAContentStatus.cpp
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// ContentStatus (Content state transition management) class
+//
+
+#include "RBAContentState.hpp"
+#include "RBAContentStatus.hpp"
+#include "RBAContentStatusType.hpp"
+
+namespace rba
+{
+
+void RBAContentStatus::onRequest()
+{
+ if ((status_ != RBAContentStatusType::Displayed)
+ && (status_ != RBAContentStatusType::StandBy)) {
+ status_ = RBAContentStatusType::Undisplayed;
+ }
+}
+void RBAContentStatus::setStatusType(
+ const RBAContentStatusType type)
+{
+ status_ = type;
+}
+RBAContentStatusType RBAContentStatus::getStatusType() const
+{
+ return status_;
+}
+bool RBAContentStatus::isActive() const
+{
+ return ((status_ != RBAContentStatusType::NoRequest)
+ && (status_ != RBAContentStatusType::Canceled));
+}
+
+bool RBAContentStatus::isUndisplayed() const
+{
+ return (status_ == RBAContentStatusType::Undisplayed);
+}
+
+bool RBAContentStatus::isDisplayed() const
+{
+ return (status_ == RBAContentStatusType::Displayed);
+}
+bool RBAContentStatus::isStandby() const
+{
+ return (status_ == RBAContentStatusType::StandBy);
+}
+bool RBAContentStatus::hasBeenCanceled() const
+{
+ return (status_ == RBAContentStatusType::Canceled);
+}
+bool RBAContentStatus::hasBeenDisplayed() const
+{
+ return ((status_ == RBAContentStatusType::Displayed)
+ || (status_ == RBAContentStatusType::StandBy));
+}
+} /* namespace rba */
diff --git a/src/core/logic/RBAContentStatus.hpp b/src/core/logic/RBAContentStatus.hpp
new file mode 100644
index 0000000..69f7e8d
--- /dev/null
+++ b/src/core/logic/RBAContentStatus.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// ContentStatus (Content state transition management) class
+//
+
+#ifndef RBACONTENTSTATUS_HPP
+#define RBACONTENTSTATUS_HPP
+#include <cstdint>
+
+#include "RBAContentStatusType.hpp"
+
+namespace rba
+{
+class RBAContentState;
+
+class RBAContentStatus
+{
+ public:
+ RBAContentStatus()=default;
+ // Copy constructor is defined in default because it is used in another class
+ RBAContentStatus(const RBAContentStatus&)=default;
+ RBAContentStatus(const RBAContentStatus&&)=delete;
+ // Copy assignment operator is defined in default
+ // because it is used in other classes
+ RBAContentStatus& operator=(const RBAContentStatus&)=default;
+ RBAContentStatus& operator=(const RBAContentStatus&&)=delete;
+ virtual ~RBAContentStatus()=default;
+ void onRequest();
+ void setStatusType(const RBAContentStatusType type);
+ RBAContentStatusType getStatusType() const;
+ bool isActive() const;
+ bool isUndisplayed() const;
+ bool isDisplayed() const;
+ bool isStandby() const;
+ bool hasBeenCanceled() const;
+ bool hasBeenDisplayed() const;
+ private:
+ RBAContentStatusType status_ {RBAContentStatusType::NoRequest};
+};
+
+} /* namespace rba */
+
+#endif /* RBACONTENTSTATUS_HPP */
diff --git a/src/core/logic/RBARequest.cpp b/src/core/logic/RBARequest.cpp
new file mode 100644
index 0000000..c55cac1
--- /dev/null
+++ b/src/core/logic/RBARequest.cpp
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * RBARequest (request arbitration) class implementation
+ */
+
+#include "RBARequest.hpp"
+
+namespace rba
+{
+
+RBARequest::RBARequest(const std::string& context, const bool isOn) :
+ context_{context},
+ isOn_{isOn}
+{
+}
+
+std::string
+RBARequest::getContext() const
+{
+ return context_;
+}
+
+bool
+RBARequest::isOn() const
+{
+ return isOn_;
+}
+
+}
diff --git a/src/core/logic/RBARequest.hpp b/src/core/logic/RBARequest.hpp
new file mode 100644
index 0000000..b6da5e4
--- /dev/null
+++ b/src/core/logic/RBARequest.hpp
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * RBARequest (request arbitration) class header
+ */
+
+#ifndef RBAREQUEST_HPP
+#define RBAREQUEST_HPP
+
+#include <string>
+#include "RBADllExport.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBARequest
+{
+ public:
+ explicit RBARequest(const std::string& context, const bool isOn = true);
+ RBARequest(const RBARequest&)=delete;
+ RBARequest(const RBARequest&&)=delete;
+ RBARequest& operator=(const RBARequest&)=delete;
+ RBARequest& operator=(const RBARequest&&)=delete;
+ virtual ~RBARequest()=default;
+
+ public:
+ std::string getContext() const;
+ bool isOn() const;
+
+ private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::string context_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+ bool isOn_;
+
+};
+
+}
+
+#endif
diff --git a/src/core/logic/RBARequestQueMember.cpp b/src/core/logic/RBARequestQueMember.cpp
new file mode 100644
index 0000000..a5a0d35
--- /dev/null
+++ b/src/core/logic/RBARequestQueMember.cpp
@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * RBARequestQueueMember class implementation
+ */
+
+#include <cstdint>
+
+#include "RBARequestQueMember.hpp"
+#include "RBAContentState.hpp"
+
+namespace rba {
+
+RBARequestQueMember::RBARequestQueMember(const RBAContentState* const contentState, const bool isOn,
+ const std::uint32_t syncIndex):
+ contentState_{contentState},
+ isOn_{isOn},
+ syncIndex_{syncIndex}
+{
+}
+
+const RBAContentState* RBARequestQueMember::getContentState() const {
+ return contentState_;
+}
+
+bool RBARequestQueMember::isOn() const {
+ return isOn_;
+}
+
+std::uint32_t RBARequestQueMember::getSyncIndex() const {
+ return syncIndex_;
+}
+
+}
diff --git a/src/core/logic/RBARequestQueMember.hpp b/src/core/logic/RBARequestQueMember.hpp
new file mode 100644
index 0000000..cb18987
--- /dev/null
+++ b/src/core/logic/RBARequestQueMember.hpp
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * RBARequestQueueMember class header
+ */
+
+#ifndef RBAREQUESTQUEMEMBER_HPP
+#define RBAREQUESTQUEMEMBER_HPP
+
+#include <cstdint>
+
+namespace rba {
+
+class RBAContentState;
+
+class RBARequestQueMember {
+ public:
+ RBARequestQueMember(const RBAContentState* const contentState, const bool isOn, const std::uint32_t syncIndex);
+ RBARequestQueMember()=delete;
+ RBARequestQueMember(const RBARequestQueMember&)=delete;
+ RBARequestQueMember(const RBARequestQueMember&&)=delete;
+ RBARequestQueMember& operator=(const RBARequestQueMember&)=delete;
+ RBARequestQueMember& operator=(const RBARequestQueMember&&)=delete;
+ virtual ~RBARequestQueMember() = default;
+
+ const RBAContentState* getContentState() const;
+ bool isOn() const;
+ std::uint32_t getSyncIndex() const;
+
+ private:
+ // Content state for which arbitration was requested
+ const RBAContentState* contentState_;
+ // Whether display/output request or scene ON request
+ bool isOn_;
+
+ /// Index of arbitration syntax
+ /// QueMenber with the same value will be arbitrated at the same timing,
+ /// and if the values are different, differential arbitration is performed.
+ /// When a request for execute(list,bool) is received, the content icluded
+ /// in the list will all have the same value.
+ /// When setContentState(ContentState, bool) request is received twice,
+ /// the first request and the second request have different values.
+ /// When created by onRequest or onWithdrawn,
+ /// it has the same value as the request that triggered it.
+ std::uint32_t syncIndex_;
+};
+
+}
+
+#endif /* RBAREQUESTQUEMEMBER_HPP */
diff --git a/src/core/logic/RBAResultImpl.cpp b/src/core/logic/RBAResultImpl.cpp
new file mode 100644
index 0000000..41c291f
--- /dev/null
+++ b/src/core/logic/RBAResultImpl.cpp
@@ -0,0 +1,1088 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBAResultImpl (result of arbitration implementation) class
+ */
+
+#include "RBAResultImpl.hpp"
+
+#include "RBAContentStatusType.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAViewContentImpl.hpp"
+#include "RBAViewContentStateImpl.hpp"
+#include "RBASoundContentImpl.hpp"
+#include "RBASoundContentStateImpl.hpp"
+#include "RBAResultSet.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAContentState.hpp"
+#include "RBAContent.hpp"
+#include "RBAAreaImpl.hpp"
+#include "RBAZoneImpl.hpp"
+#include "RBASceneImpl.hpp"
+#include "RBASizeImpl.hpp"
+#include "RBAConstraint.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAViewActionType.hpp"
+#include "RBAViewTransition.hpp"
+#include "RBAViewMove.hpp"
+
+namespace rba {
+
+RBAResultImpl::RBAResultImpl(const RBAArbitrator* const arb,
+ std::unique_ptr<RBAResultSet> newPrevResultSet):
+ RBAResult(),
+ preResultSet_{std::move(newPrevResultSet)},
+ arb_{arb},
+ statusType_{RBAResultStatusType::SUCCESS}
+{
+ curResultSet_ = std::make_unique<RBAResultSet>();
+ curResultSet_->copyActives(preResultSet_);
+ curResultSet_->copyProperties(preResultSet_);
+}
+
+RBAResultImpl::RBAResultImpl(const RBAArbitrator* const arb,
+ std::unique_ptr<RBAResultSet> newPrevResultSet,
+ std::unique_ptr<RBAResultSet> newCurResultSet):
+ RBAResult(),
+ curResultSet_{std::move(newCurResultSet)},
+ preResultSet_{std::move(newPrevResultSet)},
+ arb_{arb},
+ statusType_{RBAResultStatusType::SUCCESS}
+{
+}
+
+RBAResultImpl::RBAResultImpl(const RBAResultImpl* const replicationTarget)
+ : RBAResult{},
+ curResultSet_{std::make_unique<RBAResultSet>(*(replicationTarget->curResultSet_.get()))},
+ preResultSet_{std::make_unique<RBAResultSet>(*(replicationTarget->preResultSet_.get()))},
+ arb_{replicationTarget->arb_},
+ statusType_{RBAResultStatusType::SUCCESS},
+ log_{replicationTarget->log_}
+{
+ for (const auto &va : replicationTarget->viewActions_) {
+ if (va->getViewActionType() == RBAViewActionType::MOVE) {
+ viewActions_.push_back(
+ std::make_unique<RBAViewMove>(va->getFromArea(), va->getToArea(),
+ va->getContentState()));
+ } else if (va->getViewActionType()
+ == RBAViewActionType::TRANSITION_REPLACE) {
+ viewActions_.push_back(
+ std::make_unique<RBAViewTransition>(va->getViewActionType(),
+ va->getArea(),
+ va->getFromContentState(),
+ va->getToContentState()));
+ } else {
+ viewActions_.push_back(
+ std::make_unique<RBAViewTransition>(va->getViewActionType(),
+ va->getArea(),
+ va->getContentState()));
+ }
+ }
+}
+
+//
+// External
+//
+
+// [get VisibleArea/SoundingZone]
+
+const std::list<const RBAArea*>&
+RBAResultImpl::getVisibleAreas() const
+{
+ return curResultSet_->getVisibleAreas();
+}
+
+const std::list<const RBAArea*>&
+RBAResultImpl::getPreVisibleAreas() const
+{
+ return preResultSet_->getVisibleAreas();
+}
+
+const std::list<const RBAZone*>&
+RBAResultImpl::getSoundingZones() const
+{
+ return curResultSet_->getSoundingZones();
+}
+
+const std::list<const RBAZone*>&
+RBAResultImpl::getPreSoundingZones() const
+{
+ return preResultSet_->getSoundingZones();
+}
+
+// [get Visible/Sounding ContentStates]
+
+const std::list<const RBAViewContentState*>&
+RBAResultImpl::getVisibleContentStates() const
+{
+ return curResultSet_->getVisibleContentStates();
+}
+
+const std::list<const RBAViewContentState*>&
+RBAResultImpl::getPreVisibleContentStates() const
+{
+ return preResultSet_->getVisibleContentStates();
+}
+
+const std::list<const RBASoundContentState*>&
+RBAResultImpl::getSoundingContentStates() const
+{
+ return curResultSet_->getSoundingContentStates();
+}
+
+const std::list<const RBASoundContentState*>&
+RBAResultImpl::getPreSoundingContentStates() const
+{
+ return preResultSet_->getSoundingContentStates();
+}
+
+// [get Active View/Sound ContentStates]
+
+const std::list<const RBAViewContentState*>&
+RBAResultImpl::getActiveViewContentStates() const
+{
+ return curResultSet_->getActiveViewContentStates();
+}
+
+const std::list<const RBAViewContentState*>&
+RBAResultImpl::getPreActiveViewContentStates() const
+{
+ return preResultSet_->getActiveViewContentStates();
+}
+
+const std::list<const RBASoundContentState*>&
+RBAResultImpl::getActiveSoundContentStates() const
+{
+ return curResultSet_->getActiveSoundContentStates();
+}
+
+const std::list<const RBASoundContentState*>&
+RBAResultImpl::getPreActiveSoundContentStates() const
+{
+ return preResultSet_->getActiveSoundContentStates();
+}
+
+// [get etActive Scenes]
+
+const std::list<const RBAScene*>&
+RBAResultImpl::getActiveScenes() const
+{
+ return curResultSet_->getActiveScenes();
+}
+
+const std::list<const RBAScene*>&
+RBAResultImpl::getPreActiveScenes() const
+{
+ return preResultSet_->getActiveScenes();
+}
+
+// [get InvisibleAreas/UnsoundingZone]
+
+const std::list<const RBAArea*>&
+RBAResultImpl::getInvisibleAreas() const
+{
+ return curResultSet_->getInvisibleAreas();
+}
+
+const std::list<const RBAArea*>&
+RBAResultImpl::getPreInvisibleAreas() const
+{
+ return preResultSet_->getInvisibleAreas();
+}
+
+const std::list<const RBAZone*>&
+RBAResultImpl::getUnsoundingZones() const
+{
+ return curResultSet_->getUnsoundingZones();
+}
+
+const std::list<const RBAZone*>&
+RBAResultImpl::getPreUnsoundingZones() const
+{
+ return preResultSet_->getUnsoundingZones();
+}
+
+// [get HiddenAreas/MuteZones]
+
+const std::list<const RBAArea*>&
+RBAResultImpl::getHiddenAreas() const
+{
+ return curResultSet_->getHiddenAreas();
+}
+
+const std::list<const RBAArea*>&
+RBAResultImpl::getPreHiddenAreas() const
+{
+ return preResultSet_->getHiddenAreas();
+}
+
+const std::list<const RBAZone*>&
+RBAResultImpl::getMuteZones() const
+{
+ return curResultSet_->getMuteZones();
+}
+
+const std::list<const RBAZone*>&
+RBAResultImpl::getPreMuteZones() const
+{
+ return preResultSet_->getMuteZones();
+}
+
+// [get Attenuated]
+
+const std::list<const RBAZone*>&
+RBAResultImpl::getAttenuatedZones() const
+{
+ return curResultSet_->getAttenuatedZones();
+}
+
+const std::list<const RBAZone*>&
+RBAResultImpl::getPreAttenuatedZones() const
+{
+ return preResultSet_->getAttenuatedZones();
+}
+
+// [get Canceled Contents]
+
+const std::list<const RBAViewContent*>&
+RBAResultImpl::getCanceledViewContents() const
+{
+ return curResultSet_->getCanceledViewContents();
+}
+
+const std::list<const RBAViewContent*>&
+RBAResultImpl::getPreCanceledViewContents() const
+{
+ return preResultSet_->getCanceledViewContents();
+}
+
+const std::list<const RBASoundContent*>&
+RBAResultImpl::getCanceledSoundContents() const
+{
+ return curResultSet_->getCanceledSoundContents();
+}
+
+const std::list<const RBASoundContent*>&
+RBAResultImpl::getPreCanceledSoundContents() const
+{
+ return preResultSet_->getCanceledSoundContents();
+}
+
+// [get Standby Contents]
+
+const std::list<const RBAViewContent*>&
+RBAResultImpl::getStandbyViewContents() const
+{
+ return curResultSet_->getStandbyViewContents();
+}
+
+const std::list<const RBAViewContent*>&
+RBAResultImpl::getPreStandbyViewContents() const
+{
+ return preResultSet_->getStandbyViewContents();
+}
+
+const std::list<const RBASoundContent*>&
+RBAResultImpl::getStandbySoundContents() const
+{
+ return curResultSet_->getStandbySoundContents();
+}
+
+const std::list<const RBASoundContent*>&
+RBAResultImpl::getPreStandbySoundContents() const
+{
+ return preResultSet_->getStandbySoundContents();
+}
+
+// [get ContentStates]
+
+const RBAViewContentState*
+RBAResultImpl::getContentState(const RBAArea* area) const
+{
+ return dynamic_cast<const RBAViewContentState*>(
+ curResultSet_->getContentState(dynamic_cast<const RBAAllocatable*>(area)));
+}
+
+const RBAViewContentState*
+RBAResultImpl::getPreContentState(const RBAArea* area) const
+{
+ return dynamic_cast<const RBAViewContentState*>(
+ preResultSet_->getContentState(dynamic_cast<const RBAAllocatable*>(area)));
+}
+
+const RBASoundContentState*
+RBAResultImpl::getContentState(const RBAZone* zone) const
+{
+ return dynamic_cast<const RBASoundContentState*>(
+ curResultSet_->getContentState(dynamic_cast<const RBAAllocatable*>(zone)));
+}
+
+const RBASoundContentState*
+RBAResultImpl::getPreContentState(const RBAZone* zone) const
+{
+ return dynamic_cast<const RBASoundContentState*>(
+ preResultSet_->getContentState(dynamic_cast<const RBAAllocatable*>(zone)));
+}
+
+// [get Areas/Zones by ConentState]
+
+const std::list<const RBAArea*>
+RBAResultImpl::getArea(const RBAViewContentState* state) const
+{
+ std::list<const RBAArea*> areaList;
+ curResultSet_->getArea(state, areaList);
+ return areaList;
+}
+
+const std::list<const RBAArea*>
+RBAResultImpl::getPreArea(const RBAViewContentState* state) const
+{
+ std::list<const RBAArea*> areaList;
+ preResultSet_->getArea(state, areaList);
+ return areaList;
+}
+
+const std::list<const RBAZone*>
+RBAResultImpl::getZone(const RBASoundContentState* state) const
+{
+ std::list<const RBAZone*> zoneList;
+ curResultSet_->getZone(state, zoneList);
+ return zoneList;
+}
+
+const std::list<const RBAZone*>
+RBAResultImpl::getPreZone(const RBASoundContentState* state) const
+{
+ std::list<const RBAZone*> zoneList;
+ preResultSet_->getZone(state, zoneList);
+ return zoneList;
+}
+
+// [get Areas/Zones by Content]
+
+const std::list<const RBAArea*>
+RBAResultImpl::getArea(const RBAViewContent* content) const
+{
+ std::list<const RBAArea*> areaList;
+ curResultSet_->getArea(content, areaList);
+ return areaList;
+}
+
+const std::list<const RBAArea*>
+RBAResultImpl::getPreArea(const RBAViewContent* content) const
+{
+ std::list<const RBAArea*> areaList;
+ preResultSet_->getArea(content, areaList);
+ return areaList;
+}
+
+const std::list<const RBAZone*>
+RBAResultImpl::getZone(const RBASoundContent* content) const
+{
+ std::list<const RBAZone*> zoneList;
+ curResultSet_->getZone(content, zoneList);
+ return zoneList;
+}
+
+const std::list<const RBAZone*>
+RBAResultImpl::getPreZone(const RBASoundContent* content) const
+{
+ std::list<const RBAZone*> zoneList;
+ preResultSet_->getZone(content, zoneList);
+ return zoneList;
+}
+
+// [get Size]
+
+const RBASize*
+RBAResultImpl::getSize(const RBAArea* area) const
+{
+ return curResultSet_->getSize(area);
+}
+
+const RBASize*
+RBAResultImpl::getPreSize(const RBAArea* area) const
+{
+ return preResultSet_->getSize(area);
+}
+
+// [check Active Scene]
+bool
+RBAResultImpl::isActive(const RBAScene* scene) const
+{
+ return curResultSet_->isActive(scene);
+}
+
+bool
+RBAResultImpl::isPreActive(const RBAScene* scene) const
+{
+ return preResultSet_->isActive(scene);
+}
+
+// [check Active Content]
+bool
+RBAResultImpl::isActive(const RBAContent* const content) const
+{
+ return curResultSet_->isActive(content);
+}
+bool
+RBAResultImpl::isActive(const RBAViewContent* content) const
+{
+ return curResultSet_->isActive(dynamic_cast<const RBAContent*>(content));
+}
+
+bool
+RBAResultImpl::isActive(const RBASoundContent* content) const
+{
+ return curResultSet_->isActive(dynamic_cast<const RBAContent*>(content));
+}
+bool
+RBAResultImpl::isPreActive(const RBAContent* const content) const
+{
+ return preResultSet_->isActive(content);
+}
+bool
+RBAResultImpl::isPreActive(const RBAViewContent* content) const
+{
+ return preResultSet_->isActive(dynamic_cast<const RBAContent*>(content));
+}
+
+bool
+RBAResultImpl::isPreActive(const RBASoundContent* content) const
+{
+ return preResultSet_->isActive(dynamic_cast<const RBAContent*>(content));
+}
+
+// [check Active ContentState]
+bool
+RBAResultImpl::isActive(const RBAContentState* const state) const
+{
+ return curResultSet_->isActive(state);
+}
+
+bool
+RBAResultImpl::isActive(const RBAViewContentState* const state) const
+{
+ return isActive(dynamic_cast<const RBAContentState*>(state));
+}
+
+bool
+RBAResultImpl::isActive(const RBASoundContentState* const state) const
+{
+ return isActive(dynamic_cast<const RBAContentState*>(state));
+}
+
+bool
+RBAResultImpl::isPreActive(const RBAContentState* const state) const
+{
+ return preResultSet_->isActive(state);
+}
+
+bool
+RBAResultImpl::isPreActive(const RBAViewContentState* const state) const
+{
+ return isPreActive(dynamic_cast<const RBAContentState*>(state));
+}
+
+bool
+RBAResultImpl::isPreActive(const RBASoundContentState* const state) const
+{
+ return isPreActive(dynamic_cast<const RBAContentState*>(state));
+}
+
+const RBAContentState*
+RBAResultImpl::getActiveState(const RBAContent* const content) const
+{
+ if (curResultSet_->isActive(content)){
+ return curResultSet_->getReqestState(content);
+ }
+ return nullptr;
+}
+
+const RBAContentState*
+RBAResultImpl::getPreActiveState(const RBAContent* const content) const
+{
+ if (preResultSet_->isActive(content)){
+ return preResultSet_->getReqestState(content);
+ }
+ return nullptr;
+}
+
+// [check Visible/Sounding Alloc ContentState]
+
+bool
+RBAResultImpl::isOutputting(const RBAAllocatable* const alloc) const
+{
+ return curResultSet_->isOutputting(alloc);
+}
+
+bool
+RBAResultImpl::isPreOutputting(const RBAAllocatable* const alloc) const
+{
+ return preResultSet_->isOutputting(alloc);
+}
+
+bool
+RBAResultImpl::isOutputting(const RBAContentState* const state) const
+{
+ return curResultSet_->isOutputting(state);
+}
+
+bool
+RBAResultImpl::isPreOutputting(const RBAContentState* const state) const
+{
+ return preResultSet_->isOutputting(state);
+}
+
+bool
+RBAResultImpl::isVisible(const RBAViewContentState* state) const
+{
+ return isOutputting(dynamic_cast<const RBAContentState*>(state));
+}
+
+bool
+RBAResultImpl::isPreVisible(const RBAViewContentState* state) const
+{
+ return isPreOutputting(dynamic_cast<const RBAContentState*>(state));
+}
+
+bool
+RBAResultImpl::isSounding(const RBASoundContentState* state) const
+{
+ return isOutputting(dynamic_cast<const RBAContentState*>(state));
+}
+
+bool
+RBAResultImpl::isPreSounding(const RBASoundContentState* state) const
+{
+ return isPreOutputting(dynamic_cast<const RBAContentState*>(state));
+}
+
+// [get View/Sound ContentState]
+
+const RBAContentState*
+RBAResultImpl::getAllocatedContentState(const RBAAllocatable* const allocatable) const
+{
+ return curResultSet_->getContentState(allocatable);
+}
+
+const RBAContentState*
+RBAResultImpl::getPreAllocatedContentState(const RBAAllocatable* const allocatable) const
+{
+ return preResultSet_->getContentState(allocatable);
+}
+
+const RBAViewContentState*
+RBAResultImpl::getViewContentState(const RBAArea* area) const
+{
+ return dynamic_cast<const RBAViewContentState*>(
+ curResultSet_->getContentState(dynamic_cast<const RBAAllocatable*>(area)));
+}
+
+const RBAViewContentState*
+RBAResultImpl::getPreViewContentState(const RBAArea* area) const
+{
+ return dynamic_cast<const RBAViewContentState*>(
+ preResultSet_->getContentState(dynamic_cast<const RBAAllocatable*>(area)));
+}
+
+const RBASoundContentState*
+RBAResultImpl::getSoundContentState(const RBAZone* zone) const
+{
+ return dynamic_cast<const RBASoundContentState*>(
+ curResultSet_->getContentState(dynamic_cast<const RBAAllocatable*>(zone)));
+}
+
+const RBASoundContentState*
+RBAResultImpl::getPreSoundContentState(const RBAZone* zone) const
+{
+ return dynamic_cast<const RBASoundContentState*>(
+ preResultSet_->getContentState(dynamic_cast<const RBAAllocatable*>(zone)));
+}
+
+// [check Hidden/Mute]
+
+bool
+RBAResultImpl::isHidden(const RBAArea* area) const
+{
+ return isHidden(dynamic_cast<const RBAAllocatable*>(area));
+}
+
+bool
+RBAResultImpl::isPreHidden(const RBAArea* area) const
+{
+ return isPreHidden(dynamic_cast<const RBAAllocatable*>(area));
+}
+
+bool
+RBAResultImpl::isMute(const RBAZone* zone) const
+{
+ return isHidden(dynamic_cast<const RBAAllocatable*>(zone));
+}
+
+bool
+RBAResultImpl::isPreMute(const RBAZone* zone) const
+{
+ return isPreHidden(dynamic_cast<const RBAAllocatable*>(zone));
+}
+
+// [check Attenuated]
+bool
+RBAResultImpl::isAttenuated(const RBAZone* zone) const
+{
+ return curResultSet_->isAttenuated(zone);
+}
+
+bool
+RBAResultImpl::isPreAttenuated(const RBAZone* zone) const
+{
+ return preResultSet_->isAttenuated(zone);
+}
+
+// [common]
+
+const std::list<const RBAViewAction*>&
+RBAResultImpl::getViewActions() const
+{
+ viewActionsForPublicUse_.clear();
+ for (auto& va :viewActions_) {
+ viewActionsForPublicUse_.push_back(va.get());
+ }
+ return viewActionsForPublicUse_;
+}
+
+RBAResultStatusType
+RBAResultImpl::getStatusType() const
+{
+ return statusType_;
+}
+
+bool
+RBAResultImpl::isLater(const RBAContent* const target,
+ const RBAContent* const comparisonTarget) const
+{
+ return curResultSet_->isLater(target, comparisonTarget);
+}
+
+std::string
+RBAResultImpl::getLog() const
+{
+ return log_;
+}
+
+void
+RBAResultImpl::setLog(const std::string& log)
+{
+ log_ = log;
+}
+
+bool
+RBAResultImpl::hasDisplayingArea(const RBADisplay* display) const
+{
+ if (display == nullptr) {
+ return false;
+ } else {
+ return curResultSet_->hasDisplayingArea(display);
+ }
+}
+
+bool
+RBAResultImpl::satisfiesConstraints() const
+{
+ if(statusType_ != RBAResultStatusType::SUCCESS) {
+ return false;
+ }
+ return arb_->satisfiesConstraints();
+}
+
+void
+RBAResultImpl::setSceneProperty(const RBASceneImpl* const scene,
+ const std::string& propertyName,
+ const std::int32_t value)
+{
+ curResultSet_->setSceneProperty(scene->getProperty(propertyName), value);
+}
+
+void
+RBAResultImpl::setSceneProperty(const RBAAbstractProperty* const property,
+ const std::int32_t value)
+{
+ curResultSet_->setSceneProperty(property, value);
+}
+
+std::int32_t
+RBAResultImpl::getSceneProperty(const RBAScene* scene,
+ const std::string& propertyName) const
+{
+ if(scene == nullptr) {
+ return -99;
+ }
+
+ const RBAAbstractProperty* const prop
+ {dynamic_cast<const RBASceneImpl*>(scene)->getProperty(propertyName)};
+ if(prop == nullptr) {
+ return -99;
+ }
+
+ return curResultSet_->getSceneProperty(prop);
+}
+
+std::int32_t
+RBAResultImpl::getSceneProperty(const RBAAbstractProperty* const property) const
+{
+ return curResultSet_->getSceneProperty(property);
+}
+
+std::int32_t
+RBAResultImpl::getPreSceneProperty(const RBAAbstractProperty* const property) const
+{
+ return preResultSet_->getSceneProperty(property);
+}
+
+//
+// Internal
+//
+
+// Impl [VisibleArea/SoundingZone]
+
+const std::set<const RBAAllocatable*>&
+RBAResultImpl::getOutputtingAllocatables() const
+{
+ return curResultSet_->getOutputtingAllocatables();
+}
+
+// Impl [get Active View/Sound ContentStates]
+
+const std::set<const RBAContentState*>&
+RBAResultImpl::getActiveContentStates() const
+{
+ return curResultSet_->getActiveContentStates();
+}
+
+// Impl [get ContentStates]
+const RBAContentState*
+RBAResultImpl::getContentState(const RBAAllocatable* const allocatable) const
+{
+ return curResultSet_->getContentState(allocatable);
+}
+
+const RBAContentState*
+RBAResultImpl::getDirectContentState(const RBAAllocatable* const allocatable) const
+{
+ return curResultSet_->getDirectContentState(allocatable);
+}
+
+const RBAContentState*
+RBAResultImpl::getPreContentState(const RBAAllocatable* const allocatable) const
+{
+ return preResultSet_->getContentState(allocatable);
+}
+
+const RBAContentState*
+RBAResultImpl::getDirectPreContentState(const RBAAllocatable* const allocatable) const
+{
+ return preResultSet_->getDirectContentState(allocatable);
+}
+
+// Impl [get Areas/Zones by ConentState]
+
+std::list<const RBAAllocatable*>
+RBAResultImpl::getAllocatable(const RBAContentState* const state) const
+{
+ std::list<const RBAAllocatable*> allocatables;
+ if(state->isViewContentState()) {
+ std::list<const RBAArea*> areaList;
+ curResultSet_->getArea(dynamic_cast<const RBAViewContentState*>(state),
+ areaList);
+ for (const auto& area : areaList) {
+ allocatables.push_back(dynamic_cast<const RBAAllocatable*>(area));
+ }
+ }
+ else {
+ std::list<const RBAZone*> zoneList;
+ curResultSet_->getZone(dynamic_cast<const RBASoundContentState*>(state),
+ zoneList);
+ for (const auto& zone : zoneList) {
+ allocatables.push_back(dynamic_cast<const RBAAllocatable*>(zone));
+ }
+ }
+ return allocatables;
+}
+
+// Impl [check Aleady Visible/Sounding]
+bool
+RBAResultImpl::isAlreadyOutputting(const RBAContentState* const state) const
+{
+ return curResultSet_->isAlreadyOutputting(state);
+}
+
+// Impl [set Active Scene]
+
+void
+RBAResultImpl::setActive(const RBAScene* const scene, const bool newActive)
+{
+ curResultSet_->setActive(scene, newActive);
+}
+
+// Impl [set Active ContentState]
+
+void
+RBAResultImpl::setActive(const RBAContentState* const state, const bool newActive)
+{
+ curResultSet_->setActive(state, newActive);
+}
+
+// Impl [add Standby Content]
+
+void
+RBAResultImpl::addStandbyContent(const RBAContent* const content)
+{
+ curResultSet_->addStandbyContent(content);
+}
+
+// Impl [check Visible/Sounding Area/Zone]
+
+bool
+RBAResultImpl::isVisible(const RBAArea* area) const
+{
+ return curResultSet_->isOutputting(dynamic_cast<const RBAAllocatable*>(area));
+}
+
+bool
+RBAResultImpl::isPreVisible(const RBAArea* area) const
+{
+ return preResultSet_->isOutputting(dynamic_cast<const RBAAllocatable*>(area));
+}
+
+bool
+RBAResultImpl::isSounding(const RBAZone* zone) const
+{
+ return curResultSet_->isOutputting(dynamic_cast<const RBAAllocatable*>(zone));
+}
+
+bool
+RBAResultImpl::isPreSounding(const RBAZone* zone) const
+{
+ return preResultSet_->isOutputting(dynamic_cast<const RBAAllocatable*>(zone));
+}
+
+// Impl [set View/Sound ContentState]
+
+void RBAResultImpl::setContentState(const RBAAllocatable* const allocatable,
+ const RBAContentState* const state)
+{
+ curResultSet_->setContentState(allocatable, state);
+}
+
+// Impl [check Hidden/Mute Area/Zone]
+
+bool
+RBAResultImpl::isHidden(const RBAAllocatable* const allocatable) const
+{
+ return curResultSet_->isHidden(allocatable);
+}
+
+bool
+RBAResultImpl::isPreHidden(const RBAAllocatable* const allocatable) const
+{
+ return preResultSet_->isHidden(allocatable);
+}
+
+// Impl [set Cancel ContentState]
+
+void
+RBAResultImpl::setCancel(const RBAContentState* const state, const bool checked)
+{
+ curResultSet_->setCancel(state, checked);
+}
+
+// Impl [check Cancel ContentState]
+
+bool
+RBAResultImpl::isCancel(const RBAContentState* const state) const
+{
+ return curResultSet_->isCancel(state);
+}
+
+bool
+RBAResultImpl::isPreCancel(const RBAContentState* const state) const
+{
+ return preResultSet_->isCancel(state);
+}
+
+bool
+RBAResultImpl::isCancel(const RBAViewContentState* state) const
+{
+ return isCancel(dynamic_cast<const RBAContentState*>(state));
+}
+
+bool
+RBAResultImpl::isPreCancel(const RBAViewContentState* state) const
+{
+ return isPreCancel(dynamic_cast<const RBAContentState*>(state));
+}
+
+bool
+RBAResultImpl::isCancel(const RBASoundContentState* state) const
+{
+ return isCancel(dynamic_cast<const RBAContentState*>(state));
+}
+
+bool
+RBAResultImpl::isPreCancel(const RBASoundContentState* state) const
+{
+ return isPreCancel(dynamic_cast<const RBAContentState*>(state));
+}
+
+// Impl [add Visible/Sounding ContentState]
+
+void
+RBAResultImpl::addOutputtingContentState(const RBAContentState* const state)
+{
+ curResultSet_->addOutputtingContentState(state);
+}
+
+// Impl [cancel ContentState]
+
+void
+RBAResultImpl::cancelContentState(const RBAContentState* const state)
+{
+ curResultSet_->cancelContentState(state);
+}
+
+// Impl [common]
+
+std::unique_ptr<RBAResultSet>
+RBAResultImpl::createBackupCurrentResultSet()
+{
+ return std::make_unique<RBAResultSet>(*curResultSet_);
+}
+
+std::unique_ptr<RBAResultSet>
+RBAResultImpl::createNextCurrentResultSet()
+{
+ std::unique_ptr<RBAResultSet> nextResultSet {std::make_unique<RBAResultSet>()};
+ nextResultSet->copyActives(curResultSet_);
+ nextResultSet->copyProperties(curResultSet_);
+ return nextResultSet;
+}
+
+void
+RBAResultImpl::addViewAction(std::unique_ptr<RBAViewAction>& newViewAction)
+{
+ viewActions_.push_back(move(newViewAction));
+}
+
+void
+RBAResultImpl::setStatusType(const RBAResultStatusType newStatusType)
+{
+ statusType_ = newStatusType;
+}
+
+void
+RBAResultImpl::updateActiveContentStates()
+{
+ curResultSet_->updateActiveContentStates();
+}
+
+void
+RBAResultImpl::setContentOfEventProcessing(const RBAEventProcessing* const eventProcessing,
+ const RBAContent* const viewContent)
+{
+ curResultSet_->setContentOfEventProcessing(eventProcessing, viewContent);
+}
+
+std::unique_ptr<RBAResultSet>&
+RBAResultImpl::getCurResultSet()
+{
+ return curResultSet_;
+}
+
+std::unique_ptr<RBAResultSet>&
+RBAResultImpl::getPreResultSet()
+{
+ return preResultSet_;
+}
+
+RBAContentStatusType RBAResultImpl::getStatusType(const RBAContent* const content) const
+{
+ return curResultSet_->getStatusType(content);
+}
+bool RBAResultImpl::isStandby(const RBAContent* const content) const
+{
+ return curResultSet_->isStandby(content);
+}
+
+bool RBAResultImpl::hasBeenCanceled(const RBAContent* const content) const
+{
+ return curResultSet_->hasBeenCanceled(content);
+}
+
+bool RBAResultImpl::hasBeenPreCanceled(const RBAContent* const content) const
+{
+ return preResultSet_->hasBeenCanceled(content);
+}
+
+bool RBAResultImpl::hasBeenDisplayed(const RBAContent* const content) const
+{
+ return curResultSet_->hasBeenDisplayed(content);
+}
+bool RBAResultImpl::hasBeenPreDisplayed(const RBAContent* const content) const
+{
+ return preResultSet_->hasBeenDisplayed(content);
+}
+
+void RBAResultImpl::updateStatus(const RBAContent* const content)
+{
+ const RBAContentState* const s {getActiveState(content)};
+ if (s != nullptr) {
+ if (isOutputting(s)) {
+ curResultSet_->setStatusType(content, RBAContentStatusType::Displayed);
+ } else if (isCancel(s)) {
+ curResultSet_->setStatusType(content, RBAContentStatusType::Canceled);
+ } else if (curResultSet_->getStatusType(content) != RBAContentStatusType::Undisplayed) {
+ curResultSet_->setStatusType(content, RBAContentStatusType::StandBy);
+ } else {
+ ;
+ }
+ }
+}
+
+std::unordered_map<const RBAContent*, RBAContentStatus>* RBAResultImpl::getCurStatus() const
+{
+ return curResultSet_->getStatus();
+}
+
+std::set<const RBASceneImpl*>& RBAResultImpl::getDifferentConditionScenes() const
+{
+ return (curResultSet_->getDifferentConditionScenes(*preResultSet_.get()));
+}
+#ifdef RBA_USE_LOG
+void
+RBAResultImpl::addFailedConstraint(const RBAConstraint* constraint)
+{
+ curResultSet_->addFailedConstraint(constraint);
+}
+
+const std::list<const RBAConstraint*>&
+RBAResultImpl::getFailedConstraints() const
+{
+ return curResultSet_->getFailedConstraints();
+}
+#endif
+
+}
diff --git a/src/core/logic/RBAResultImpl.hpp b/src/core/logic/RBAResultImpl.hpp
new file mode 100644
index 0000000..d7a1aa1
--- /dev/null
+++ b/src/core/logic/RBAResultImpl.hpp
@@ -0,0 +1,343 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBAResultImpl (result of arbitration implementation) class header
+ */
+
+#ifndef RBARESULTIMPL_HPP
+#define RBARESULTIMPL_HPP
+
+#include <memory>
+#include <unordered_map>
+#include <set>
+#include "RBAResult.hpp"
+#include "RBAResultStatusType.hpp"
+#include "RBAContentStatusType.hpp"
+
+namespace rba {
+
+class RBAArbitrator;
+class RBAArea;
+class RBAViewContent;
+class RBAViewContentState;
+class RBASize;
+class RBAScene;
+class RBAAbstractProperty;
+class RBAAreaImpl;
+class RBAContentStateImpl;
+class RBAViewContentImpl;
+class RBAViewContentStateImpl;
+class RBASizeImpl;
+class RBASceneImpl;
+class RBAResultSet;
+class RBAViewAction;
+class RBAZoneImpl;
+class RBASoundContentImpl;
+class RBASoundContentStateImpl;
+class RBASoundContent;
+class RBASoundContentState;
+class RBAContentState;
+class RBAAllocatable;
+class RBAContent;
+class RBAEventProcessing;
+class RBAConstraint;
+class RBAContentStatus;
+
+class DLL_EXPORT RBAResultImpl : public RBAResult
+{
+public:
+ RBAResultImpl(const RBAArbitrator* const arb,
+ std::unique_ptr<RBAResultSet> newPrevResultSet);
+ RBAResultImpl(const RBAArbitrator* const arb,
+ std::unique_ptr<RBAResultSet> newPrevResultSet,
+ std::unique_ptr<RBAResultSet> newCurResultSet);
+ RBAResultImpl(const RBAResultImpl* const replicationTarget);
+ RBAResultImpl(const RBAResultImpl&)=delete;
+ RBAResultImpl(const RBAResultImpl&&)=delete;
+ RBAResultImpl& operator=(const RBAResultImpl&)=delete;
+ RBAResultImpl& operator=(const RBAResultImpl&&)=delete;
+ virtual ~RBAResultImpl()=default;
+
+public:
+
+ //
+ // External
+ //
+
+ // [get VisibleArea/SoundingZone]
+ const std::list<const RBAArea*>& getVisibleAreas() const override;
+ const std::list<const RBAArea*>& getPreVisibleAreas() const override;
+ const std::list<const RBAZone*>& getSoundingZones() const override;
+ const std::list<const RBAZone*>& getPreSoundingZones() const override;
+
+ // [get Visible/Sounding ContentStates]
+ const std::list<const RBAViewContentState*>& getVisibleContentStates() const override;
+ const std::list<const RBAViewContentState*>& getPreVisibleContentStates() const override;
+ const std::list<const RBASoundContentState*>& getSoundingContentStates() const override;
+ const std::list<const RBASoundContentState*>& getPreSoundingContentStates() const override;
+
+ // [get Active View/Sound ContentStates]
+ const std::list<const RBAViewContentState*>& getActiveViewContentStates() const override;
+ const std::list<const RBAViewContentState*>& getPreActiveViewContentStates() const override;
+ const std::list<const RBASoundContentState*>& getActiveSoundContentStates() const override;
+ const std::list<const RBASoundContentState*>& getPreActiveSoundContentStates() const override;
+
+ // [get Active Scenes]
+ const std::list<const RBAScene*>& getActiveScenes() const override;
+ const std::list<const RBAScene*>& getPreActiveScenes() const override;
+
+ // [get InvisibleAreas/UnsoundingZone]
+ const std::list<const RBAArea*>& getInvisibleAreas() const override;
+ const std::list<const RBAArea*>& getPreInvisibleAreas() const override;
+ const std::list<const RBAZone*>& getUnsoundingZones() const override;
+ const std::list<const RBAZone*>& getPreUnsoundingZones() const override;
+
+ // [get HiddenAreas/MuteZones]
+ const std::list<const RBAArea*>& getHiddenAreas() const override;
+ const std::list<const RBAArea*>& getPreHiddenAreas() const override;
+ const std::list<const RBAZone*>& getMuteZones() const override;
+ const std::list<const RBAZone*>& getPreMuteZones() const override;
+
+ // [get Attenuated]
+ const std::list<const RBAZone*>& getAttenuatedZones() const override;
+ const std::list<const RBAZone*>& getPreAttenuatedZones() const override;
+
+ // [get Canceled Contents]
+ const std::list<const RBAViewContent*>& getCanceledViewContents() const override;
+ const std::list<const RBAViewContent*>& getPreCanceledViewContents() const override;
+ const std::list<const RBASoundContent*>& getCanceledSoundContents() const override;
+ const std::list<const RBASoundContent*>& getPreCanceledSoundContents() const override;
+
+ // [get Standby Contents]
+ const std::list<const RBAViewContent*>& getStandbyViewContents() const override;
+ const std::list<const RBAViewContent*>& getPreStandbyViewContents() const override;
+ const std::list<const RBASoundContent*>& getStandbySoundContents() const override;
+ const std::list<const RBASoundContent*>& getPreStandbySoundContents() const override;
+
+ // [get ContentStates]
+ const RBAViewContentState* getContentState(const RBAArea* area) const override;
+ const RBAViewContentState* getPreContentState(const RBAArea* area) const override;
+ const RBASoundContentState* getContentState(const RBAZone* zone) const override;
+ const RBASoundContentState* getPreContentState(const RBAZone* zone) const override;
+
+ // [get Areas/Zones by ConentState]
+ const std::list<const RBAArea*> getArea(const RBAViewContentState* state) const override;
+ const std::list<const RBAArea*> getPreArea(const RBAViewContentState* state) const override;
+ const std::list<const RBAZone*> getZone(const RBASoundContentState* state) const override;
+ const std::list<const RBAZone*> getPreZone(const RBASoundContentState* state) const override;
+
+ // [get Areas/Zones by Content]
+ const std::list<const RBAArea*> getArea(const RBAViewContent* content) const override;
+ const std::list<const RBAArea*> getPreArea(const RBAViewContent* content) const override;
+ const std::list<const RBAZone*> getZone(const RBASoundContent* content) const override;
+ const std::list<const RBAZone*> getPreZone(const RBASoundContent* content) const override;
+
+ // [get Size]
+ const RBASize* getSize(const RBAArea* area) const override;
+ const RBASize* getPreSize(const RBAArea* area) const override;
+
+ // [check Active Scene]
+ bool isActive(const RBAScene* scene) const override;
+ bool isPreActive(const RBAScene* scene) const override;
+
+ // [check Active Content]
+ bool isActive(const RBAContent* const content) const;
+ bool isPreActive(const RBAContent* const content) const;
+ bool isActive(const RBAViewContent* content) const override;
+ bool isActive(const RBASoundContent* content) const override;
+ bool isPreActive(const RBAViewContent* content) const override;
+ bool isPreActive(const RBASoundContent* content) const override;
+
+ // [check Visible/Sounding Area/Zone]
+ bool isVisible(const RBAArea* area) const override;
+ bool isPreVisible(const RBAArea* area) const override;
+ bool isSounding(const RBAZone* zone) const override;
+ bool isPreSounding(const RBAZone* zone) const override;
+
+ // [check Visible/Sounding ContentState]
+ bool isVisible(const RBAViewContentState* state) const override;
+ bool isPreVisible(const RBAViewContentState* state) const override;
+ bool isSounding(const RBASoundContentState* state) const override;
+ bool isPreSounding(const RBASoundContentState* state) const override;
+
+ // [get View/Sound ContentState]
+ const RBAViewContentState* getViewContentState(const RBAArea* area) const override;
+ virtual const RBAViewContentState* getPreViewContentState(const RBAArea* area) const;
+ const RBASoundContentState* getSoundContentState(const RBAZone* zone) const override;
+ const RBASoundContentState* getPreSoundContentState(const RBAZone* zone) const override;
+
+ // [check Hidden/Mute]
+ bool isHidden(const RBAArea* area) const override;
+ bool isPreHidden(const RBAArea* area) const override;
+ bool isMute(const RBAZone* zone) const override;
+ bool isPreMute(const RBAZone* zone) const override;
+
+ // [check Attenuated]
+ bool isAttenuated(const RBAZone* zone) const override;
+ bool isPreAttenuated(const RBAZone* zone) const override;
+
+ // [check Cancel]
+ bool isCancel(const RBAViewContentState* state) const override;
+ bool isPreCancel(const RBAViewContentState* state) const override;
+ bool isCancel(const RBASoundContentState* state) const override;
+ bool isPreCancel(const RBASoundContentState* state) const override;
+
+ // [common]
+ const std::list<const RBAViewAction*>& getViewActions() const override;
+ RBAResultStatusType getStatusType() const override;
+ bool isLater(const RBAContent* const target,
+ const RBAContent* const comparisonTarget) const;
+
+ std::string getLog() const override;
+ void setLog(const std::string& log);
+
+ bool hasDisplayingArea(const RBADisplay* display) const override;
+
+ bool satisfiesConstraints() const override;
+
+ std::int32_t getSceneProperty(const RBAScene* scene,
+ const std::string& propertyName) const override;
+ //
+ // Internal
+ //
+
+ // Impl [get VisibleArea/SoundingZone]
+ const std::set<const RBAAllocatable*>& getOutputtingAllocatables() const;
+
+ // Impl [get Active View/Sound ContentStates]
+ const std::set<const RBAContentState*>& getActiveContentStates() const;
+
+ // Impl [get ContentStates]
+ const RBAContentState* getContentState(const RBAAllocatable* const allocatable) const;
+ const RBAContentState* getDirectContentState(const RBAAllocatable* const allocatable) const;
+ const RBAContentState* getPreContentState(const RBAAllocatable* const allocatable) const;
+ const RBAContentState* getDirectPreContentState(const RBAAllocatable* const allocatable) const;
+
+ // Impl [get Areas/Zones by ConentState]
+ std::list<const RBAAllocatable*> getAllocatable(const RBAContentState* const state) const;
+
+ // Impl [check Aleady Outputting]
+ bool isAlreadyOutputting(const RBAContentState* const state) const;
+
+ // Impl [set Active Scene]
+ void setActive(const RBAScene* const scene, const bool newActive);
+
+ // Impl [check Active ContentState]
+ bool isActive(const RBAContentState* const state) const;
+ bool isActive(const RBAViewContentState* const state) const;
+ bool isActive(const RBASoundContentState* const state) const;
+ bool isPreActive(const RBAContentState* const state) const;
+ bool isPreActive(const RBAViewContentState* const state) const;
+ bool isPreActive(const RBASoundContentState* const state) const;
+ const RBAContentState* getActiveState(const RBAContent* const content) const;
+ const RBAContentState* getPreActiveState(const RBAContent* const content) const;
+
+ // Impl [set Active ContentState]
+ void setActive(const RBAContentState* const state, const bool newActive);
+
+ // Impl [add Standby Content]
+ void addStandbyContent(const RBAContent* const content);
+
+ // Impl [check Visible/Sounding Alloc ContentState]
+ bool isOutputting(const RBAAllocatable* const alloc) const;
+ bool isPreOutputting(const RBAAllocatable* const alloc) const;
+ bool isOutputting(const RBAContentState* const state) const;
+ bool isPreOutputting(const RBAContentState* const state) const;
+
+ // Impl [get View/Sound ContentState by Allocatable]
+ const RBAContentState* getAllocatedContentState(const RBAAllocatable* const allocatable) const;
+ const RBAContentState* getPreAllocatedContentState(const RBAAllocatable* const allocatable) const;
+
+ // Impl [set View/Sound ContentState]
+ void setContentState(const RBAAllocatable* const allocatable, const RBAContentState* const state);
+
+ // Impl [check Hidden/Mute Area/Zone]
+ bool isHidden(const RBAAllocatable* const allocatable) const;
+ bool isPreHidden(const RBAAllocatable* const allocatable) const;
+
+ // Impl [set Cancel ContentState]
+ void setCancel(const RBAContentState* const state, const bool checked);
+
+ // Impl [check Cancel ContentState]
+ bool isCancel(const RBAContentState* const state) const;
+ bool isPreCancel(const RBAContentState* const state) const;
+
+ // Impl [add Visible/Sounding ContentState]
+ void addOutputtingContentState(const RBAContentState* const state);
+
+ // Impl [cancel ContentState]
+ void cancelContentState(const RBAContentState* const state);
+
+ // Impl [common]
+ std::unique_ptr<RBAResultSet> createBackupCurrentResultSet();
+ std::unique_ptr<RBAResultSet> createNextCurrentResultSet();
+ void addViewAction(std::unique_ptr<RBAViewAction>& newViewAction);
+ void setStatusType(const RBAResultStatusType newStatusType);
+ void updateActiveContentStates();
+ void setSceneProperty(const RBASceneImpl* const scene,
+ const std::string& propertyName,
+ const std::int32_t value);
+ void setSceneProperty(const RBAAbstractProperty* const property,
+ const std::int32_t value);
+ std::int32_t getSceneProperty(const RBAAbstractProperty* const property) const;
+ std::int32_t getPreSceneProperty(const RBAAbstractProperty* const property) const;
+ void setContentOfEventProcessing(const RBAEventProcessing* const eventProcessing,
+ const RBAContent* const viewContent);
+ std::unique_ptr<RBAResultSet>& getCurResultSet();
+ std::unique_ptr<RBAResultSet>& getPreResultSet();
+ RBAContentStatusType getStatusType(const RBAContent* const content) const;
+ bool isStandby(const RBAContent* const content) const;
+ bool hasBeenCanceled(const RBAContent* const content) const;
+ bool hasBeenPreCanceled(const RBAContent* const content) const;
+ bool hasBeenDisplayed(const RBAContent* const content) const;
+ bool hasBeenPreDisplayed(const RBAContent* const content) const;
+
+ /// @brief Update status of Content
+ /// @details Update the status based on the request status,
+ /// output status, and status at the time of request of the content
+ /// @param[in] content Content to be updated
+ void updateStatus(const RBAContent* const content);
+
+ std::unordered_map<const RBAContent*, RBAContentStatus>* getCurStatus() const;
+ std::set<const RBASceneImpl*>& getDifferentConditionScenes() const;
+#ifdef RBA_USE_LOG
+ void addFailedConstraint(const RBAConstraint* constraint);
+ const std::list<const RBAConstraint*>& getFailedConstraints() const;
+#endif
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::unique_ptr<RBAResultSet> curResultSet_;
+ std::unique_ptr<RBAResultSet> preResultSet_;
+ mutable std::list<std::unique_ptr<RBAViewAction>> viewActions_;
+ mutable std::list<const RBAViewAction*> viewActionsForPublicUse_;
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ const RBAArbitrator* arb_;
+ RBAResultStatusType statusType_;
+ std::string log_;
+
+};
+
+}
+
+#endif
diff --git a/src/core/logic/RBAResultSet.cpp b/src/core/logic/RBAResultSet.cpp
new file mode 100644
index 0000000..bcc9892
--- /dev/null
+++ b/src/core/logic/RBAResultSet.cpp
@@ -0,0 +1,996 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ResultSet (set arbitration result) class
+ */
+
+#include <algorithm>
+#include <unordered_map>
+#include "RBAResultSet.hpp"
+
+#include "RBAContentStatusType.hpp"
+#include "RBAAreaImpl.hpp"
+#include "RBAViewContentImpl.hpp"
+#include "RBAViewContentState.hpp"
+#include "RBASizeImpl.hpp"
+#include "RBAZone.hpp"
+#include "RBAZoneImpl.hpp"
+#include "RBASoundContent.hpp"
+#include "RBASoundContentState.hpp"
+#include "RBASceneImpl.hpp"
+#include "RBAContentState.hpp"
+#include "RBAContent.hpp"
+#include "RBAAbstractAllocatable.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAConstraint.hpp"
+#include "RBADisplay.hpp"
+#include "RBAAbstractProperty.hpp"
+
+namespace rba {
+
+RBAResultSet::RBAResultSet(const RBAResultSet& resultSet)
+ : outputtingAllocs_{resultSet.outputtingAllocs_}
+ , hiddenAllocs_{resultSet.hiddenAllocs_}
+ , activeContentStates_{resultSet.activeContentStates_}
+ , canceledContentStates_{resultSet.canceledContentStates_}
+ , allocToContentState_{resultSet.allocToContentState_}
+ , visibleAreas_{resultSet.visibleAreas_}
+ , soundingZones_{resultSet.soundingZones_}
+ , invisibleAreas_{resultSet.invisibleAreas_}
+ , unsoundingZones_{resultSet.unsoundingZones_}
+ , hiddenAreas_{resultSet.hiddenAreas_}
+ , muteZones_{resultSet.muteZones_}
+ , attenuatedZones_{resultSet.attenuatedZones_}
+ , canceledViewContents_{resultSet.canceledViewContents_}
+ , canceledSoundContents_{resultSet.canceledSoundContents_}
+ , standbyViewContents_{resultSet.standbyViewContents_}
+ , standbySoundContents_{resultSet.standbySoundContents_}
+ , visibleContentStates_{resultSet.visibleContentStates_}
+ , soundingContentStates_{resultSet.soundingContentStates_}
+ , activeViewContentStates_{resultSet.activeViewContentStates_}
+ , activeSoundContentStates_{resultSet.activeSoundContentStates_}
+ , requestOrderView_{resultSet.requestOrderView_}
+ , requestOrderSound_{resultSet.requestOrderSound_}
+ , activeScenes_{resultSet.activeScenes_}
+ , propertyMap_{resultSet.propertyMap_}
+ , event_content_{resultSet.event_content_}
+ , contentToStatus_{resultSet.contentToStatus_}
+ , requestContentStateMap_{resultSet.requestContentStateMap_}
+#ifdef RBA_USE_LOG
+ , failedConstraints_{resultSet.failedConstraints_}
+#endif
+{
+}
+
+// Impl [get VisibleArea/SoundingZone]
+
+const std::set<const RBAAllocatable*>&
+RBAResultSet::getOutputtingAllocatables() const
+{
+ return outputtingAllocs_;
+}
+
+const std::list<const RBAArea*>&
+RBAResultSet::getVisibleAreas() const
+{
+ return visibleAreas_;
+}
+
+const std::list<const RBAZone*>&
+RBAResultSet::getSoundingZones() const
+{
+ return soundingZones_;
+}
+
+// Impl [get Visible/Sounding ContentStates]
+
+const std::list<const RBAViewContentState*>&
+RBAResultSet::getVisibleContentStates() const
+{
+ return visibleContentStates_;
+}
+
+const std::list<const RBASoundContentState*>&
+RBAResultSet::getSoundingContentStates() const
+{
+ return soundingContentStates_;
+}
+
+// Impl [get Active View/Sound ContentStates]
+
+const std::set<const RBAContentState*>&
+RBAResultSet::getActiveContentStates() const
+{
+ return activeContentStates_;
+}
+
+const std::list<const RBAViewContentState*>&
+RBAResultSet::getActiveViewContentStates() const
+{
+ return activeViewContentStates_;
+}
+
+const std::list<const RBASoundContentState*>&
+RBAResultSet::getActiveSoundContentStates() const
+{
+ return activeSoundContentStates_;
+}
+
+// Impl [get Active Scenes]
+
+const std::list<const RBAScene*>&
+RBAResultSet::getActiveScenes() const
+{
+ return activeScenes_;
+}
+
+// Impl [get InvisibleAreas/UnsoundingZone]
+
+const std::list<const RBAArea*>&
+RBAResultSet::getInvisibleAreas() const
+{
+ return invisibleAreas_;
+}
+
+const std::list<const RBAZone*>&
+RBAResultSet::getUnsoundingZones() const
+{
+ return unsoundingZones_;
+}
+
+// Impl [get HiddenAreas/MuteZones]
+
+const std::list<const RBAArea*>&
+RBAResultSet::getHiddenAreas() const
+{
+ return hiddenAreas_;
+}
+
+const std::list<const RBAZone*>&
+RBAResultSet::getMuteZones() const
+{
+ return muteZones_;
+}
+
+// Impl [get Attenuated]
+const std::list<const RBAZone*>&
+RBAResultSet::getAttenuatedZones() const
+{
+ return attenuatedZones_;
+}
+
+// Impl [get Canceled Contents]
+
+const std::list<const RBAViewContent*>&
+RBAResultSet::getCanceledViewContents() const
+{
+ return canceledViewContents_;
+}
+
+const std::list<const RBASoundContent*>&
+RBAResultSet::getCanceledSoundContents() const
+{
+ return canceledSoundContents_;
+}
+
+// Impl [get Standby Contents]
+
+const std::list<const RBAViewContent*>&
+RBAResultSet::getStandbyViewContents() const
+{
+ return standbyViewContents_;
+}
+
+const std::list<const RBASoundContent*>&
+RBAResultSet::getStandbySoundContents() const
+{
+ return standbySoundContents_;
+}
+
+// Impl [get ContentStates]
+
+const RBAContentState*
+RBAResultSet::getContentState(const RBAAllocatable* const alloc) const
+{
+ if(alloc != nullptr) {
+ auto it = allocToContentState_.find(alloc);
+ if(it != allocToContentState_.end()) {
+ auto state = it->second;
+ // If the content(state) assigned to the "alloc" has the
+ // allocatable function (such as cyclic), the contentState assigned to it
+ // is the contentState assigned to the "alloc".
+ // Search this until it is not allocatable content.
+ while ((state != nullptr)
+ && (dynamic_cast<RBAAllocatable*>(state->getOwner()) != nullptr)) {
+ it = allocToContentState_.find(dynamic_cast<RBAAllocatable*>(state->getOwner()));
+ state = it->second;
+ }
+ return state;
+ }
+ }
+ return nullptr;
+}
+
+const RBAContentState*
+RBAResultSet::getDirectContentState(const RBAAllocatable* const alloc) const
+{
+ if(alloc != nullptr) {
+ auto it = allocToContentState_.find(alloc);
+ if(it != allocToContentState_.end()) {
+ return it->second;
+ }
+ }
+ return nullptr;
+}
+
+// Impl [get Areas/Zones by ConentState]
+
+void
+RBAResultSet::getAlloc(const RBAContentState* const state,
+ std::list<const RBAAllocatable*>& allocList) const
+{
+ if(state != nullptr) {
+ for(const auto& it : allocToContentState_) {
+ if(it.second == state) {
+ allocList.push_back(it.first);
+ }
+ }
+ }
+}
+
+void
+RBAResultSet::getArea(const RBAViewContentState* const state,
+ std::list<const RBAArea*>& areaList) const
+{
+ if(state != nullptr) {
+ for(const auto& it : allocToContentState_) {
+ if(dynamic_cast<const RBAViewContentState*>(it.second) == state) {
+ const RBAContent* const content {dynamic_cast<const RBAContent*>(it.first)};
+ if (content != nullptr) { // In case of CyclicContent
+ // Get ViewContentState assigned to CyclicContent
+ const RBAViewContentState* const ownerState
+ {dynamic_cast<const RBAViewContentState*>(getReqestState(content))};
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // calling getArea() recursively
+ //  [Reason that there is no problem if the rule is deviated]
+ // When getArea() is performed on CyclicContent, at that time,
+ // respond Area where ViewContent assigned to CyclicContent
+ // is assigned. When CyclicContent is assigned to CyclicContent,
+ // multiple recursive calls may be made, but the rule model
+ // definition is finite.
+ // Therefore, stack overflow will not be occured, no problem.
+ getArea(ownerState, areaList);
+ } else {
+ areaList.push_back(dynamic_cast<const RBAArea*>(it.first));
+ }
+ }
+ }
+ }
+}
+
+void
+RBAResultSet::getZone(const RBASoundContentState* const state,
+ std::list<const RBAZone*>& zoneList) const
+{
+ if(state != nullptr) {
+ for(const auto& it : allocToContentState_) {
+ if (dynamic_cast<const RBASoundContentState*>(it.second) == state) {
+ const RBAContent* const content {dynamic_cast<const RBAContent*>(it.first)};
+ if (content != nullptr) {
+ const RBASoundContentState* const ownerState
+ {dynamic_cast<const RBASoundContentState*>(getReqestState(content))};
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // Function '::rba::RBAResultSet::getZone=(_,
+ // p={c::rba::RBASoundContentState},
+ // &{c::std::__cxx11::list<p={c::rba::RBAZone},
+ // {c::std::allocator<p={c::rba::RBAZone}>}>})'
+ // is recursive.
+ //  [Reason that there is no problem if the rule is deviated]
+ // Recursive call is required as a feature
+ getZone(ownerState, zoneList);
+ } else {
+ zoneList.push_back(dynamic_cast<const RBAZone*>(it.first));
+ }
+ }
+ }
+ }
+}
+
+// Impl [get Areas/Zones by Content]
+
+void
+RBAResultSet::getArea(const RBAViewContent* const content,
+ std::list<const RBAArea*>& areaList) const
+{
+ if(content != nullptr) {
+ for(auto& state : content->getContentStates()) {
+ getArea(state, areaList);
+ if(!areaList.empty()) {
+ break;
+ }
+ }
+ }
+}
+
+void
+RBAResultSet::getZone(const RBASoundContent* const content,
+ std::list<const RBAZone*>& zoneList) const
+{
+ if(content != nullptr) {
+ for(auto& state : content->getContentStates()) {
+ getZone(state, zoneList);
+ if(!zoneList.empty()) {
+ break;
+ }
+ }
+ }
+}
+
+// Impl [get Size]
+
+const RBASize*
+RBAResultSet::getSize(const RBAArea* const area) const
+{
+ if(area == nullptr) {
+ return nullptr;
+ }
+ const RBAAreaImpl* const areaImpl {dynamic_cast<const RBAAreaImpl*>(area)};
+ auto it = allocToContentState_.find(areaImpl);
+ if(it == allocToContentState_.end() || (it->second == nullptr)) {
+ return nullptr;
+ }
+ const RBAContent* const content {dynamic_cast<RBAContent*>(it->second->getOwner())};
+ const RBASize* backupAreaSize {nullptr};
+ std::int32_t backupDiffVal {-1};
+ for(auto& areaSize : areaImpl->getSizes()) {
+ const RBASizeImpl* const areaSizeImpl {dynamic_cast<const RBASizeImpl*>(areaSize)};
+ for(auto& contentSize : content->getSizes()) {
+ const RBASizeImpl* const contentSizeImpl {dynamic_cast<const RBASizeImpl*>(contentSize)};
+ const auto diffVal = areaSizeImpl->diff(contentSizeImpl);
+ if(diffVal == 0) {
+ return areaSizeImpl;
+ }
+ else if((backupDiffVal < 0) || (backupDiffVal > diffVal)) {
+ backupAreaSize = areaSizeImpl;
+ backupDiffVal = diffVal;
+ } else {
+ ;
+ }
+ }
+ }
+
+ return backupAreaSize;
+}
+
+// Impl [check Active Scene]
+
+bool
+RBAResultSet::isActive(const RBAScene* const scene) const
+{
+ return (std::find(activeScenes_.begin(), activeScenes_.end(), scene)
+ != activeScenes_.end());
+}
+
+// Impl [check Active ContentState]
+bool
+RBAResultSet::isActive(const RBAContent* const content) const
+{
+ if (contentToStatus_.find(content) != contentToStatus_.end()) {
+ return contentToStatus_[content].isActive();
+ }
+ return false;
+}
+
+bool
+RBAResultSet::isActive(const RBAContentState* const state) const
+{
+ const RBAContent* const content {dynamic_cast<RBAContent*>(state->getOwner())};
+ return (isActive(content) && (getReqestState(content) == state));
+}
+
+const RBAContentState*
+RBAResultSet::getReqestState(const RBAContent* const content) const
+{
+ if (requestContentStateMap_.find(content) != requestContentStateMap_.end()) {
+ return requestContentStateMap_[content];
+ }
+ return nullptr;
+}
+
+// Impl [check Outputting Allocatable]
+
+bool
+RBAResultSet::isOutputting(const RBAAllocatable* const alloc) const
+{
+ return outputtingAllocs_.find(alloc) != outputtingAllocs_.end();
+}
+
+// Impl [check Outputting ContentState]
+
+bool
+RBAResultSet::isOutputting(const RBAContentState* const state) const
+{
+ std::list<const RBAAllocatable*> allocList;
+ getAlloc(state, allocList);
+ for(auto& alloc : allocList) {
+ if(isOutputting(alloc)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+// Impl [check Hidden/Mute Area/Zone]
+
+bool
+RBAResultSet::isHidden(const RBAAllocatable* const alloc) const
+{
+ return hiddenAllocs_.find(alloc) != hiddenAllocs_.end();
+}
+
+// Impl [check Attenuated Zone]
+
+bool
+RBAResultSet::isAttenuated(const RBAZone* const zone) const
+{
+ return std::find(attenuatedZones_.begin(), attenuatedZones_.end(), zone) != attenuatedZones_.end();
+}
+
+// Impl [check Cancel ContentState]
+
+bool
+RBAResultSet::isCancel(const RBAContentState* const state) const
+{
+ return canceledContentStates_.find(state) != canceledContentStates_.end();
+}
+
+// Impl [check Aleady OutPutting]
+
+bool
+RBAResultSet::isAlreadyOutputting(const RBAContentState* const state) const
+{
+ const auto content = dynamic_cast<const RBAContent*>(state->getOwner());
+ for(auto& alloc : content->getAllocatables()) {
+ if((getContentState(alloc) == state) && !alloc->isHidden()) {
+ return true;
+ }
+ }
+ return false;
+}
+
+// Impl [set Active Scene]
+
+/**
+ * @brief Set display request or display withdrawal request, for Scene
+ * @param scene Scene
+ * @param newActive true: display request, false: display withdrawal request
+ */
+void
+RBAResultSet::setActive(const RBAScene* const scene, const bool newActive)
+{
+ const auto it = std::find(activeScenes_.begin(), activeScenes_.end(), scene);
+ if(it == activeScenes_.end()) {
+ if(newActive) {
+ activeScenes_.push_back(scene);
+ }
+ }
+ else {
+ if(!newActive) {
+ static_cast<void>(activeScenes_.erase(it));
+ }
+ }
+}
+
+// Impl [set Active ContentState]
+
+/**
+ * @brief Set display request or display withdrawal request, for Content state
+ * @details If the content has already been registered,
+ delete the registered content.
+ * @param contentState Content state
+ * @param newActive true: display request, false: display withdrawal request
+ */
+void
+RBAResultSet::setActive(const RBAContentState* const state, const bool newActive)
+{
+ updateRequestStatus(dynamic_cast<RBAContent*>(state->getOwner()), newActive);
+
+ // Check if Content is already active
+ const RBAContentState* temp {nullptr};
+ for(auto& cs : activeContentStates_) {
+ if(cs->getOwner() == state->getOwner()) {
+ temp = cs;
+ break;
+ }
+ }
+ // Delete if Content is active
+ if (temp != nullptr) {
+ setOrder(temp, 0);
+ static_cast<void>(activeContentStates_.erase(temp));
+ if (temp->isViewContentState()) {
+ activeViewContentStates_.remove(dynamic_cast<const RBAViewContentState*>(temp));
+ } else {
+ activeSoundContentStates_.remove(dynamic_cast<const RBASoundContentState*>(temp));
+ }
+ }
+
+ // Rgistre active
+ if(newActive) {
+ requestContentStateMap_[dynamic_cast<const RBAContent*>(state->getOwner())] = state;
+ static_cast<void>(activeContentStates_.insert(state));
+ if (state->isViewContentState()) {
+ setOrder(state, requestOrderView_);
+ requestOrderView_++;
+ activeViewContentStates_.push_back(dynamic_cast<const RBAViewContentState*>(state));
+ } else {
+ setOrder(state, requestOrderSound_);
+ requestOrderSound_++;
+ activeSoundContentStates_.push_back(dynamic_cast<const RBASoundContentState*>(state));
+ }
+ }
+ else {
+ setOrder(state, 0);
+ static_cast<void>(requestContentStateMap_.erase(dynamic_cast<const RBAContent*>(state->getOwner())));
+ }
+}
+
+// [cancel ContentState]
+
+void
+RBAResultSet::cancelContentState(const RBAContentState* const state)
+{
+ setOrder(state, 0);
+ if (state->isViewContentState()) {
+ canceledViewContents_.push_back(dynamic_cast<const RBAViewContent*>(state->getOwner()));
+ } else {
+ canceledSoundContents_.push_back(dynamic_cast<const RBASoundContent*>(state->getOwner()));
+ }
+}
+
+// Impl [set Cancel ContentState]
+
+void
+RBAResultSet::setCancel(const RBAContentState* const state, const bool checked)
+{
+ if(checked) {
+ static_cast<void>(canceledContentStates_.insert(state));
+ }
+ else {
+ static_cast<void>(canceledContentStates_.erase(state));
+ }
+}
+
+// Impl [set ContentState]
+
+void
+RBAResultSet::setContentState(const RBAAllocatable* const alloc, const RBAContentState* const state)
+{
+ //alloc
+ allocToContentState_[alloc] = state;
+ const bool isHiddenRes {alloc->isHidden()};
+ const bool existsState {(state != nullptr)};
+ const RBAAreaImpl* area {dynamic_cast<const RBAAreaImpl*>(alloc)};
+ const RBAZoneImpl* zone {dynamic_cast<const RBAZoneImpl*>(alloc)};
+
+ if (isHiddenRes) {
+ static_cast<void>(hiddenAllocs_.insert(alloc));
+ } else {
+ // Currently, there is no case to delete the Allocable stored in
+ // hiddenAllocs_. In the future, since hiding may be forcibly released,
+ // implement it.
+ static_cast<void>(hiddenAllocs_.erase(alloc));
+ }
+
+ if (!isHiddenRes && existsState) {
+ if (alloc->isArea() || alloc->isZone()) {
+ static_cast<void>(outputtingAllocs_.insert(alloc));
+ }
+ if (isOutputting(alloc)) {
+ const RBAContentState* s {state};
+ while ((s != nullptr) && (dynamic_cast<RBAAllocatable*>(s->getOwner()) != nullptr)) {
+ RBAAllocatable* extAlloc {dynamic_cast<RBAAllocatable*>(s->getOwner())};
+ static_cast<void>(outputtingAllocs_.insert(extAlloc));
+ s = extAlloc->getState();
+ }
+ }
+
+ if (alloc->isArea()) {
+ if (std::find(visibleAreas_.begin(), visibleAreas_.end(), area) == visibleAreas_.end()) {
+ visibleAreas_.push_back(area);
+ }
+ invisibleAreas_.remove(area);
+ } else if (alloc->isZone()) {
+ if (std::find(soundingZones_.begin(), soundingZones_.end(), zone) == soundingZones_.end()) {
+ soundingZones_.push_back(zone);
+ }
+ unsoundingZones_.remove(zone);
+ } else {
+ ;
+ }
+ } else {
+ static_cast<void>(outputtingAllocs_.erase(alloc));
+ if (alloc->isArea()) {
+ // Currently, there is no case to delete the Area stored in visibleAreas_.
+ // In the future, it may happen that content allocation is
+ // forcibly released, so implement thes.
+ visibleAreas_.remove(area);
+ if (std::find(invisibleAreas_.begin(), invisibleAreas_.end(), area) == invisibleAreas_.end()) {
+ invisibleAreas_.push_back(area);
+ }
+ } else if (alloc->isZone()) {
+ // Currently, there is no case to delete the Area stored in soundingZones_.
+ // In the future, it may happen that content allocation is
+ // forcibly released, so implement thes.
+ soundingZones_.remove(zone);
+ if (std::find(unsoundingZones_.begin(), unsoundingZones_.end(), zone) == unsoundingZones_.end()) {
+ unsoundingZones_.push_back(zone);
+ }
+ } else {
+ ;
+ }
+ }
+
+ if (isHiddenRes && existsState) {
+ if (alloc->isArea()) {
+ if (std::find(hiddenAreas_.begin(), hiddenAreas_.end(), area) == hiddenAreas_.end()) {
+ hiddenAreas_.push_back(area);
+ }
+ } else if (alloc->isZone()) {
+ if (std::find(muteZones_.begin(), muteZones_.end(), zone) == muteZones_.end()) {
+ muteZones_.push_back(zone);
+ }
+ } else {
+ ;
+ }
+ } else {
+ if (alloc->isArea()) {
+ hiddenAreas_.remove(area);
+ } else if (alloc->isZone()) {
+ muteZones_.remove(zone);
+ } else {
+ ;
+ }
+ }
+
+ if (alloc->isZone()) {
+ if (existsState && !isHiddenRes && zone->isAttenuated()) {
+ if (std::find(attenuatedZones_.begin(), attenuatedZones_.end(), zone) == attenuatedZones_.end()) {
+ attenuatedZones_.push_back(zone);
+ }
+ } else {
+ // Currently, there is no case to delete the Allocatable stored in
+ // attenuatedZones_. In the future, there may be cases in which
+ // "attenuation" is forcibly canceled, so implement this.
+ attenuatedZones_.remove(zone);
+ }
+ }
+}
+
+// Impl [add Visible/Sounding ContentState]
+
+void
+RBAResultSet::addOutputtingContentState(const RBAContentState* const state)
+{
+ if (state->isViewContentState()) {
+ visibleContentStates_.push_back(dynamic_cast<const RBAViewContentState*>(state));
+ }
+ else if (state->isSoundContentState()) {
+ soundingContentStates_.push_back(dynamic_cast<const RBASoundContentState*>(state));
+ }
+ else {
+ ;
+ }
+}
+
+// Impl [add Standby Content]
+
+void
+RBAResultSet::addStandbyContent(const RBAContent* const content)
+{
+ if (content->isViewContent()) {
+ standbyViewContents_.push_back(dynamic_cast<const RBAViewContent*>(content));
+ }
+ else if (content->isSoundContent()) {
+ standbySoundContents_.push_back(dynamic_cast<const RBASoundContent*>(content));
+ }
+ else {
+ ;
+ }
+}
+
+// [activeView]
+
+void
+RBAResultSet::copyActives(const std::unique_ptr<RBAResultSet>& resultSet)
+{
+ activeContentStates_ = resultSet->activeContentStates_;
+ activeViewContentStates_ = resultSet->activeViewContentStates_;
+ activeSoundContentStates_ = resultSet->activeSoundContentStates_;
+ activeScenes_ = resultSet->activeScenes_;
+ contentToStatus_ = resultSet->contentToStatus_;
+ requestContentStateMap_ = resultSet->requestContentStateMap_;
+
+ // Reset order
+ requestOrderView_ = 1;
+ requestOrderSound_ = 1;
+ for(const RBAViewContentState* const viewState : activeViewContentStates_) {
+ setOrder(dynamic_cast<const RBAContentState*>(viewState), requestOrderView_);
+ requestOrderView_++;
+ }
+ for(const RBASoundContentState* const soundState : activeSoundContentStates_) {
+ setOrder(dynamic_cast<const RBAContentState*>(soundState), requestOrderSound_);
+ requestOrderSound_++;
+ }
+}
+
+void
+RBAResultSet::updateActiveContentStates()
+{
+ for (auto& state : canceledContentStates_) {
+ static_cast<void>(activeContentStates_.erase(state));
+ if (state->isViewContentState()) {
+ activeViewContentStates_.remove(dynamic_cast<const RBAViewContentState*>(state));
+ } else {
+ activeSoundContentStates_.remove(dynamic_cast<const RBASoundContentState*>(state));
+ }
+ }
+}
+
+void
+RBAResultSet::copyProperties(const std::unique_ptr<RBAResultSet>& resultSet)
+{
+ propertyMap_ = resultSet->propertyMap_;
+}
+
+void
+RBAResultSet::setSceneProperty(const RBAScene* const scene,
+ const std::string& propertyName,
+ const std::int32_t value)
+{
+ propertyMap_[dynamic_cast<const RBASceneImpl*>(scene)->getProperty(propertyName)] = value;
+}
+
+void
+RBAResultSet::setSceneProperty(const RBAAbstractProperty* const property,
+ const std::int32_t value)
+{
+ propertyMap_[property] = value;
+}
+
+std::int32_t
+RBAResultSet::getSceneProperty(const RBAAbstractProperty* const property) const
+{
+ auto it = propertyMap_.find(property);
+ if(it == propertyMap_.end()) {
+ // Property not registered
+ return -99;
+ }
+
+ return it->second;
+}
+
+void
+RBAResultSet::setContentOfEventProcessing(const RBAEventProcessing* const eventProcessing,
+ const RBAContent* const content)
+{
+ event_content_[eventProcessing] = content;
+}
+
+const RBAContent*
+RBAResultSet::getContentOfEventProcessing(const RBAEventProcessing* const eventProcessing) const
+{
+ if (event_content_.find(eventProcessing) != event_content_.end()) {
+ return event_content_.at(eventProcessing);
+ }
+ return nullptr;
+}
+
+bool
+RBAResultSet::hasDisplayingArea(const RBADisplay* const display) const
+{
+ bool displayed {false};
+ const std::list<const RBAArea*> areas {display->getAreas()};
+ const auto areasBegin = areas.begin();
+ const auto areasEnd = areas.end();
+ for(const RBAArea* const area : visibleAreas_) {
+ if (std::find(areasBegin, areasEnd, area) != areasEnd) {
+ displayed = true;
+ break;
+ }
+ }
+ return displayed;
+}
+
+bool
+RBAResultSet::isLater(const RBAContent* const target,
+ const RBAContent* const comparisonTarget) const
+{
+ bool isLaterRes {false};
+ bool isBreak {false};
+
+ if (target->isViewContent()) {
+ const RBAViewContent* const targetContent {
+ dynamic_cast<const RBAViewContent*>(target)};
+ const RBAViewContent* const comparisonTargetContent {
+ dynamic_cast<const RBAViewContent*>(comparisonTarget)};
+ for (auto it = activeViewContentStates_.rbegin();
+ (it != activeViewContentStates_.rend()) && (!isBreak) ; it++) {
+ if ((*it)->getOwner() == targetContent) {
+ isLaterRes = true;
+ isBreak = true;
+ } else if ((*it)->getOwner() == comparisonTargetContent) {
+ isBreak = true;
+ } else {
+ ;
+ }
+ }
+ } else {
+ const RBASoundContent* const targetContent {
+ dynamic_cast<const RBASoundContent*>(target)};
+ const RBASoundContent* const comparisonTargetContent {
+ dynamic_cast<const RBASoundContent*>(comparisonTarget)};
+ for (auto it = activeSoundContentStates_.rbegin();
+ (it != activeSoundContentStates_.rend()) && (!isBreak); it++) {
+ if ((*it)->getOwner() == targetContent) {
+ isLaterRes = true;
+ isBreak = true;
+ } else if ((*it)->getOwner() == comparisonTargetContent) {
+ isBreak = true;
+ } else {
+ ;
+ }
+ }
+ }
+ return isLaterRes;
+}
+
+std::set<const RBASceneImpl*>&
+RBAResultSet::getDifferentConditionScenes(const RBAResultSet& target)
+{
+ // Detect the difference from the target scene On state
+ const std::list<const RBAScene*> targetScenes {target.getActiveScenes()};
+ for (auto& s : activeScenes_) {
+ if (std::find(targetScenes.begin(), targetScenes.end(), s)
+ == targetScenes.end()) {
+ static_cast<void>(differentConditionScenes_.insert(dynamic_cast<const RBASceneImpl*>(s)));
+ }
+ }
+ for (auto& s : targetScenes) {
+ if (std::find(activeScenes_.begin(), activeScenes_.end(), s)
+ == activeScenes_.end()) {
+ static_cast<void>(differentConditionScenes_.insert(dynamic_cast<const RBASceneImpl*>(s)));
+ }
+ }
+
+ // Detect the difference from the target scene property state
+ for (auto& p : propertyMap_) {
+ if (target.getSceneProperty(p.first) != p.second) {
+ static_cast<void>(differentConditionScenes_.insert(p.first->getScene()));
+ }
+ }
+ for (auto& p : target.getScenePropertyMap()) {
+ if (getSceneProperty(p.first) != p.second) {
+ static_cast<void>(differentConditionScenes_.insert(p.first->getScene()));
+ }
+ }
+ return differentConditionScenes_;
+}
+
+void
+RBAResultSet::updateRequestStatus(const RBAContent* const content, const bool isOnRequest)
+{
+ if (isOnRequest) {
+ contentToStatus_[content].onRequest();
+ } else {
+ // When a content "off request" comes in, turn off the content request
+ // even if the requested state is different from Active state at that time.
+ static_cast<void>(contentToStatus_.erase(content));
+ }
+}
+
+void
+RBAResultSet::setStatusType(const RBAContent* const content, const RBAContentStatusType type)
+{
+ contentToStatus_[content].setStatusType(type);
+}
+
+RBAContentStatusType
+RBAResultSet::getStatusType(const RBAContent* const content) const
+{
+ if (contentToStatus_.find(content) != contentToStatus_.end()) {
+ return contentToStatus_[content].getStatusType();
+ }else {
+ return RBAContentStatusType::NoRequest;
+ }
+}
+
+bool
+RBAResultSet::isOutput(const RBAContent* const content) const
+{
+ if (contentToStatus_.find(content) != contentToStatus_.end()) {
+ return contentToStatus_[content].isDisplayed();
+ } else {
+ return false;
+ }
+}
+
+bool
+RBAResultSet::isStandby(const RBAContent* const content) const
+{
+ if (contentToStatus_.find(content)
+ != contentToStatus_.end()) {
+ return contentToStatus_[content].isStandby();
+ } else {
+ return false;
+ }
+}
+
+bool
+RBAResultSet::hasBeenCanceled(const RBAContent* const content) const
+{
+ if (contentToStatus_.find(content) != contentToStatus_.end()) {
+ return contentToStatus_[content].hasBeenCanceled();
+ } else {
+ return false;
+ }
+}
+
+bool
+RBAResultSet::hasBeenDisplayed(const RBAContent* const content) const
+{
+ if (contentToStatus_.find(content) != contentToStatus_.end()) {
+ return contentToStatus_[content].hasBeenDisplayed();
+ } else {
+ return false;
+ }
+}
+
+std::unordered_map<const RBAContent*, RBAContentStatus>*
+RBAResultSet::getStatus() const
+{
+ return &contentToStatus_;
+}
+
+#ifdef RBA_USE_LOG
+void
+RBAResultSet::addFailedConstraint(const RBAConstraint* constraint)
+{
+ failedConstraints_.push_back(constraint);
+}
+
+const std::list<const RBAConstraint*>&
+RBAResultSet::getFailedConstraints()
+{
+ return failedConstraints_;
+}
+#endif
+
+const std::unordered_map<const RBAAbstractProperty*, std::int32_t>&
+RBAResultSet::getScenePropertyMap() const
+{
+ return propertyMap_;
+}
+
+void
+RBAResultSet::setOrder(const RBAContentState* const state, const std::int32_t newOrder) const
+{
+ const_cast<RBAContentState*>(state)->setOrder(newOrder);
+}
+
+}
diff --git a/src/core/logic/RBAResultSet.hpp b/src/core/logic/RBAResultSet.hpp
new file mode 100644
index 0000000..3aca4e9
--- /dev/null
+++ b/src/core/logic/RBAResultSet.hpp
@@ -0,0 +1,246 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ResultSet (set arbitration result) class header
+ */
+
+#ifndef RBARESULTSET_HPP
+#define RBARESULTSET_HPP
+
+#include <cstdint>
+#include <list>
+#include <memory>
+#include <set>
+#include <unordered_map>
+#include <mutex>
+
+#include "RBAContentStatusType.hpp"
+#include "RBAContentStatus.hpp"
+
+namespace rba
+{
+
+class RBADisplay;
+class RBASize;
+class RBAAllocatable;
+class RBAArea;
+class RBAZone;
+class RBAContent;
+class RBAViewContent;
+class RBASoundContent;
+class RBAContentState;
+class RBAViewContentState;
+class RBASoundContentState;
+class RBAScene;
+class RBASceneImpl;
+class RBAAbstractProperty;
+class RBAEventProcessing;
+class RBAConstraint;
+
+class RBAResultSet
+{
+public:
+ RBAResultSet()=default;
+ RBAResultSet(const RBAResultSet& resultSet);
+ RBAResultSet(const RBAResultSet&&)=delete;
+ RBAResultSet& operator=(const RBAResultSet&)=delete;
+ RBAResultSet& operator=(const RBAResultSet&&)=delete;
+ virtual ~RBAResultSet()=default;
+
+public:
+ // Impl [get VisibleArea/SoundingZone]
+ const std::set<const RBAAllocatable*>& getOutputtingAllocatables() const;
+ const std::list<const RBAArea*>& getVisibleAreas() const;
+ const std::list<const RBAZone*>& getSoundingZones() const;
+
+ // Impl [get Visible/Sounding ContentStates]
+ const std::list<const RBAViewContentState*>& getVisibleContentStates() const;
+ const std::list<const RBASoundContentState*>& getSoundingContentStates() const;
+
+ // Impl [get Active View/Sound ContentStates]
+ const std::set<const RBAContentState*>& getActiveContentStates() const;
+ const std::list<const RBAViewContentState*>& getActiveViewContentStates() const;
+ const std::list<const RBASoundContentState*>& getActiveSoundContentStates() const;
+
+ // Impl [get Active Scenes]
+ const std::list<const RBAScene*>& getActiveScenes() const;
+
+ // Impl [get InvisibleAreas/UnsoundingZone]
+ const std::list<const RBAArea*>& getInvisibleAreas() const;
+ const std::list<const RBAZone*>& getUnsoundingZones() const;
+
+ // Impl [get HiddenAreas/MuteZones]
+ const std::list<const RBAArea*>& getHiddenAreas() const;
+ const std::list<const RBAZone*>& getMuteZones() const;
+
+ // Impl [get Attenuated]
+ const std::list<const RBAZone*>& getAttenuatedZones() const;
+
+ // Impl [get Canceled Contents]
+ const std::list<const RBAViewContent*>& getCanceledViewContents() const;
+ const std::list<const RBASoundContent*>& getCanceledSoundContents() const;
+
+ // Impl [get Standby Contents]
+ const std::list<const RBAViewContent*>& getStandbyViewContents() const;
+ const std::list<const RBASoundContent*>& getStandbySoundContents() const;
+
+ // Impl [get ContentStates]
+ const RBAContentState* getContentState(const RBAAllocatable* const alloc) const;
+ const RBAContentState* getDirectContentState(const RBAAllocatable* const alloc) const;
+
+ // Impl [get Areas/Zones by ConentState]
+ void getAlloc(const RBAContentState* const state,
+ std::list<const RBAAllocatable*>& allocList) const;
+ void getArea(const RBAViewContentState* const state,
+ std::list<const RBAArea*>& areaList) const;
+ void getZone(const RBASoundContentState* const state,
+ std::list<const RBAZone*>& zoneList) const;
+
+ // Impl [get Areas/Zones by Content]
+ void getArea(const RBAViewContent* const content,
+ std::list<const RBAArea*>& areaList) const;
+ void getZone(const RBASoundContent* const content,
+ std::list<const RBAZone*>& zoneList) const;
+
+ // Impl [get Size]
+ const RBASize* getSize(const RBAArea* const area) const;
+
+ // Impl [check Active Scene/Content/ContentState]
+ bool isActive(const RBAScene* const scene) const;
+ bool isActive(const RBAContent* const content) const;
+ bool isActive(const RBAContentState* const state) const;
+ const RBAContentState* getReqestState(const RBAContent* const content) const;
+
+ // Impl [check Outputting Allocatable/ContentState]
+ bool isOutputting(const RBAAllocatable* const alloc) const;
+ bool isOutputting(const RBAContentState* const state) const;
+
+ // Impl [check Hidden]
+ bool isHidden(const RBAAllocatable* const alloc) const;
+
+ // Impl [check Attenuated Zone]
+ bool isAttenuated(const RBAZone* const zone) const;
+
+ // Impl [check Cancel ContentState]
+ bool isCancel(const RBAContentState* const state) const;
+
+ // Impl [check Aleady OutPutting]
+ bool isAlreadyOutputting(const RBAContentState* const state) const;
+
+ // Impl [set Active Scene/ContentState]
+ void setActive(const RBAScene* const scene, const bool newActive);
+ void setActive(const RBAContentState* const state, const bool newActive);
+
+ // [cancel ContentState]
+ void cancelContentState(const RBAContentState* const state);
+
+ // Impl [set Cancel ContentState]
+ void setCancel(const RBAContentState* const state, const bool checked);
+
+ // Impl [set ContentState]
+ void setContentState(const RBAAllocatable* const alloc, const RBAContentState* const state);
+
+ // Impl [add Outputting ContentState]
+ void addOutputtingContentState(const RBAContentState* const state);
+
+ // Impl [add Standby Content]
+ void addStandbyContent(const RBAContent* const content);
+
+ // [activeView]
+ void copyActives(const std::unique_ptr<RBAResultSet>& resultSet);
+ void updateActiveContentStates();
+
+ // [Property]
+ void copyProperties(const std::unique_ptr<RBAResultSet>& resultSet);
+ void setSceneProperty(const RBAScene* const scene,
+ const std::string& propertyName,
+ const std::int32_t value);
+ void setSceneProperty(const RBAAbstractProperty* const property,
+ const std::int32_t value);
+ std::int32_t getSceneProperty(const RBAAbstractProperty* const property) const;
+
+ // [EventProcessing]
+ void setContentOfEventProcessing(const RBAEventProcessing* const eventProcessing,
+ const RBAContent* const content);
+ const RBAContent* getContentOfEventProcessing(const RBAEventProcessing* const eventProcessing) const;
+
+ // [DisplayContents]
+ bool hasDisplayingArea(const RBADisplay* const display) const;
+
+ // common
+ bool isLater(const RBAContent* const target, const RBAContent* const comparisonTarget) const;
+ std::set<const RBASceneImpl*>& getDifferentConditionScenes(const RBAResultSet& target);
+ void updateRequestStatus(const RBAContent* const content, const bool isOnRequest);
+ void setStatusType(const RBAContent* const content, const RBAContentStatusType type);
+ RBAContentStatusType getStatusType(const RBAContent* const content) const;
+ bool isOutput(const RBAContent* const content) const;
+ bool isStandby(const RBAContent* const content) const;
+ bool hasBeenCanceled(const RBAContent* const content) const;
+ bool hasBeenDisplayed(const RBAContent* const content) const;
+ std::unordered_map<const RBAContent*, RBAContentStatus>* getStatus() const;
+#ifdef RBA_USE_LOG
+ void addFailedConstraint(const RBAConstraint* constraint);
+ const std::list<const RBAConstraint*>& getFailedConstraints();
+#endif
+
+private:
+ const std::unordered_map<const RBAAbstractProperty*, std::int32_t>& getScenePropertyMap() const;
+ void setOrder(const RBAContentState* const state, const std::int32_t newOrder) const;
+
+ std::set<const RBAAllocatable*> outputtingAllocs_;
+ std::set<const RBAAllocatable*> hiddenAllocs_;
+ std::set<const RBAContentState*> activeContentStates_;
+ std::set<const RBAContentState*> canceledContentStates_;
+ std::unordered_map<const RBAAllocatable*, const RBAContentState*> allocToContentState_;
+
+ // The lists for getList type acquisition function
+ std::list<const RBAArea*> visibleAreas_;
+ std::list<const RBAZone*> soundingZones_;
+ std::list<const RBAArea*> invisibleAreas_;
+ std::list<const RBAZone*> unsoundingZones_;
+ std::list<const RBAArea*> hiddenAreas_;
+ std::list<const RBAZone*> muteZones_;
+ std::list<const RBAZone*> attenuatedZones_;
+ std::list<const RBAViewContent*> canceledViewContents_;
+ std::list<const RBASoundContent*> canceledSoundContents_;
+ std::list<const RBAViewContent*> standbyViewContents_;
+ std::list<const RBASoundContent*> standbySoundContents_;
+ std::list<const RBAViewContentState*> visibleContentStates_;
+ std::list<const RBASoundContentState*> soundingContentStates_;
+ std::list<const RBAViewContentState*> activeViewContentStates_;
+ std::list<const RBASoundContentState*> activeSoundContentStates_;
+
+ // common
+ std::int32_t requestOrderView_ {1};
+ std::int32_t requestOrderSound_ {1};
+ std::list<const RBAScene*> activeScenes_;
+ std::unordered_map<const RBAAbstractProperty*, std::int32_t> propertyMap_;
+ std::unordered_map<const RBAEventProcessing*, const RBAContent*> event_content_;
+ mutable std::unordered_map<const RBAContent*, RBAContentStatus> contentToStatus_;
+ std::set<const RBASceneImpl*> differentConditionScenes_;
+
+ mutable std::unordered_map<const RBAContent*, const RBAContentState*> requestContentStateMap_;
+
+ mutable std::mutex mutex_;
+#ifdef RBA_USE_LOG
+ std::list<const RBAConstraint*> failedConstraints_;
+#endif
+
+};
+
+}
+#endif
diff --git a/src/core/logic/RBARollbacker.cpp b/src/core/logic/RBARollbacker.cpp
new file mode 100644
index 0000000..9870fa9
--- /dev/null
+++ b/src/core/logic/RBARollbacker.cpp
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Rollbacker (rollback of arbitration results) class implementation
+ */
+
+#include "RBARollbacker.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBABackUpAllocatable.hpp"
+#include "RBAArbitrator.hpp"
+
+namespace rba
+{
+
+RBARollbacker::~RBARollbacker() noexcept
+{
+ children_.clear();
+}
+
+void
+RBARollbacker::addChild(const std::shared_ptr<RBARollbacker> child)
+{
+ children_.push_back(child);
+}
+
+void
+RBARollbacker::removeChild(const std::shared_ptr<RBARollbacker> child)
+{
+ children_.remove(child);
+}
+
+void
+RBARollbacker::backup(std::list<const RBAAllocatable*>& backuplist)
+{
+ backupMap_.clear();
+ for(const RBAAllocatable* const original : backuplist) {
+ std::unique_ptr<RBAAllocatable> backupObj
+ {std::make_unique<RBABackUpAllocatable>("backup_"
+ + original->getElementName())};
+ copyAllocatable(original, backupObj.get());
+ backupMap_[original] = std::move(backupObj);
+ }
+}
+
+void
+RBARollbacker::rollback()
+{
+ for (auto& Child : children_) {
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // rollback() is called recursively
+ // [Explanation that there is no problem if you deviate from the rules]
+ // RBARollbacker is created each time the re-arbitration nest becomes
+ // deeper, but since the infinite loop prevention process is implemented
+ // in re-arbitration, stack overflow does not occur.
+ Child->rollback();
+ }
+ for(auto itr = backupMap_.begin(); itr != backupMap_.end(); ++itr) {
+ const RBAAllocatable* const original {itr->first};
+ const RBAAllocatable* const backupVal {itr->second.get()};
+ copyAllocatable(backupVal, const_cast<RBAAllocatable*>(original));
+ }
+}
+
+void
+RBARollbacker::copyAllocatable(const RBAAllocatable* const from,
+ RBAAllocatable* const to)
+{
+ to->setHiddenChecked(from->isHiddenChecked());
+ to->setHidden(from->isHidden());
+ to->setChecked(from->isChecked());
+ to->setState(from->getState());
+ to->clearAllocatablesAffectedByYou();
+ for(const RBAAllocatable* const allocatable : from->getAllocatablesAffectedByYou()) {
+ to->addAllocatableWhichHasBeenAffectedByYou(allocatable);
+ }
+ to->setAttenuateChecked(from->isAttenuateChecked());
+ to->setAttenuated(from->isAttenuated());
+}
+
+}
diff --git a/src/core/logic/RBARollbacker.hpp b/src/core/logic/RBARollbacker.hpp
new file mode 100644
index 0000000..08ee4e9
--- /dev/null
+++ b/src/core/logic/RBARollbacker.hpp
@@ -0,0 +1,84 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Rollbacker (rollback of arbitration results) class header
+ */
+
+#ifndef RBARROLLBACKER_HPP
+#define RBARROLLBACKER_HPP
+
+#include <unordered_map>
+#include <memory>
+#include <list>
+
+namespace rba
+{
+class RBAModel;
+class RBAAllocatable;
+class RBAArbitrator;
+
+class RBARollbacker
+{
+ public:
+ RBARollbacker()=default;
+ RBARollbacker(const RBARollbacker&)=delete;
+ RBARollbacker(const RBARollbacker&&)=delete;
+ RBARollbacker& operator=(const RBARollbacker&)=delete;
+ RBARollbacker& operator=(const RBARollbacker&&)=delete;
+ virtual ~RBARollbacker() noexcept;
+
+ /**
+ * Register a backup for child re-arbitration when execute re-arbitration
+ * during re-arbitration.
+ * Restore child backup when rolling back
+ */
+ void addChild(const std::shared_ptr<RBARollbacker> child);
+
+ void removeChild(const std::shared_ptr<RBARollbacker> child);
+
+ /**
+ * Back up arbitration status and impact information.
+ * (Only "Allocatable" that directly arbitration is backed up)
+ * Child will back up re-arbitraion during execution of re-aribitration.
+ *
+ * Backing up all "Allocatable" on a model is inefficient,
+ * so back up only those that execute re-arbitration
+ */
+ void backup(std::list<const RBAAllocatable*>& backuplist);
+
+ /**
+ * Roll back the arbitration state and impact information to
+ * the state when the instance was created
+ */
+ void rollback();
+
+ private:
+ /**
+ * @brief Copy Allocable arbitration state
+ * @param from source of copy
+ * @param to destination of copy
+ */
+ void copyAllocatable(const RBAAllocatable* const from, RBAAllocatable* const to);
+
+ std::list<std::shared_ptr<RBARollbacker>> children_;
+ // Rollback information when arbitration fails
+ std::unordered_map<const RBAAllocatable*, std::unique_ptr<RBAAllocatable>> backupMap_;
+};
+
+}
+
+#endif
diff --git a/src/core/logic/RBAViewAction.cpp b/src/core/logic/RBAViewAction.cpp
new file mode 100644
index 0000000..54553dc
--- /dev/null
+++ b/src/core/logic/RBAViewAction.cpp
@@ -0,0 +1,88 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ViewAction Class implementation
+ */
+
+#include "RBAArea.hpp"
+#include "RBAViewContent.hpp"
+#include "RBAViewContentState.hpp"
+#include "RBAViewAction.hpp"
+#include "RBAViewMove.hpp"
+#include "RBAViewTransition.hpp"
+
+namespace rba {
+
+const RBAArea*
+RBAViewAction::getArea() const
+{
+ return nullptr;
+}
+
+const RBAViewContent*
+RBAViewAction::getFromContent() const
+{
+ return nullptr;
+}
+
+const RBAViewContent*
+RBAViewAction::getToContent() const
+{
+ return nullptr;
+}
+
+const RBAViewContentState*
+RBAViewAction::getFromContentState() const
+{
+ return nullptr;
+}
+
+const RBAViewContentState*
+RBAViewAction::getToContentState() const
+{
+ return nullptr;
+}
+
+const RBAArea*
+RBAViewAction::getFromArea() const
+{
+ return nullptr;
+}
+
+const RBAArea*
+RBAViewAction::getToArea() const
+{
+ return nullptr;
+}
+
+const RBAViewContent*
+RBAViewAction::getContent() const
+{
+ // This function is never called because the function of the derived class
+ // is always called
+ return nullptr;
+}
+
+const RBAViewContentState*
+RBAViewAction::getContentState() const
+{
+ // This function is never called because the function of the derived class
+ // is always called
+ return nullptr;
+}
+
+}
diff --git a/src/core/logic/RBAViewMove.cpp b/src/core/logic/RBAViewMove.cpp
new file mode 100644
index 0000000..7e40043
--- /dev/null
+++ b/src/core/logic/RBAViewMove.cpp
@@ -0,0 +1,89 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * RBAViewMove.cpp
+ */
+
+#include "RBAArea.hpp"
+#include "RBAViewContent.hpp"
+#include "RBAViewContentState.hpp"
+#include "RBAViewMove.hpp"
+
+namespace rba {
+
+RBAViewMove::RBAViewMove(const RBAArea* const newFromArea, const RBAArea* const newToArea,
+ const RBAViewContentState* const newContentState)
+ : RBAViewAction{}
+{
+ fromArea_ = newFromArea;
+ toArea_ = newToArea;
+ contentState_ = newContentState;
+}
+
+RBAViewMove::RBAViewMove(const RBAViewMove& viewMove)
+ : RBAViewAction{viewMove}
+{
+ fromArea_ = viewMove.fromArea_;
+ toArea_ = viewMove.toArea_;
+ contentState_ = viewMove.contentState_;
+}
+
+bool
+RBAViewMove::operator==(const RBAViewAction& viewAction)
+{
+ if(getViewActionType() != viewAction.getViewActionType()) {
+ // False if the view action types do not match
+ return false;
+ }
+
+ const RBAViewMove* const viewMove {dynamic_cast<const RBAViewMove*>(&viewAction)};
+ return ((fromArea_ == viewMove->fromArea_) &&
+ (toArea_ == viewMove->toArea_) &&
+ (contentState_ == viewMove->contentState_));
+}
+
+const RBAArea*
+RBAViewMove::getFromArea() const
+{
+ return fromArea_;
+}
+
+const RBAArea*
+RBAViewMove::getToArea() const
+{
+ return toArea_;
+}
+
+const RBAViewContent*
+RBAViewMove::getContent() const
+{
+ return contentState_->getOwner();
+}
+
+const RBAViewContentState*
+RBAViewMove::getContentState() const
+{
+ return contentState_;
+}
+
+RBAViewActionType
+RBAViewMove::getViewActionType() const
+{
+ return RBAViewActionType::MOVE;
+}
+
+}
diff --git a/src/core/logic/RBAViewMove.hpp b/src/core/logic/RBAViewMove.hpp
new file mode 100644
index 0000000..2b8db08
--- /dev/null
+++ b/src/core/logic/RBAViewMove.hpp
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBAViewMove.hpp
+ */
+
+#ifndef RBAVIEWMOVE_HPP
+#define RBAVIEWMOVE_HPP
+
+#include "RBAViewActionType.hpp"
+#include "RBAViewAction.hpp"
+
+namespace rba {
+
+class RBAArea;
+class RBAViewContent;
+class RBAViewContentState;
+
+class DLL_EXPORT RBAViewMove : public RBAViewAction
+{
+public:
+ RBAViewMove(const RBAArea* const newFromArea, const RBAArea* const newToArea,
+ const RBAViewContentState* const newContentState);
+ RBAViewMove(const RBAViewMove& viewMove);
+ RBAViewMove(const RBAViewMove&&)=delete;
+ RBAViewMove& operator=(const RBAViewMove&)=delete;
+ RBAViewMove& operator=(const RBAViewMove&&)=delete;
+ virtual ~RBAViewMove()=default;
+
+ bool operator==(const RBAViewAction& viewAction) override;
+
+public:
+ const RBAArea* getFromArea() const override;
+ const RBAArea* getToArea() const override;
+ const RBAViewContent* getContent() const override;
+ const RBAViewContentState* getContentState() const override;
+ RBAViewActionType getViewActionType() const override;
+
+private:
+ const RBAArea* fromArea_ {nullptr};
+ const RBAArea* toArea_ {nullptr};
+ const RBAViewContentState* contentState_ {nullptr};
+
+};
+
+}
+
+#endif
diff --git a/src/core/logic/RBAViewTransition.cpp b/src/core/logic/RBAViewTransition.cpp
new file mode 100644
index 0000000..93b86a7
--- /dev/null
+++ b/src/core/logic/RBAViewTransition.cpp
@@ -0,0 +1,137 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * RBAViewTransition.cpp
+ */
+
+#include "RBAArea.hpp"
+#include "RBAViewContent.hpp"
+#include "RBAViewContentState.hpp"
+#include "RBAViewTransition.hpp"
+
+namespace rba {
+
+RBAViewTransition::RBAViewTransition(
+ const RBAViewActionType newViewActionType, const RBAArea* const newArea,
+ const RBAViewContentState* const newContentState1,
+ const RBAViewContentState* const newContentState2)
+ : RBAViewAction(),
+ viewActionType_{newViewActionType},
+ area_{newArea},
+ contentState1_{newContentState1},
+ contentState2_{newContentState2}
+{
+}
+
+RBAViewTransition::RBAViewTransition(const RBAViewTransition& viewTrans)
+ : RBAViewAction{viewTrans}
+{
+ viewActionType_ = viewTrans.viewActionType_;
+ area_ = viewTrans.area_;
+ contentState1_ = viewTrans.contentState1_;
+ contentState2_ = viewTrans.contentState2_;
+}
+
+bool
+RBAViewTransition::operator==(const RBAViewAction& viewAction)
+{
+ if(getViewActionType() != viewAction.getViewActionType()) {
+ // False if the view action types do not match
+ return false;
+ }
+
+ const RBAViewTransition* const viewTran
+ {dynamic_cast<const RBAViewTransition*>(&viewAction)};
+ return ((area_ == viewTran->area_) &&
+ (contentState1_ == viewTran->contentState1_) &&
+ (contentState2_ == viewTran->contentState2_));
+}
+
+const RBAArea*
+RBAViewTransition::getArea() const
+{
+ return area_;
+}
+
+const RBAViewContent*
+RBAViewTransition::getFromContent() const
+{
+ if((contentState1_ == nullptr) ||
+ (viewActionType_ == RBAViewActionType::TRANSITION_ADD) ||
+ (viewActionType_ == RBAViewActionType::TRANSITION_REMOVE)) {
+ return nullptr;
+ }
+ return contentState1_->getOwner();
+}
+
+const RBAViewContent*
+RBAViewTransition::getToContent() const
+{
+ if((contentState2_ == nullptr) ||
+ (viewActionType_ == RBAViewActionType::TRANSITION_ADD) ||
+ (viewActionType_ == RBAViewActionType::TRANSITION_REMOVE)) {
+ return nullptr;
+ }
+ return contentState2_->getOwner();
+}
+
+const RBAViewContentState*
+RBAViewTransition::getFromContentState() const
+{
+ if((viewActionType_ == RBAViewActionType::TRANSITION_ADD) ||
+ (viewActionType_ == RBAViewActionType::TRANSITION_REMOVE)) {
+ return nullptr;
+ }
+ return contentState1_;
+}
+
+const RBAViewContentState*
+RBAViewTransition::getToContentState() const
+{
+ if((viewActionType_ == RBAViewActionType::TRANSITION_ADD) ||
+ (viewActionType_ == RBAViewActionType::TRANSITION_REMOVE)) {
+ return nullptr;
+ }
+ return contentState2_;
+}
+
+const RBAViewContent*
+RBAViewTransition::getContent() const
+{
+ if((contentState1_ == nullptr) ||
+ (viewActionType_ == RBAViewActionType::TRANSITION_REPLACE)) {
+ return nullptr;
+ }
+ return contentState1_->getOwner();
+}
+
+const RBAViewContentState*
+RBAViewTransition::getContentState() const
+{
+ if(viewActionType_ == RBAViewActionType::TRANSITION_REPLACE) {
+ return nullptr;
+ }
+ return contentState1_;
+}
+
+RBAViewActionType
+RBAViewTransition::getViewActionType() const
+{
+ return viewActionType_;
+}
+
+}
diff --git a/src/core/logic/RBAViewTransition.hpp b/src/core/logic/RBAViewTransition.hpp
new file mode 100644
index 0000000..1b9338f
--- /dev/null
+++ b/src/core/logic/RBAViewTransition.hpp
@@ -0,0 +1,64 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * RBAViewTransition.hpp
+ */
+
+#ifndef RBAVIEWTRANSITION_HPP
+#define RBAVIEWTRANSITION_HPP
+
+#include "RBAViewAction.hpp"
+
+namespace rba {
+
+class RBAArea;
+
+class DLL_EXPORT RBAViewTransition : public RBAViewAction
+{
+public:
+ RBAViewTransition(const RBAViewActionType newViewActionType, const RBAArea* const newArea,
+ const RBAViewContentState* const newContentState1,
+ const RBAViewContentState* const newContentState2 = nullptr);
+ RBAViewTransition(const RBAViewTransition& viewTrans);
+ RBAViewTransition(const RBAViewTransition&&)=delete;
+ RBAViewTransition& operator=(const RBAViewTransition&)=delete;
+ RBAViewTransition& operator=(const RBAViewTransition&&)=delete;
+ virtual ~RBAViewTransition()=default;
+
+ bool operator==(const RBAViewAction& viewAction) override;
+
+public:
+ const RBAArea* getArea() const override;
+
+ const RBAViewContent* getFromContent() const override;
+ const RBAViewContent* getToContent() const override;
+ const RBAViewContentState* getFromContentState() const override;
+ const RBAViewContentState* getToContentState() const override;
+ const RBAViewContent* getContent() const override;
+ const RBAViewContentState* getContentState() const override;
+ RBAViewActionType getViewActionType() const override;
+
+private:
+ RBAViewActionType viewActionType_;
+ const RBAArea* area_;
+ const RBAViewContentState* contentState1_;
+ const RBAViewContentState* contentState2_;
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAAbstractAllocatable.cpp b/src/core/model/RBAAbstractAllocatable.cpp
new file mode 100644
index 0000000..c0dfb4f
--- /dev/null
+++ b/src/core/model/RBAAbstractAllocatable.cpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AbstractAllocatable class implementation
+ */
+
+#include "RBAAbstractAllocatable.hpp"
+
+#include "RBAModelElementType.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentSet.hpp"
+#include "RBAViewContentSet.hpp"
+#include "RBASoundContentSet.hpp"
+
+namespace rba
+{
+
+RBAAbstractAllocatable::RBAAbstractAllocatable(const std::string& name)
+ : RBARuleObject{name},
+ contentSet_{std::make_unique<RBAContentSet>()}
+{
+}
+
+const std::list<const RBAContent*>&
+RBAAbstractAllocatable::getInternalContents() const
+{
+ return contentSet_->getLeafContent();
+}
+
+void
+RBAAbstractAllocatable::addContent(const RBAContent* const content)
+{
+ contentSet_->addTarget(content);
+}
+
+const RBAContentSet*
+RBAAbstractAllocatable::getContentSet() const
+{
+ return contentSet_.get();
+}
+
+}
diff --git a/src/core/model/RBAAbstractAllocatable.hpp b/src/core/model/RBAAbstractAllocatable.hpp
new file mode 100644
index 0000000..b8b7acb
--- /dev/null
+++ b/src/core/model/RBAAbstractAllocatable.hpp
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AbstractAllocatable class header
+ */
+
+#ifndef RBAABSTRACTALLOCATABLE_HPP
+#define RBAABSTRACTALLOCATABLE_HPP
+
+#include <memory>
+#include <list>
+#include "RBARuleObject.hpp"
+#include "RBAContentSet.hpp"
+
+namespace rba
+{
+
+class RBAContent;
+
+class DLL_EXPORT RBAAbstractAllocatable : virtual public RBARuleObject
+{
+protected:
+ explicit RBAAbstractAllocatable(const std::string& name="");
+ RBAAbstractAllocatable(const RBAAbstractAllocatable&)=delete;
+ RBAAbstractAllocatable(const RBAAbstractAllocatable&&)=delete;
+ RBAAbstractAllocatable& operator=(const RBAAbstractAllocatable&)=delete;
+ RBAAbstractAllocatable& operator=(const RBAAbstractAllocatable&&)=delete;
+
+public:
+ virtual ~RBAAbstractAllocatable()=default;
+
+public:
+ const std::list<const RBAContent*>& getInternalContents() const;
+ void addContent(const RBAContent* const content);
+ const RBAContentSet* getContentSet() const;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::unique_ptr<RBAContentSet> contentSet_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAAbstractAllocatableMaker.cpp b/src/core/model/RBAAbstractAllocatableMaker.cpp
new file mode 100644
index 0000000..793336a
--- /dev/null
+++ b/src/core/model/RBAAbstractAllocatableMaker.cpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAbstractAllocatableMaker.cpp
+/// @brief AbstractAllocatable generator class implementation
+
+#include "RBAAbstractAllocatableMaker.hpp"
+#include "RBAAbstractAllocatable.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAAbstractAllocatableMaker::RBAAbstractAllocatableMaker(const std::string& label)
+ : RBARuleObjectMaker{label}
+{
+}
+
+RBAModelElement*
+RBAAbstractAllocatableMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBARuleObjectMaker::setProperty(element, jsonElem, model, owner));
+
+ const auto abstAllo = dynamic_cast<RBAAbstractAllocatable*>(element);
+
+ // Currently, there is no member set by RBAAbstractAllocatableMaker
+ // as model information, but this process is implemented
+ // because it may be added in the future.
+
+ return abstAllo;
+}
+
+}
diff --git a/src/core/model/RBAAbstractAllocatableMaker.hpp b/src/core/model/RBAAbstractAllocatableMaker.hpp
new file mode 100644
index 0000000..845acd2
--- /dev/null
+++ b/src/core/model/RBAAbstractAllocatableMaker.hpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAbstractAllocatableMaker.hpp
+/// @brief AbstractAllocatable generator class header
+
+#ifndef RBAABSTRACTALLOCATABLEMAKER_HPP
+#define RBAABSTRACTALLOCATABLEMAKER_HPP
+
+#include "RBARuleObjectMaker.hpp"
+
+namespace rba
+{
+
+/// @brief AbstractAllocatable generator class
+class DLL_EXPORT RBAAbstractAllocatableMaker : virtual public RBARuleObjectMaker
+{
+public:
+ explicit RBAAbstractAllocatableMaker(const std::string& label="");
+ RBAAbstractAllocatableMaker(const RBAAbstractAllocatableMaker&)=delete;
+ RBAAbstractAllocatableMaker(const RBAAbstractAllocatableMaker&&)=delete;
+ RBAAbstractAllocatableMaker& operator=(const RBAAbstractAllocatableMaker&)=delete;
+ RBAAbstractAllocatableMaker& operator=(const RBAAbstractAllocatableMaker&&)=delete;
+ virtual ~RBAAbstractAllocatableMaker()=default;
+
+protected:
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAAbstractConstraint.cpp b/src/core/model/RBAAbstractConstraint.cpp
new file mode 100644
index 0000000..3c8ba73
--- /dev/null
+++ b/src/core/model/RBAAbstractConstraint.cpp
@@ -0,0 +1,81 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AbstractConstraint class implementation
+ */
+
+#include "RBAAbstractConstraint.hpp"
+
+#include "RBAExpression.hpp"
+#include "RBALogManager.hpp"
+
+namespace rba
+{
+
+RBAAbstractConstraint::RBAAbstractConstraint(const std::string& name)
+ : RBANamedElement{name}
+{
+}
+
+bool
+RBAAbstractConstraint::isConstraint() const
+{
+ return false;
+}
+
+bool
+RBAAbstractConstraint::isRule() const
+{
+ return false;
+}
+
+void
+RBAAbstractConstraint::clearInfo()
+{
+ info_->clear();
+}
+
+void
+RBAAbstractConstraint::setExpression(RBAExpression* newExpr)
+{
+ expression_ = newExpr;
+}
+
+RBAExpression* const
+RBAAbstractConstraint::getExpression() const
+{
+ return expression_;
+}
+
+RBAConstraintInfo*
+RBAAbstractConstraint::getInfo() const
+{
+ return info_.get();
+}
+
+#ifdef RBA_USE_LOG
+void
+RBAAbstractConstraint::createHierarchy()
+{
+ LOG_initConstraintHierarchy();
+ LOG_coverageHierarchyOfConstraintStartLog(this);
+ getExpression()->createHierarchy();
+ LOG_coverageHierarchyOfConstraintEndLog(this);
+}
+#endif
+
+}
diff --git a/src/core/model/RBAAbstractConstraint.hpp b/src/core/model/RBAAbstractConstraint.hpp
new file mode 100644
index 0000000..d19bba5
--- /dev/null
+++ b/src/core/model/RBAAbstractConstraint.hpp
@@ -0,0 +1,71 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AbstractConstraint class header
+ */
+
+#ifndef RBAABSTRACTCONSTRAINT_HPP
+#define RBAABSTRACTCONSTRAINT_HPP
+
+#include <memory>
+#include "RBANamedElement.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+class RBAExpression;
+
+class DLL_EXPORT RBAAbstractConstraint : public RBANamedElement
+{
+protected:
+ explicit RBAAbstractConstraint(const std::string& name);
+ RBAAbstractConstraint(const RBAAbstractConstraint&)=delete;
+ RBAAbstractConstraint(const RBAAbstractConstraint&&)=delete;
+ RBAAbstractConstraint& operator=(const RBAAbstractConstraint&)=delete;
+ RBAAbstractConstraint& operator=(const RBAAbstractConstraint&&)=delete;
+ void clearInfo();
+
+public:
+ virtual ~RBAAbstractConstraint()=default;
+ virtual bool isConstraint() const;
+ virtual bool isRule() const;
+ virtual void setExpression(RBAExpression*);
+ virtual RBAExpression* const getExpression() const;
+ RBAConstraintInfo* getInfo() const;
+
+ // Log
+#ifdef RBA_USE_LOG
+ virtual void createHierarchy();
+#endif
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::unique_ptr<RBAConstraintInfo> info_ {std::make_unique<RBAConstraintInfo>()};
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+ RBAExpression* expression_ {nullptr};
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAAbstractConstraintMaker.cpp b/src/core/model/RBAAbstractConstraintMaker.cpp
new file mode 100644
index 0000000..5de0ae3
--- /dev/null
+++ b/src/core/model/RBAAbstractConstraintMaker.cpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAbstractConstraintMaker.cpp
+/// @brief Abstract Constraint expresion generator class
+
+#include "RBAAbstractConstraintMaker.hpp"
+#include "RBAAbstractConstraint.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAAbstractConstraintMaker::RBAAbstractConstraintMaker(const std::string& label)
+ : RBAModelElementMaker{label}
+{
+}
+
+RBAModelElement*
+RBAAbstractConstraintMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ const auto abstConstraint = dynamic_cast<RBAAbstractConstraint*>(element);
+
+ // Set expression
+ const RBAJsonElement* const childElem {jsonElem->findChildren("expression")};
+ RBAModelElement* const expr {getFactory()->createElement(childElem->getClassName(),
+ childElem)};
+ abstConstraint->setExpression(dynamic_cast<RBAExpression*>(expr));
+
+ return abstConstraint;
+}
+
+}
diff --git a/src/core/model/RBAAbstractConstraintMaker.hpp b/src/core/model/RBAAbstractConstraintMaker.hpp
new file mode 100644
index 0000000..916408e
--- /dev/null
+++ b/src/core/model/RBAAbstractConstraintMaker.hpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAbstractConstraintMaker.hpp
+/// @brief Abstract Constraint expresion generator class header
+
+#ifndef RBAABSTRACTCONSTRAINTMAKER_HPP
+#define RBAABSTRACTCONSTRAINTMAKER_HPP
+
+#include "RBAModelElementMaker.hpp"
+
+namespace rba
+{
+
+/// @brief Abstract Constraint expresion generator class
+class DLL_EXPORT RBAAbstractConstraintMaker
+ : public RBAModelElementMaker
+{
+public:
+ explicit RBAAbstractConstraintMaker(const std::string& label);
+ RBAAbstractConstraintMaker(const RBAAbstractConstraintMaker&)=delete;
+ RBAAbstractConstraintMaker(const RBAAbstractConstraintMaker&&)=delete;
+ RBAAbstractConstraintMaker& operator=(const RBAAbstractConstraintMaker&)=delete;
+ RBAAbstractConstraintMaker& operator=(const RBAAbstractConstraintMaker&&)=delete;
+ virtual ~RBAAbstractConstraintMaker()=default;
+
+protected:
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAAbstractContent.cpp b/src/core/model/RBAAbstractContent.cpp
new file mode 100644
index 0000000..d8f025f
--- /dev/null
+++ b/src/core/model/RBAAbstractContent.cpp
@@ -0,0 +1,31 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Abstract Content class implementation
+ */
+
+#include "RBAAbstractContent.hpp"
+
+namespace rba
+{
+
+RBAAbstractContent::RBAAbstractContent(const std::string& name)
+ : RBARuleObject{name}
+{
+}
+
+}
diff --git a/src/core/model/RBAAbstractContent.hpp b/src/core/model/RBAAbstractContent.hpp
new file mode 100644
index 0000000..c2d72b1
--- /dev/null
+++ b/src/core/model/RBAAbstractContent.hpp
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Abstract Content class header
+ */
+
+#ifndef RBAABSTRACTCONTENT_HPP
+#define RBAABSTRACTCONTENT_HPP
+
+#include "RBARuleObject.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAAbstractContent : virtual public RBARuleObject
+{
+protected:
+ explicit RBAAbstractContent(const std::string& name="");
+ RBAAbstractContent(const RBAAbstractContent&)=delete;
+ RBAAbstractContent(const RBAAbstractContent&&)=delete;
+ RBAAbstractContent& operator=(const RBAAbstractContent&)=delete;
+ RBAAbstractContent& operator=(const RBAAbstractContent&&)=delete;
+
+public:
+ virtual ~RBAAbstractContent()=default;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAAbstractContentMaker.cpp b/src/core/model/RBAAbstractContentMaker.cpp
new file mode 100644
index 0000000..b0ff0be
--- /dev/null
+++ b/src/core/model/RBAAbstractContentMaker.cpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAbstractContentMaker.cpp
+/// @brief Abstract Content generator class implementation
+
+#include "RBAAbstractContentMaker.hpp"
+#include "RBAAbstractContent.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAAbstractContentMaker::RBAAbstractContentMaker(const std::string& label)
+ : RBARuleObjectMaker{label}
+{
+}
+
+RBAModelElement*
+RBAAbstractContentMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBARuleObjectMaker::setProperty( element, jsonElem,
+ model, owner));
+
+ const auto abstContent = dynamic_cast<RBAAbstractContent*>(element);
+
+ // Currently, there is no member set by RBAAbstractContentMaker
+ // as model information, but this process is implemented
+ // because it may be added in the future.
+
+ return abstContent;
+}
+
+}
diff --git a/src/core/model/RBAAbstractContentMaker.hpp b/src/core/model/RBAAbstractContentMaker.hpp
new file mode 100644
index 0000000..df311a8
--- /dev/null
+++ b/src/core/model/RBAAbstractContentMaker.hpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAbstractContentMaker.cpp
+/// @brief Abstract Content generator class header
+
+#ifndef RBAABSTRACTCONTENTMAKER_HPP
+#define RBAABSTRACTCONTENTMAKER_HPP
+
+#include "RBARuleObjectMaker.hpp"
+
+namespace rba
+{
+
+/// @brief Abstract Content generator class
+class DLL_EXPORT RBAAbstractContentMaker : virtual public RBARuleObjectMaker
+{
+public:
+ explicit RBAAbstractContentMaker(const std::string& label="");
+ RBAAbstractContentMaker(const RBAAbstractContentMaker&)=delete;
+ RBAAbstractContentMaker(const RBAAbstractContentMaker&&)=delete;
+ RBAAbstractContentMaker& operator=(const RBAAbstractContentMaker&)=delete;
+ RBAAbstractContentMaker& operator=(const RBAAbstractContentMaker&&)=delete;
+ virtual ~RBAAbstractContentMaker()=default;
+
+protected:
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAAbstractProperty.cpp b/src/core/model/RBAAbstractProperty.cpp
new file mode 100644
index 0000000..a90fa4d
--- /dev/null
+++ b/src/core/model/RBAAbstractProperty.cpp
@@ -0,0 +1,46 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Abstract property class implementation
+ */
+
+#include "RBAAbstractProperty.hpp"
+#include "RBASceneImpl.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBAAbstractProperty::RBAAbstractProperty(const RBASceneImpl* const scene, const std::string& name)
+ : RBARuleObject{name},
+ scene_{scene}
+{
+}
+
+RBAModelElementType
+RBAAbstractProperty::getModelElementType() const
+{
+ return RBAModelElementType::Property;
+}
+
+const RBASceneImpl*
+RBAAbstractProperty::getScene() const
+{
+ return scene_;
+}
+
+}
diff --git a/src/core/model/RBAAbstractProperty.hpp b/src/core/model/RBAAbstractProperty.hpp
new file mode 100644
index 0000000..15ecc2d
--- /dev/null
+++ b/src/core/model/RBAAbstractProperty.hpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Abstract property class header
+ */
+
+#ifndef RBAABSTRACTPROPERTY_HPP
+#define RBAABSTRACTPROPERTY_HPP
+
+#include <cstdint>
+#include "RBARuleObject.hpp"
+
+namespace rba
+{
+
+class RBASceneImpl;
+
+class RBAAbstractProperty : public RBARuleObject
+{
+protected:
+ RBAAbstractProperty(const RBASceneImpl* const scene, const std::string& name);
+ RBAAbstractProperty(const RBAAbstractProperty&)=delete;
+ RBAAbstractProperty(const RBAAbstractProperty&&)=delete;
+ RBAAbstractProperty& operator=(const RBAAbstractProperty&)=delete;
+ RBAAbstractProperty& operator=(const RBAAbstractProperty&&)=delete;
+
+public:
+ virtual ~RBAAbstractProperty()=default;
+
+public:
+ RBAModelElementType getModelElementType() const override;
+ virtual std::int32_t getValue() const=0;
+ virtual const RBASceneImpl* getScene() const;
+
+ // Log
+#ifdef RBA_USE_LOG
+ virtual const std::string getExpressionText() const=0;
+#endif
+
+private:
+ const RBASceneImpl* scene_;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAAllocatable.cpp b/src/core/model/RBAAllocatable.cpp
new file mode 100644
index 0000000..aac639b
--- /dev/null
+++ b/src/core/model/RBAAllocatable.cpp
@@ -0,0 +1,387 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Allocatable class implementation
+ */
+
+#include <algorithm>
+
+#include "RBAAllocatable.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAViewContent.hpp"
+#include "RBAAreaImpl.hpp"
+#include "RBAConstraintImpl.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAConstraintMap.hpp"
+
+namespace rba
+{
+
+RBAAllocatable::RBAAllocatable(const std::string& name)
+ : RBARuleObject{name},
+ RBAAbstractAllocatable{name}
+{
+}
+
+void RBAAllocatable::clearStatus()
+{
+ allocatablesAffectedByThisAllocatable_.clear();
+ state_ = nullptr;
+ hiddenChecked_ = false;
+ checked_ = false;
+ attenuateChecked_ = false;
+ hidden_ = false;
+ attenuated_ = false;
+}
+
+bool
+RBAAllocatable::isArea() const
+{
+ return isModelElementType(RBAModelElementType::Area);
+}
+
+bool
+RBAAllocatable::isZone() const
+{
+ return isModelElementType(RBAModelElementType::Zone);
+}
+
+RBAArbitrationPolicy
+RBAAllocatable::getAllocatableArbitrationPolicy() const
+{
+ return arbitrationPolicy_;
+}
+
+void
+RBAAllocatable::setArbitrationPolicy(const RBAArbitrationPolicy newPolicy)
+{
+ arbitrationPolicy_ = newPolicy;
+}
+
+std::int32_t
+RBAAllocatable::getVisibility() const
+{
+ return visibility_;
+}
+
+void
+RBAAllocatable::setVisibility(const std::int32_t newVisibility)
+{
+ visibility_ = newVisibility;
+}
+
+const std::list<const RBAAllocatable*>&
+RBAAllocatable::getAllocatablesAffectedByYou() const
+{
+ return allocatablesAffectedByThisAllocatable_;
+}
+
+void
+RBAAllocatable::clearAllocatablesAffectedByYou()
+{
+ return allocatablesAffectedByThisAllocatable_.clear();
+}
+
+void
+RBAAllocatable::addAllocatableWhichHasBeenAffectedByYou(const RBAAllocatable* const allocatable)
+{
+ allocatablesAffectedByThisAllocatable_.push_back(allocatable);
+}
+
+void
+RBAAllocatable::removeAffectAllocatable(const RBAAllocatable* const allocatable)
+{
+ const auto it = std::find(allocatablesAffectedByThisAllocatable_.begin(),
+ allocatablesAffectedByThisAllocatable_.end(), allocatable);
+ if(it != allocatablesAffectedByThisAllocatable_.end()) {
+ static_cast<void>(allocatablesAffectedByThisAllocatable_.erase(it));
+ }
+}
+
+void
+RBAAllocatable::clearAffectAllocatable()
+{
+ allocatablesAffectedByThisAllocatable_.clear();
+}
+
+void
+RBAAllocatable::clearChecked()
+{
+ hiddenChecked_ = false;
+ checked_ = false;
+ attenuateChecked_ =false;
+ hidden_ = false;
+ attenuated_ = false;
+}
+
+std::int32_t
+RBAAllocatable::getIndex() const
+{
+ return index_;
+}
+
+void
+RBAAllocatable::setIndex(const std::int32_t newIndex)
+{
+ index_ = newIndex;
+}
+
+bool
+RBAAllocatable::compare(const RBAAllocatable* const arg0,
+ const RBAAllocatable* const arg1)
+{
+ const std::int32_t visibility0 {arg0->getVisibility()};
+ const std::int32_t visibility1 {arg1->getVisibility()};
+ // Do not swap because the front element is more visible than the rear element
+ if(visibility0 > visibility1) {
+ return true;
+ }
+ // Compare the Z orders because the front element and the rear element
+ // have the same visibility.
+ else if(visibility0 == visibility1) {
+ std::int32_t zorder0{0};
+ std::int32_t zorder1{0};
+ if(arg0->isModelElementType(RBAModelElementType::Area)) {
+ zorder0 = (dynamic_cast<const RBAAreaImpl*>(arg0))->getZorder();
+ zorder1 = (dynamic_cast<const RBAAreaImpl*>(arg1))->getZorder();
+ }
+ else {
+ zorder0 = ZONE_ZORDER;
+ zorder1 = ZONE_ZORDER;
+ }
+ // Do not swap because the front element has a larger Z order than
+ // the rear element.
+ if(zorder0 > zorder1) {
+ return true;
+ }
+ // Do not swap because the Z order of the front element and the rear element
+ // is the same
+ else if(zorder0 == zorder1) {
+ return false;
+ }
+ // Swap because the front element has a smaller Z order than
+ // the rear element.
+ else {
+ return false;
+ }
+ }
+ // Replace because the front element is less visible than
+ // the rear element.
+ else {
+ return false;
+ }
+}
+
+bool
+RBAAllocatable::compareIndex(const RBAAllocatable* const arg0,
+ const RBAAllocatable* const arg1)
+{
+ return arg0->getIndex() < arg1->getIndex();
+}
+
+void
+RBAAllocatable::addConstraint(RBAConstraintImpl* const constraint,
+ const RBAConstraintMap& kind)
+{
+ if (kind == RBAConstraintMap::CONTENT_ALLOCATE_CONSTRAINTS) {
+ addConstraintImpl(constraint, constraints_);
+ } else if (kind == RBAConstraintMap::HIDDEN_TRUE_CHECK_CONSTRAINTS) {
+ addConstraintImpl(constraint, hiddenTrueCheckConstraints_);
+ } else if (kind == RBAConstraintMap::HIDDEN_FALSE_CHECK_CONSTRAINTS) {
+ addConstraintImpl(constraint, hiddenFalseCheckConstraints_);
+ } else if (kind == RBAConstraintMap::ATTENUATE_TRUE_CHECK_CONSTRAINTS) {
+ addConstraintImpl(constraint, attenuateTrueCheckConstraints_);
+ } else {
+ addConstraintImpl(constraint, attenuateFalseCheckConstraints_);
+ }
+}
+
+std::list<RBAConstraintImpl*>&
+RBAAllocatable::getConstraints()
+{
+ return constraints_;
+}
+std::list<RBAConstraintImpl*>& RBAAllocatable::getHiddenTrueCheckConstraints()
+{
+ return hiddenTrueCheckConstraints_;
+}
+std::list<RBAConstraintImpl*>& RBAAllocatable::getHiddenFalseCheckConstraints()
+{
+ return hiddenFalseCheckConstraints_;
+}
+std::list<RBAConstraintImpl*>& RBAAllocatable::getAttenuateTrueCheckConstraints()
+{
+ return attenuateTrueCheckConstraints_;
+}
+std::list<RBAConstraintImpl*>& RBAAllocatable::getAttenuateFalseCheckConstraints()
+{
+ return attenuateFalseCheckConstraints_;
+}
+
+bool RBAAllocatable::hasConstraint(const RBAConstraintImpl* const constraint) const
+{
+ if ((std::find(constraints_.begin(), constraints_.end(), constraint)
+ != constraints_.end())
+ || (std::find(hiddenTrueCheckConstraints_.begin(),
+ hiddenTrueCheckConstraints_.end(), constraint)
+ != hiddenTrueCheckConstraints_.end())
+ || (std::find(hiddenFalseCheckConstraints_.begin(),
+ hiddenFalseCheckConstraints_.end(), constraint)
+ != hiddenFalseCheckConstraints_.end())
+ || (std::find(attenuateTrueCheckConstraints_.begin(),
+ attenuateTrueCheckConstraints_.end(), constraint)
+ != attenuateTrueCheckConstraints_.end())
+ || (std::find(attenuateFalseCheckConstraints_.begin(),
+ attenuateFalseCheckConstraints_.end(), constraint)
+ != attenuateFalseCheckConstraints_.end())) {
+ return true;
+ }
+ return false;
+}
+
+bool
+RBAAllocatable::isChecked() const
+{
+ return checked_;
+}
+
+void
+RBAAllocatable::setChecked(const bool checked)
+{
+ checked_ = checked;
+}
+
+bool
+RBAAllocatable::isHiddenChecked() const
+{
+ return hiddenChecked_;
+}
+
+void
+RBAAllocatable::setHiddenChecked(const bool hiddenChecked)
+{
+ hiddenChecked_ = hiddenChecked;
+}
+
+bool
+RBAAllocatable::isAttenuateChecked() const
+{
+ return attenuateChecked_;
+}
+
+void
+RBAAllocatable::setAttenuateChecked(const bool attenuateChecked)
+{
+ this->attenuateChecked_ = attenuateChecked;
+}
+
+bool
+RBAAllocatable::isAttenuated() const
+{
+ return attenuated_;
+}
+
+void
+RBAAllocatable::setAttenuated(const bool attenuated)
+{
+ this->attenuated_ = attenuated;
+}
+
+bool
+RBAAllocatable::isHidden() const
+{
+ return hidden_;
+}
+
+void
+RBAAllocatable::setHidden(const bool hidden)
+{
+ hidden_ = hidden;
+}
+
+const RBAContentState*
+RBAAllocatable::getState() const
+{
+ return state_;
+}
+
+void
+RBAAllocatable::setState(const RBAContentState* const state)
+{
+ state_ = state;
+}
+
+#ifdef RBA_USE_LOG
+std::string
+RBAAllocatable::getSymbol() const
+{
+ // This function is never called because the function of the derived class
+ // is called.
+ return "Allocatable";
+}
+
+std::string
+RBAAllocatable::getHiddenSymbol() const
+{
+ // This function is never called because the function of the derived class
+ // is called.
+ return "Allocatable: Unsuppored operation exception";
+}
+
+std::string
+RBAAllocatable::getArbitrationPolicyString() const
+{
+ std::string res;
+ switch(arbitrationPolicy_) {
+ case RBAArbitrationPolicy::FIRST_COME_FIRST:
+ res = "FIRST_COME_FIRST";
+ break;
+ case RBAArbitrationPolicy::LAST_COME_FIRST:
+ res = "LAST_COME_FIRST";
+ break;
+ case RBAArbitrationPolicy::PRIORITY_FIRST_COME_FIRST:
+ res = "PRIORITY_FIRST_COME_FIRST";
+ break;
+ case RBAArbitrationPolicy::PRIORITY_LAST_COME_FIRST:
+ res = "PRIORITY_LAST_COME_FIRST";
+ break;
+ default:
+ res = "DEFAULT";
+ break;
+ }
+
+ return res;
+}
+
+std::string
+RBAAllocatable::getVisibilityString() const
+{
+ return std::to_string(visibility_);
+}
+#endif
+
+void
+RBAAllocatable::addConstraintImpl(RBAConstraintImpl* const constraint,
+ std::list<RBAConstraintImpl*>& constraints)
+{
+ if (std::find(constraints.begin(), constraints.end(), constraint)
+ == constraints.end()) {
+ constraints.push_back(constraint);
+ }
+}
+
+}
diff --git a/src/core/model/RBAAllocatable.hpp b/src/core/model/RBAAllocatable.hpp
new file mode 100644
index 0000000..c44d643
--- /dev/null
+++ b/src/core/model/RBAAllocatable.hpp
@@ -0,0 +1,131 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Allocatable class header
+ */
+
+#ifndef RBAALLOCATABLE_HPP
+#define RBAALLOCATABLE_HPP
+
+#include "RBAAbstractAllocatable.hpp"
+#include "RBAArbitrationPolicy.hpp"
+
+namespace rba
+{
+
+class RBAViewContent;
+class RBANotificationChain;
+class RBAContentState;
+class RBAConstraintImpl;
+enum class RBAConstraintMap : std::uint8_t;
+
+class DLL_EXPORT RBAAllocatable : public RBAAbstractAllocatable
+{
+public:
+ explicit RBAAllocatable(const std::string& name="");
+ RBAAllocatable(const RBAAllocatable&)=delete;
+ RBAAllocatable(const RBAAllocatable&&)=delete;
+ RBAAllocatable& operator=(const RBAAllocatable&)=delete;
+ RBAAllocatable& operator=(const RBAAllocatable&&)=delete;
+ virtual ~RBAAllocatable()=default;
+
+public:
+ void clearStatus() override;
+ virtual bool isArea() const;
+ virtual bool isZone() const;
+ RBAArbitrationPolicy getAllocatableArbitrationPolicy() const;
+ void setArbitrationPolicy(const RBAArbitrationPolicy newPolicy);
+ std::int32_t getVisibility() const;
+ void setVisibility(const std::int32_t newVisibility);
+ const std::list<const RBAAllocatable*>& getAllocatablesAffectedByYou() const;
+ void clearAllocatablesAffectedByYou();
+ void addAllocatableWhichHasBeenAffectedByYou(const RBAAllocatable* const allocatable);
+ void removeAffectAllocatable(const RBAAllocatable* const allocatable);
+ void clearAffectAllocatable();
+ virtual void clearChecked();
+ std::int32_t getIndex() const;
+ void setIndex(const std::int32_t newIndex);
+
+ static bool compare(const RBAAllocatable* const arg0, const RBAAllocatable* const arg1);
+ static bool compareIndex(const RBAAllocatable* const arg0, const RBAAllocatable* const arg1);
+ const static RBAArbitrationPolicy ARBITRATION_POLICY_EDEFAULT =
+ RBAArbitrationPolicy::DEFAULT;
+ void addConstraint(RBAConstraintImpl* const constraint, const RBAConstraintMap& kind);
+ std::list<RBAConstraintImpl*>& getConstraints();
+ std::list<RBAConstraintImpl*>& getHiddenTrueCheckConstraints();
+ std::list<RBAConstraintImpl*>& getHiddenFalseCheckConstraints();
+ std::list<RBAConstraintImpl*>& getAttenuateTrueCheckConstraints();
+ std::list<RBAConstraintImpl*>& getAttenuateFalseCheckConstraints();
+ bool hasConstraint(const RBAConstraintImpl* const constraint) const;
+
+ bool isChecked() const;
+ void setChecked(const bool checked);
+ bool isHiddenChecked() const;
+ void setHiddenChecked(const bool hiddenChecked);
+ bool isAttenuateChecked() const;
+ void setAttenuateChecked(const bool attenuateChecked=false);
+ bool isAttenuated() const;
+ void setAttenuated(const bool attenuated=false);
+ bool isHidden() const;
+ void setHidden(const bool hidden=false);
+ const RBAContentState* getState() const;
+ void setState(const RBAContentState* const state);
+
+ // Log
+#ifdef RBA_USE_LOG
+ virtual std::string getSymbol() const;
+ virtual std::string getHiddenSymbol() const;
+ std::string getArbitrationPolicyString() const;
+ std::string getVisibilityString() const;
+#endif
+
+ private:
+ void addConstraintImpl(RBAConstraintImpl* const constraint,
+ std::list<RBAConstraintImpl*>& constraints);
+
+protected:
+ // Zone should be a Z-order below the minimum Area
+ const static std::int32_t ZONE_ZORDER = -2;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<const RBAAllocatable*> allocatablesAffectedByThisAllocatable_;
+ std::list<RBAConstraintImpl*> constraints_;
+ std::list<RBAConstraintImpl*> hiddenTrueCheckConstraints_;
+ std::list<RBAConstraintImpl*> hiddenFalseCheckConstraints_;
+ std::list<RBAConstraintImpl*> attenuateTrueCheckConstraints_;
+ std::list<RBAConstraintImpl*> attenuateFalseCheckConstraints_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+ RBAArbitrationPolicy arbitrationPolicy_{ARBITRATION_POLICY_EDEFAULT};
+ std::int32_t visibility_ {0};
+ std::int32_t index_ {0};
+ const RBAContentState * state_ {nullptr};
+ bool hiddenChecked_ {false};
+ bool checked_ {false};
+ bool attenuateChecked_ {false};
+ bool hidden_ {false};
+ bool attenuated_ {false};
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAAllocatableMaker.cpp b/src/core/model/RBAAllocatableMaker.cpp
new file mode 100644
index 0000000..f59813b
--- /dev/null
+++ b/src/core/model/RBAAllocatableMaker.cpp
@@ -0,0 +1,82 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAllocatableMaker.cpp
+/// @brief Allocatable object generator abstract class implementation
+
+#include <iostream>
+#include "RBAAllocatableMaker.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAAllocatableMaker::RBAAllocatableMaker(const std::string& label)
+ : RBARuleObjectMaker{label},
+ RBAAbstractAllocatableMaker{label}
+{
+}
+
+RBAModelElement*
+RBAAllocatableMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBAAbstractAllocatableMaker::setProperty(element, jsonElem, model, owner));
+
+ const auto alloc = dynamic_cast<RBAAllocatable*>(element);
+
+ // Set policy
+ const RBAJsonElement* const policy {jsonElem->findChildren("arbitrationPolicy")};
+ if(policy == nullptr) {
+ std::cerr << alloc->getElementName()
+ << ": arbitrationPolicy not found" << &std::endl;
+ return nullptr;
+ }
+ alloc->setArbitrationPolicy(policy->getArbitrationPolicy());
+
+ // Set visibility or priority
+ if (alloc->isArea()) {
+ const RBAJsonElement* const visibility {jsonElem->findChildren("visibility")};
+ if(visibility == nullptr) {
+ std::cerr << alloc->getElementName()
+ << ": visibility not found" << &std::endl;
+ return nullptr;
+ }
+ alloc->setVisibility(visibility->getInt());
+ } else if (alloc->isZone()) {
+ const RBAJsonElement* const priority {jsonElem->findChildren("priority")};
+ if(priority == nullptr) {
+ std::cerr << alloc->getElementName()
+ << ": priority not found" << &std::endl;
+ return nullptr;
+ }
+ alloc->setVisibility(priority->getInt());
+ } else {
+ ;
+ }
+
+ model->addAllocatable(alloc);
+
+ return alloc;
+}
+
+}
diff --git a/src/core/model/RBAAllocatableMaker.hpp b/src/core/model/RBAAllocatableMaker.hpp
new file mode 100644
index 0000000..f4393cb
--- /dev/null
+++ b/src/core/model/RBAAllocatableMaker.hpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAllocatableMaker.cpp
+/// @brief Allocatable object generator abstract class header
+
+#ifndef RBAALLOCATABLEMAKER_HPP
+#define RBAALLOCATABLEMAKER_HPP
+
+#include "RBAAbstractAllocatableMaker.hpp"
+
+namespace rba
+{
+
+/// @brief Allocatable object generator abstract class
+class DLL_EXPORT RBAAllocatableMaker
+ : public RBAAbstractAllocatableMaker
+{
+public:
+ explicit RBAAllocatableMaker(const std::string& label="");
+ RBAAllocatableMaker(const RBAAllocatableMaker&)=delete;
+ RBAAllocatableMaker(const RBAAllocatableMaker&&)=delete;
+ RBAAllocatableMaker& operator=(const RBAAllocatableMaker&)=delete;
+ RBAAllocatableMaker& operator=(const RBAAllocatableMaker&&)=delete;
+ virtual ~RBAAllocatableMaker()=default;
+
+protected:
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAAllocatableSet.cpp b/src/core/model/RBAAllocatableSet.cpp
new file mode 100644
index 0000000..c545417
--- /dev/null
+++ b/src/core/model/RBAAllocatableSet.cpp
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AllocatableSet class implementation
+ */
+
+#include "RBAAllocatableSet.hpp"
+#include "RBAAllocatable.hpp"
+
+namespace rba
+{
+
+RBAAllocatableSet::RBAAllocatableSet(const std::string& name)
+ : RBARuleObject{name},
+ RBAAbstractAllocatable{name}
+{
+}
+
+void
+RBAAllocatableSet::addTarget(const RBAAllocatable* alloc)
+{
+ leafAllocatable_.push_back(alloc);
+#ifdef RBA_USE_LOG
+ std::string newName = "[";
+ for (auto& a : leafAllocatable_) {
+ newName += a->getElementName() + ",";
+ }
+ if (newName.size() != 1U) {
+ newName.erase(newName.end() - 1); // Remove the trailing ",".
+ }
+ newName += "]";
+ setDynamicName(newName);
+#endif
+}
+
+void
+RBAAllocatableSet::clear()
+{
+ leafAllocatable_.clear();
+#ifdef RBA_USE_LOG
+ setDynamicName("[]");
+#endif
+}
+
+const std::list<const RBAAllocatable*>&
+RBAAllocatableSet::getLeafAllocatable() const
+{
+ return leafAllocatable_;
+}
+
+}
diff --git a/src/core/model/RBAAllocatableSet.hpp b/src/core/model/RBAAllocatableSet.hpp
new file mode 100644
index 0000000..1c02155
--- /dev/null
+++ b/src/core/model/RBAAllocatableSet.hpp
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AllocatableSet class header
+ */
+
+#ifndef RBAALLOCATABLESET_HPP
+#define RBAALLOCATABLESET_HPP
+
+#include "RBAAbstractAllocatable.hpp"
+
+namespace rba
+{
+
+class RBAAllocatable;
+
+class DLL_EXPORT RBAAllocatableSet : public RBAAbstractAllocatable
+{
+public:
+ explicit RBAAllocatableSet(const std::string& name="");
+ RBAAllocatableSet(const RBAAllocatableSet&)=delete;
+ RBAAllocatableSet(const RBAAllocatableSet&&)=delete;
+ RBAAllocatableSet& operator=(const RBAAllocatableSet&)=delete;
+ RBAAllocatableSet& operator=(const RBAAllocatableSet&&)=delete;
+ virtual ~RBAAllocatableSet()=default;
+
+public:
+ virtual void addTarget(const RBAAllocatable* alloc);
+ virtual void clear();
+ const std::list<const RBAAllocatable*>& getLeafAllocatable() const;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<const RBAAllocatable*> leafAllocatable_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+#endif
diff --git a/src/core/model/RBAAllocatableSetMaker.cpp b/src/core/model/RBAAllocatableSetMaker.cpp
new file mode 100644
index 0000000..9b9922a
--- /dev/null
+++ b/src/core/model/RBAAllocatableSetMaker.cpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAllocatableSetMaker.cpp
+/// @brief AllocatableSet object genartor abstract class implementation
+
+#include <iostream>
+#include "RBAAllocatableSetMaker.hpp"
+#include "RBAAllocatableSet.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAAllocatableSetMaker::RBAAllocatableSetMaker(const std::string& label)
+ : RBARuleObjectMaker{label},
+ RBAAbstractAllocatableMaker{label}
+{
+}
+
+RBAModelElement*
+RBAAllocatableSetMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBAAbstractAllocatableMaker::setProperty(element, jsonElem, model, owner));
+
+ const auto allocSet = dynamic_cast<RBAAllocatableSet*>(element);
+
+ // Set target
+ const RBAJsonElement* const target {jsonElem->findChildren("target")};
+ for(const auto& targetElem : target->getChildren()) {
+ const auto alloc = model->findAllocatable(targetElem->getName());
+ allocSet->addTarget(alloc);
+ }
+
+ return allocSet;
+}
+
+}
diff --git a/src/core/model/RBAAllocatableSetMaker.hpp b/src/core/model/RBAAllocatableSetMaker.hpp
new file mode 100644
index 0000000..619d220
--- /dev/null
+++ b/src/core/model/RBAAllocatableSetMaker.hpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAllocatableSetMaker.cpp
+/// @brief AllocatableSet object genartor abstract class header
+
+#ifndef RBAALLOCATABLESETMAKER_HPP
+#define RBAALLOCATABLESETMAKER_HPP
+
+#include "RBAAbstractAllocatableMaker.hpp"
+
+namespace rba
+{
+
+/// @brief AllocatableSet object genartor abstract class
+class RBAAllocatableSetMaker : public RBAAbstractAllocatableMaker
+{
+public:
+ explicit RBAAllocatableSetMaker(const std::string& label="");
+ RBAAllocatableSetMaker(const RBAAllocatableSetMaker&)=delete;
+ RBAAllocatableSetMaker(const RBAAllocatableSetMaker&&)=delete;
+ RBAAllocatableSetMaker& operator=(const RBAAllocatableSetMaker&)=delete;
+ RBAAllocatableSetMaker& operator=(const RBAAllocatableSetMaker&&)=delete;
+ virtual ~RBAAllocatableSetMaker()=default;
+
+protected:
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAConstraint.hpp b/src/core/model/RBAConstraint.hpp
new file mode 100644
index 0000000..312bedc
--- /dev/null
+++ b/src/core/model/RBAConstraint.hpp
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Constraint class
+ */
+
+#ifndef RBACONSTRAINT_HPP
+#define RBACONSTRAINT_HPP
+
+#include <string>
+#include "RBADllExport.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAConstraint
+{
+ public:
+ RBAConstraint()=default;
+ RBAConstraint(const RBAConstraint&)=delete;
+ RBAConstraint(const RBAConstraint&&)=delete;
+ RBAConstraint& operator=(const RBAConstraint&)=delete;
+ RBAConstraint& operator=(const RBAConstraint&&)=delete;
+ virtual ~RBAConstraint() = default;
+ virtual std::string getName() const =0;
+ const static bool RUNTIME_EDEFAULT = true;
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAConstraintImpl.cpp b/src/core/model/RBAConstraintImpl.cpp
new file mode 100644
index 0000000..a634621
--- /dev/null
+++ b/src/core/model/RBAConstraintImpl.cpp
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Constraint Implementation class
+ */
+
+#include "RBAConstraintImpl.hpp"
+
+#include "RBAExpression.hpp"
+#include "RBALogManager.hpp"
+
+namespace rba
+{
+
+RBAConstraintImpl::RBAConstraintImpl(const std::string& name)
+ : RBAConstraint(),
+ RBAAbstractConstraint{name}
+{
+}
+
+void
+RBAConstraintImpl::setRuntime(const bool newRuntime)
+{
+ runtime_ = newRuntime;
+}
+
+std::string
+RBAConstraintImpl::getName() const
+{
+ return RBANamedElement::getElementName();
+}
+
+bool
+RBAConstraintImpl::isConstraint() const
+{
+ return true;
+}
+
+bool
+RBAConstraintImpl::isRuntime() const
+{
+ return runtime_;
+}
+
+bool
+RBAConstraintImpl::execute(RBAArbitrator* const arb)
+{
+ LOG_arbitrateConstraintLogicLogLine(" constraint expression["
+ + getExpression()->LOG_getExpressionText()
+ + "] check start");
+ LOG_initConstraintHierarchy();
+ LOG_coverageConstraintStartLog(this);
+
+ clearInfo();
+
+ bool res {getExpression()->execute(getInfo(), arb)};
+#ifdef RBA_USE_LOG
+ std::string log = " constraint expression[" + getExpression()->getExpressionText();
+
+ if (res == true) {
+ log += "] true";
+ } else {
+#endif
+ if (getInfo()->isExceptionBeforeArbitrate() == true) {
+#ifdef RBA_USE_LOG
+ log += "] before arbitrate skip";
+#endif
+ res = true;
+#ifdef RBA_USE_LOG
+ } else {
+ log += "] false";
+ }
+#endif
+ }
+ LOG_arbitrateConstraintLogicLogLine(log + "\n");
+
+ LOG_coverageConstraintEndLog(this);
+
+ return res;
+}
+
+}
diff --git a/src/core/model/RBAConstraintImpl.hpp b/src/core/model/RBAConstraintImpl.hpp
new file mode 100644
index 0000000..eb4d6ab
--- /dev/null
+++ b/src/core/model/RBAConstraintImpl.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Constraint Implementation class header
+ */
+
+#ifndef RBACONSTRAINTIMPL_HPP
+#define RBACONSTRAINTIMPL_HPP
+
+#include "RBAConstraint.hpp"
+#include "RBAAbstractConstraint.hpp"
+
+namespace rba
+{
+
+class RBAArbitrator;
+
+class DLL_EXPORT RBAConstraintImpl : public RBAConstraint,
+ public RBAAbstractConstraint
+{
+public:
+ explicit RBAConstraintImpl(const std::string& name="");
+ RBAConstraintImpl(const RBAConstraintImpl&)=delete;
+ RBAConstraintImpl(const RBAConstraintImpl&&)=delete;
+ RBAConstraintImpl& operator=(const RBAConstraintImpl&)=delete;
+ RBAConstraintImpl& operator=(const RBAConstraintImpl&&)=delete;
+ virtual ~RBAConstraintImpl()=default;
+
+public:
+ void setRuntime(const bool newRuntime);
+ std::string getName() const override;
+ bool isConstraint() const override;
+ bool isRuntime() const;
+ bool execute(RBAArbitrator* const arb);
+
+private:
+ bool runtime_ {RUNTIME_EDEFAULT};
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAConstraintMaker.cpp b/src/core/model/RBAConstraintMaker.cpp
new file mode 100644
index 0000000..7363c16
--- /dev/null
+++ b/src/core/model/RBAConstraintMaker.cpp
@@ -0,0 +1,63 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAConstraintMaker.cpp
+/// @brief Constraint object genartor class implementation
+
+#include "RBAConstraintMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAConstraintImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAConstraintMaker::RBAConstraintMaker()
+ : RBAAbstractConstraintMaker{"constraints"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAConstraintMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAConstraintImpl>(name);
+}
+
+RBAModelElement*
+RBAConstraintMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBAAbstractConstraintMaker::setProperty(element, jsonElem, model, owner));
+
+ const auto constraint = dynamic_cast<RBAConstraintImpl*>(element);
+
+ // Set runtime
+ bool runtime {false};
+ if(jsonElem->findChildren("runtime")->getString() == "true") {
+ runtime = true;
+ }
+ constraint->setRuntime(runtime);
+
+ model->addConstraint(constraint);
+
+ return constraint;
+}
+
+}
diff --git a/src/core/model/RBAConstraintMaker.hpp b/src/core/model/RBAConstraintMaker.hpp
new file mode 100644
index 0000000..4bcb250
--- /dev/null
+++ b/src/core/model/RBAConstraintMaker.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAConstraintMaker.jhp
+/// @brief Constraint object generator class header
+
+#ifndef RBACONSTRAINTMAKER_HPP
+#define RBACONSTRAINTMAKER_HPP
+
+#include "RBAAbstractConstraintMaker.hpp"
+
+namespace rba
+{
+
+/// @brief Constraint object generator class
+class RBAConstraintMaker : public RBAAbstractConstraintMaker
+{
+public:
+ RBAConstraintMaker();
+ RBAConstraintMaker(const RBAConstraintMaker&)=delete;
+ RBAConstraintMaker(const RBAConstraintMaker&&)=delete;
+ RBAConstraintMaker& operator=(const RBAConstraintMaker&)=delete;
+ RBAConstraintMaker& operator=(const RBAConstraintMaker&&)=delete;
+ virtual ~RBAConstraintMaker()=default;
+
+protected:
+ /// @brief Create an empty instance
+ /// @details Create an empty class of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAContent.cpp b/src/core/model/RBAContent.cpp
new file mode 100644
index 0000000..e2e3c9f
--- /dev/null
+++ b/src/core/model/RBAContent.cpp
@@ -0,0 +1,107 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Content class
+ */
+
+#include "RBAContent.hpp"
+#include "RBAResultImpl.hpp"
+#include "RBAResultSet.hpp"
+#include "RBAExpression.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+RBAContent::RBAContent(const std::string& name)
+ : RBARuleObject{name},
+ RBAAbstractContent{name}
+{
+}
+
+bool
+RBAContent::isViewContent() const
+{
+ return false;
+}
+
+bool
+RBAContent::isSoundContent() const
+{
+ return false;
+}
+
+const std::list<const RBAContentState*>&
+RBAContent::getStates() const
+{
+ return states_;
+}
+
+void
+RBAContent::addState(const RBAContentState* const state)
+{
+ states_.push_back(state);
+}
+
+const std::list<const RBAAllocatable*>&
+RBAContent::getAllocatables() const
+{
+ return allocatableSet_->getLeafAllocatable();
+}
+
+void
+RBAContent::addAllocatable(const RBAAllocatable* const alloc)
+{
+ allocatableSet_->addTarget(alloc);
+}
+
+RBAContentLoserType
+RBAContent::getContentLoserType() const
+{
+ return loserType_;
+}
+
+void
+RBAContent::setLoserType(const RBAContentLoserType newLoserType)
+{
+ loserType_ = newLoserType;
+}
+
+const RBAAllocatableSet*
+RBAContent::getAllocatableSet() const
+{
+ return allocatableSet_.get();
+}
+
+void RBAContent::updateRequestStatus(RBAResultSet* const resultset, const bool isOnRequest)
+{
+ resultset->updateRequestStatus(this, isOnRequest);
+}
+
+void RBAContent::updateStatus(RBAResultImpl* const result)
+{
+ result->updateStatus(this);
+}
+
+const std::list<const RBASize*>&
+RBAContent::getSizes() const
+{
+ static const std::list<const RBASize*> sizes;
+ return sizes;
+}
+
+}
diff --git a/src/core/model/RBAContent.hpp b/src/core/model/RBAContent.hpp
new file mode 100644
index 0000000..17e912c
--- /dev/null
+++ b/src/core/model/RBAContent.hpp
@@ -0,0 +1,87 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Content class header
+ */
+
+#ifndef RBACONTENT_HPP
+#define RBACONTENT_HPP
+
+#include <memory>
+#include <set>
+#include "RBAAbstractContent.hpp"
+#include "RBAAllocatableSet.hpp"
+#include "RBAContentLoserType.hpp"
+
+namespace rba
+{
+
+class RBAArbitrator;
+class RBAAllocatable;
+class RBAContentState;
+class RBAResultImpl;
+class RBAResultSet;
+class RBAExpression;
+class RBASize;
+
+class DLL_EXPORT RBAContent : public RBAAbstractContent
+{
+public:
+ explicit RBAContent(const std::string& name="");
+ RBAContent(const RBAContent&)=delete;
+ RBAContent(const RBAContent&&)=delete;
+ RBAContent& operator=(const RBAContent&)=delete;
+ RBAContent& operator=(const RBAContent&&)=delete;
+ virtual ~RBAContent()=default;
+
+public:
+ virtual bool isViewContent() const;
+ virtual bool isSoundContent() const;
+
+ const std::list<const RBAContentState*>& getStates() const;
+ void addState(const RBAContentState* const state);
+ const std::list<const RBAAllocatable*>& getAllocatables() const;
+ void addAllocatable(const RBAAllocatable* const alloc);
+ RBAContentLoserType getContentLoserType() const;
+ void setLoserType(const RBAContentLoserType newLoserType);
+ const RBAAllocatableSet* getAllocatableSet() const;
+ void updateRequestStatus(RBAResultSet* const resultset, const bool isOnRequest);
+ void updateStatus(RBAResultImpl* const result);
+ virtual const std::list<const RBASize*>& getSizes() const;
+
+#ifdef RBA_USE_LOG
+ virtual std::string getSymbol() const = 0;
+ virtual std::string getVisibleSymbol() const = 0;
+#endif
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<const RBAContentState*> states_;
+ std::unique_ptr<RBAAllocatableSet> allocatableSet_ {std::make_unique<RBAAllocatableSet>()};
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+ RBAContentLoserType loserType_ {RBAContentLoserType::DO_NOT_GIVEUP_UNTIL_WIN};
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAContentMaker.cpp b/src/core/model/RBAContentMaker.cpp
new file mode 100644
index 0000000..a9828ba
--- /dev/null
+++ b/src/core/model/RBAContentMaker.cpp
@@ -0,0 +1,126 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAContentMaker.cpp
+/// @brief Content obecjt generator abstract class
+
+#include <iostream>
+#include "RBAContentMaker.hpp"
+#include "RBAContent.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAViewContentStateMaker.hpp"
+#include "RBASoundContentStateMaker.hpp"
+
+namespace rba
+{
+
+RBAContentMaker::RBAContentMaker(const std::string& label)
+ : RBARuleObjectMaker{label},
+ RBAAbstractContentMaker{label}
+{
+}
+
+RBAModelElement*
+RBAContentMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBAAbstractContentMaker::setProperty(element, jsonElem, model, owner));
+
+ RBAContent* const content {dynamic_cast<RBAContent*>(element)};
+
+ // loserType
+ const RBAJsonElement* const loserTypeElem {jsonElem->findChildren("loserType")};
+ if(loserTypeElem == nullptr) {
+ std::cerr << content->getElementName()
+ << ": loserType not found" << &std::endl;
+ return nullptr;
+ }
+ content->setLoserType(loserTypeElem->getLoserType());
+
+ // allocatable
+ for(auto& allocElem : jsonElem->findChildren("allocatable")->getChildren()) {
+ const auto str = allocElem->getName();
+ std::string allocName {""};
+ std::string className {""};
+ if (str.find(':') != std::string::npos) {
+ allocName = str.substr(0U, str.find(':'));
+ className = str.substr(str.find(':') + 1U);
+ } else {
+ allocName = str;
+ }
+
+ auto alloc = model->findAllocatable(allocName);
+ if (alloc == nullptr) {
+ alloc = dynamic_cast<RBAAllocatable*>(getMaker(className)->getInstance(model, allocName));
+ }
+ const_cast<RBAAllocatable*>(alloc)->addContent(content);
+ content->addAllocatable(alloc);
+ }
+
+ // state
+ if (content->isViewContent()) {
+ RBAViewContentStateMaker csMaker;
+ for(const auto& state : jsonElem->findChildren("states")->getChildren()) {
+ RBAModelElement* const s {csMaker.create(state.get(), model, content)};
+ content->addMember(dynamic_cast<RBARuleObject*>(s));
+ content->addState(dynamic_cast<RBAContentState*>(s));
+ }
+ }
+ else if (content->isSoundContent()) {
+ RBASoundContentStateMaker csMaker;
+ for(const auto& state : jsonElem->findChildren("states")->getChildren()) {
+ RBAModelElement* const s {csMaker.create(state.get(), model, content)};
+ content->addMember(dynamic_cast<RBARuleObject*>(s));
+ content->addState(dynamic_cast<RBAContentState*>(s));
+ }
+ }
+ // Expand Content
+ else {
+ auto alloc = content->getAllocatables().front();
+ // Seek until it becomes an Area or Zone
+ while (!alloc->isArea() && !alloc->isZone()) {
+ alloc = dynamic_cast<const RBAContent*>(alloc)->getAllocatables().front();
+ }
+ if (alloc->isArea()) {
+ RBAViewContentStateMaker csMaker;
+ for(const auto& state : jsonElem->findChildren("states")->getChildren()) {
+ RBAModelElement* const s {csMaker.create(state.get(), model, content)};
+ content->addMember(dynamic_cast<RBARuleObject*>(s));
+ content->addState(dynamic_cast<RBAContentState*>(s));
+ }
+ } else if (alloc->isZone()) {
+ RBASoundContentStateMaker csMaker;
+ for(const auto& state : jsonElem->findChildren("states")->getChildren()) {
+ RBAModelElement* const s {csMaker.create(state.get(), model, content)};
+ content->addMember(dynamic_cast<RBARuleObject*>(s));
+ content->addState(dynamic_cast<RBAContentState*>(s));
+ }
+ } else {
+ ;
+ }
+ }
+
+ model->addContent(content);
+
+ return content;
+}
+
+}
diff --git a/src/core/model/RBAContentMaker.hpp b/src/core/model/RBAContentMaker.hpp
new file mode 100644
index 0000000..5564fc1
--- /dev/null
+++ b/src/core/model/RBAContentMaker.hpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAContentMaker.hpp
+/// @brief Content obecjt generator class header
+
+#ifndef RBACONTENTMAKER_HPP
+#define RBACONTENTMAKER_HPP
+
+#include "RBAAbstractContentMaker.hpp"
+
+namespace rba
+{
+
+/// @brief Content obecjt generator class
+class DLL_EXPORT RBAContentMaker : public RBAAbstractContentMaker
+{
+public:
+ explicit RBAContentMaker(const std::string& label="");
+ RBAContentMaker(const RBAContentMaker&)=delete;
+ RBAContentMaker(const RBAContentMaker&&)=delete;
+ RBAContentMaker& operator=(const RBAContentMaker&)=delete;
+ RBAContentMaker& operator=(const RBAContentMaker&&)=delete;
+ virtual ~RBAContentMaker()=default;
+
+protected:
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAContentSet.cpp b/src/core/model/RBAContentSet.cpp
new file mode 100644
index 0000000..00da62e
--- /dev/null
+++ b/src/core/model/RBAContentSet.cpp
@@ -0,0 +1,66 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * ContentSet class
+ */
+
+#include <string>
+#include "RBAContentSet.hpp"
+#include "RBAContent.hpp"
+
+namespace rba
+{
+
+RBAContentSet::RBAContentSet(const std::string& name)
+ : RBARuleObject{name},
+ RBAAbstractContent{name}
+{
+}
+
+void
+RBAContentSet::addTarget(const RBAContent* content)
+{
+ leafContent_.push_back(content);
+#ifdef RBA_USE_LOG
+ std::string newName = "[";
+ for (auto& c : leafContent_) {
+ newName += c->getElementName() + ",";
+ }
+ if (newName.size() != 1U) {
+ newName.erase(newName.end() - 1); // Remove the trailing ","
+ }
+ newName += "]";
+ setDynamicName(newName);
+#endif
+}
+
+void
+RBAContentSet::clear()
+{
+ leafContent_.clear();
+#ifdef RBA_USE_LOG
+ setDynamicName("[]");
+#endif
+}
+
+const std::list<const RBAContent*>&
+RBAContentSet::getLeafContent() const
+{
+ return leafContent_;
+}
+
+}
diff --git a/src/core/model/RBAContentSet.hpp b/src/core/model/RBAContentSet.hpp
new file mode 100644
index 0000000..3997f07
--- /dev/null
+++ b/src/core/model/RBAContentSet.hpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ContentSet class header
+ */
+
+#ifndef RBACONTENTSET_HPP
+#define RBACONTENTSET_HPP
+
+#include <list>
+#include "RBAAbstractContent.hpp"
+
+namespace rba
+{
+
+class RBAContent;
+
+class DLL_EXPORT RBAContentSet : public RBAAbstractContent
+{
+public:
+ explicit RBAContentSet(const std::string& name="");
+ RBAContentSet(const RBAContentSet&)=delete;
+ RBAContentSet(const RBAContentSet&&)=delete;
+ RBAContentSet& operator=(const RBAContentSet&)=delete;
+ RBAContentSet& operator=(const RBAContentSet&&)=delete;
+ virtual ~RBAContentSet()=default;
+
+public:
+ virtual void addTarget(const RBAContent* content);
+ virtual void clear();
+ const std::list<const RBAContent*>& getLeafContent() const;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<const RBAContent*> leafContent_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAContentSetMaker.cpp b/src/core/model/RBAContentSetMaker.cpp
new file mode 100644
index 0000000..cbc8db9
--- /dev/null
+++ b/src/core/model/RBAContentSetMaker.cpp
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAContentSetMaker.cpp
+/// @brief ContentSet object generator class
+
+#include "RBAContentSetMaker.hpp"
+#include "RBAContentSet.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAContentSetMaker::RBAContentSetMaker(const std::string& label)
+ : RBARuleObjectMaker{label},
+ RBAAbstractContentMaker{label}
+{
+}
+
+RBAModelElement*
+RBAContentSetMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBAAbstractContentMaker::setProperty(element, jsonElem, model, owner));
+
+ const auto contentSet = dynamic_cast<RBAContentSet*>(element);
+
+ // content
+ for(const auto& content : jsonElem->findChildren("target")->getChildren()) {
+ const auto cont = model->findContent(content->getName());
+ contentSet->addTarget(cont);
+ }
+
+ return contentSet;
+}
+
+}
diff --git a/src/core/model/RBAContentSetMaker.hpp b/src/core/model/RBAContentSetMaker.hpp
new file mode 100644
index 0000000..182764c
--- /dev/null
+++ b/src/core/model/RBAContentSetMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAContentSetMaker.hpp
+/// @brief ContentSet object generator class header
+
+#ifndef RBACONTENTSETMAKER_HPP
+#define RBACONTENTSETMAKER_HPP
+
+#include "RBAAbstractContentMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ContentSet object generator class
+class RBAContentSetMaker : public RBAAbstractContentMaker
+{
+public:
+ explicit RBAContentSetMaker(const std::string& label="");
+ RBAContentSetMaker(const RBAContentSetMaker&)=delete;
+ RBAContentSetMaker(const RBAContentSetMaker&&)=delete;
+ RBAContentSetMaker& operator=(const RBAContentSetMaker&)=delete;
+ RBAContentSetMaker& operator=(const RBAContentSetMaker&&)=delete;
+ virtual ~RBAContentSetMaker()=default;
+
+protected:
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAContentState.cpp b/src/core/model/RBAContentState.cpp
new file mode 100644
index 0000000..f149129
--- /dev/null
+++ b/src/core/model/RBAContentState.cpp
@@ -0,0 +1,133 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+]
+/**
+ * ContentState class
+ */
+
+#include <string>
+
+#include "RBAViewContentState.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentState.hpp"
+
+namespace rba
+{
+
+RBAContentState::RBAContentState(const std::string& name)
+ : RBARuleObject{name}
+{
+}
+
+void
+RBAContentState::clearStatus()
+{
+ order_ = 0;
+}
+
+bool
+RBAContentState::isViewContentState() const
+{
+ return false;
+}
+
+bool
+RBAContentState::isSoundContentState() const
+{
+ return false;
+}
+
+std::string
+RBAContentState::getUniqueName() const
+{
+ return getOwner()->getElementName() + RBAViewContentState::CONTEXT_SEPARATER + getElementName();
+}
+
+std::int32_t
+RBAContentState::getContentStatePriority() const
+{
+ return priority_;
+}
+
+void
+RBAContentState::setPriority(const std::int32_t newPriority)
+{
+ priority_ = newPriority;
+}
+
+std::int32_t
+RBAContentState::getContentStateOrder() const
+{
+ return order_;
+}
+
+void
+RBAContentState::setOrder(const std::int32_t newOrder)
+{
+ order_ = newOrder;
+}
+
+bool
+RBAContentState::compareFirstComeFirst(const RBAContentState* const lhs,
+ const RBAContentState* const rhs)
+{
+ return lhs->getContentStateOrder() < rhs->getContentStateOrder();
+}
+
+bool
+RBAContentState::compareLastComeFirst(const RBAContentState* const lhs,
+ const RBAContentState* const rhs)
+{
+ return lhs->getContentStateOrder() > rhs->getContentStateOrder();
+}
+
+bool
+RBAContentState::comparePriorityFirstComeFirst(const RBAContentState* const lhs,
+ const RBAContentState* const rhs)
+{
+ if(lhs->getContentStatePriority() == rhs->getContentStatePriority()) {
+ return compareFirstComeFirst(lhs, rhs);
+ }
+ else {
+ return lhs->getContentStatePriority() > rhs->getContentStatePriority();
+ }
+}
+
+bool
+RBAContentState::comparePriorityLastComeFirst(const RBAContentState* const lhs,
+ const RBAContentState* const rhs)
+{
+ if(lhs->getContentStatePriority() == rhs->getContentStatePriority()) {
+ return compareLastComeFirst(lhs, rhs);
+ }
+ else {
+ return lhs->getContentStatePriority() > rhs->getContentStatePriority();
+ }
+}
+
+const std::string
+RBAContentState::getPriorityString() const
+{
+ return std::to_string(priority_);
+}
+
+const std::string
+RBAContentState::getOrderString() const
+{
+ return std::to_string(order_);
+}
+
+}
diff --git a/src/core/model/RBAContentState.hpp b/src/core/model/RBAContentState.hpp
new file mode 100644
index 0000000..7d4a81f
--- /dev/null
+++ b/src/core/model/RBAContentState.hpp
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * ContentState class header
+ */
+
+#ifndef RBACONTENTSTATE_HPP
+#define RBACONTENTSTATE_HPP
+
+#include <cstdint>
+#include "RBARuleObject.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAContentState : public RBARuleObject
+{
+protected:
+ explicit RBAContentState(const std::string& name);
+ RBAContentState(const RBAContentState&)=delete;
+ RBAContentState(const RBAContentState&&)=delete;
+ RBAContentState& operator=(const RBAContentState&)=delete;
+ RBAContentState& operator=(const RBAContentState&&)=delete;
+
+public:
+ virtual ~RBAContentState()=default;
+
+public:
+ void clearStatus() final;
+ virtual bool isViewContentState() const;
+ virtual bool isSoundContentState() const;
+
+ std::string getUniqueName() const override;
+ std::int32_t getContentStatePriority() const;
+ void setPriority(const std::int32_t newPriority);
+ std::int32_t getContentStateOrder() const;
+ void setOrder(const std::int32_t newOrder);
+
+ static bool compareFirstComeFirst(const RBAContentState* const lhs,
+ const RBAContentState* const rhs);
+ static bool compareLastComeFirst(const RBAContentState* const lhs,
+ const RBAContentState* const rhs);
+ static bool comparePriorityFirstComeFirst(const RBAContentState* const lhs,
+ const RBAContentState* const rhs);
+ static bool comparePriorityLastComeFirst(const RBAContentState* const lhs,
+ const RBAContentState* const rhs);
+
+ // Log
+ const std::string getPriorityString() const;
+ const std::string getOrderString() const;
+
+private:
+ std::int32_t priority_ {0};
+ std::int32_t order_ {0};
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAContentStateMaker.cpp b/src/core/model/RBAContentStateMaker.cpp
new file mode 100644
index 0000000..92129ef
--- /dev/null
+++ b/src/core/model/RBAContentStateMaker.cpp
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAContentStateMaker.cpp
+/// @brief ContentState object generator abstract class
+
+#include "RBAContentStateMaker.hpp"
+#include "RBAContentState.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+RBAContentStateMaker::RBAContentStateMaker(const std::string& label)
+ : RBARuleObjectMaker{label}
+{
+}
+
+RBAModelElement*
+RBAContentStateMaker::getInstance(RBAModelImpl* model,
+ const std::string& name,
+ RBAModelElement* owner)
+{
+ RBAModelElement* ret {nullptr};
+
+ const auto content = dynamic_cast<RBAContent*>(owner);
+ const auto uniqueName = content->getUniqueName() + "/" + name;
+
+ const auto element = model->findModelElement(uniqueName);
+ // exists in model
+ if(element != nullptr) {
+ ret = const_cast<RBAModelElement*>(element);
+ }
+ // not exists in modelmodel
+ else {
+ std::unique_ptr<RBAModelElement> inst {createInstance(name)};
+ const auto contentState = dynamic_cast<RBAContentState*>(inst.get());
+ contentState->setOwner(content);
+ ret = model->addNamedElement(std::move(inst));
+ }
+
+ return ret;
+}
+
+RBAModelElement*
+RBAContentStateMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBARuleObjectMaker::setProperty(element, jsonElem, model, owner));
+
+ RBAContentState* const state {dynamic_cast<RBAContentState*>(element)};
+
+ // Set priority
+ state->setPriority(jsonElem->findChildren("priority")->getInt());
+
+ model->addContentState(state);
+
+ return state;
+}
+
+}
diff --git a/src/core/model/RBAContentStateMaker.hpp b/src/core/model/RBAContentStateMaker.hpp
new file mode 100644
index 0000000..4082739
--- /dev/null
+++ b/src/core/model/RBAContentStateMaker.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAContentStateMaker.hpp
+/// @brief ContentState object generator abstract class header
+
+#ifndef RBACONTENTSTATEMAKER_HPP
+#define RBACONTENTSTATEMAKER_HPP
+
+#include "RBARuleObjectMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ContentState object generator abstract class
+class RBAContentStateMaker : public RBARuleObjectMaker
+{
+public:
+ explicit RBAContentStateMaker(const std::string& label);
+ RBAContentStateMaker(const RBAContentStateMaker&)=delete;
+ RBAContentStateMaker(const RBAContentStateMaker&&)=delete;
+ RBAContentStateMaker& operator=(const RBAContentStateMaker&)=delete;
+ RBAContentStateMaker& operator=(const RBAContentStateMaker&&)=delete;
+ virtual ~RBAContentStateMaker()=default;
+
+public:
+
+ RBAModelElement* getInstance(RBAModelImpl* model,
+ const std::string& name="",
+ RBAModelElement* owner=nullptr) override;
+
+protected:
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAContentStatusType.hpp b/src/core/model/RBAContentStatusType.hpp
new file mode 100644
index 0000000..d6cd161
--- /dev/null
+++ b/src/core/model/RBAContentStatusType.hpp
@@ -0,0 +1,36 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+// State transition type of content
+//
+
+#ifndef RBACONTENTSTATUSTYPE_HPP
+#define RBACONTENTSTATUSTYPE_HPP
+
+namespace rba
+{
+
+enum class RBAContentStatusType : std::uint8_t
+{
+ NoRequest,
+ Undisplayed,
+ Displayed,
+ StandBy,
+ Canceled
+};
+}
+
+#endif /* RBACONTENTSTATUSTYPE_HPP */
diff --git a/src/core/model/RBAIntegerProperty.cpp b/src/core/model/RBAIntegerProperty.cpp
new file mode 100644
index 0000000..aeee3b0
--- /dev/null
+++ b/src/core/model/RBAIntegerProperty.cpp
@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /**
+ * Integer property class
+ */
+
+#include "RBAIntegerProperty.hpp"
+#include "RBASceneImpl.hpp"
+
+namespace rba
+{
+
+RBAIntegerProperty::RBAIntegerProperty(const RBASceneImpl* const scene,
+ const std::string& newName,
+ const std::int32_t newValue)
+ : RBAAbstractProperty{scene, newName},
+ value_{newValue}
+{
+}
+
+std::int32_t
+RBAIntegerProperty::getValue() const
+{
+ return value_;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIntegerProperty::getExpressionText() const
+{
+ return getScene()->getElementName() + "." + getElementName();
+}
+#endif
+
+}
diff --git a/src/core/model/RBAIntegerProperty.hpp b/src/core/model/RBAIntegerProperty.hpp
new file mode 100644
index 0000000..f174f0a
--- /dev/null
+++ b/src/core/model/RBAIntegerProperty.hpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /**
+ * Integer property class header
+ */
+
+#ifndef RBAINTEGERPROPERTY_HPP
+#define RBAINTEGERPROPERTY_HPP
+
+#include "RBAAbstractProperty.hpp"
+
+namespace rba
+{
+
+class RBAIntegerProperty : public RBAAbstractProperty
+{
+public:
+ RBAIntegerProperty(const RBASceneImpl* const scene,
+ const std::string& newName, const std::int32_t newValue);
+ RBAIntegerProperty(const RBAIntegerProperty&)=delete;
+ RBAIntegerProperty(const RBAIntegerProperty&&)=delete;
+ RBAIntegerProperty& operator=(const RBAIntegerProperty&)=delete;
+ RBAIntegerProperty& operator=(const RBAIntegerProperty&&)=delete;
+
+public:
+ std::int32_t getValue() const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+#endif
+
+private:
+ std::int32_t value_;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAModelElement.cpp b/src/core/model/RBAModelElement.cpp
new file mode 100644
index 0000000..b4308e5
--- /dev/null
+++ b/src/core/model/RBAModelElement.cpp
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ModelElment class
+ */
+
+#include "RBAModelElement.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void RBAModelElement::clearStatus()
+{
+ // This function is called from a ModelElement that has no internal state
+ // to clear.
+ // The overridden function is called from the ModelElement
+ // that has the internal state to clear.
+}
+RBAModelElementType
+RBAModelElement::getModelElementType() const
+{
+ // This function is never called because the function of
+ // the derived class is called.
+ return RBAModelElementType::None;
+}
+
+bool
+RBAModelElement::isModelElementType(const RBAModelElementType elemType) const
+{
+ return (elemType == getModelElementType());
+}
+
+}
diff --git a/src/core/model/RBAModelElement.hpp b/src/core/model/RBAModelElement.hpp
new file mode 100644
index 0000000..7ee7557
--- /dev/null
+++ b/src/core/model/RBAModelElement.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ModelElment class header
+ */
+
+#ifndef RBAMODELELEMENT_HPP
+#define RBAMODELELEMENT_HPP
+
+#include <cstdint>
+#include "RBADllExport.hpp"
+
+namespace rba
+{
+
+enum class RBAModelElementType : std::uint8_t;
+
+class DLL_EXPORT RBAModelElement
+{
+protected:
+ RBAModelElement()=default;
+ RBAModelElement(const RBAModelElement&)=delete;
+ RBAModelElement(const RBAModelElement&&)=delete;
+ RBAModelElement& operator=(const RBAModelElement&)=delete;
+ RBAModelElement& operator=(const RBAModelElement&&)=delete;
+
+public:
+ virtual ~RBAModelElement()=default;
+
+public:
+ virtual void clearStatus();
+ virtual RBAModelElementType getModelElementType() const;
+ bool isModelElementType(const RBAModelElementType elemType) const;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAModelElementMaker.cpp b/src/core/model/RBAModelElementMaker.cpp
new file mode 100644
index 0000000..9d750c0
--- /dev/null
+++ b/src/core/model/RBAModelElementMaker.cpp
@@ -0,0 +1,122 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAModelElementMaker.cpp
+/// @brief ModelElement object genartor abstract class
+
+#include "RBAModelElementMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAModelImpl.hpp"
+
+namespace rba
+{
+
+std::unordered_map<std::string, std::unique_ptr<RBAModelElementMaker>> RBAModelElementMaker::makerMap_;
+
+RBAModelElementMaker::RBAModelElementMaker(const std::string& label)
+ : factory_{nullptr},
+ label_{label}
+{
+}
+
+void
+RBAModelElementMaker::setFactory(RBAModelFactory* const factory)
+{
+ factory_ = factory;
+}
+
+RBAModelFactory* RBAModelElementMaker::getFactory() const
+{
+ return factory_;
+}
+
+const std::string&
+RBAModelElementMaker::getLabel() const
+{
+ return label_;
+}
+
+RBAModelElement*
+RBAModelElementMaker::create(const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ const auto nameElement = jsonElem->findChildren("name");
+
+ RBAModelElement* element {nullptr};
+ if (nameElement != nullptr) {
+ element = getInstance(model, nameElement->getString(), owner);
+ } else {
+ element = getInstance(model, "", owner);
+ }
+
+ return setProperty(element, jsonElem, model, owner);
+}
+
+RBAModelElement*
+RBAModelElementMaker::getInstance(RBAModelImpl* model,
+ const std::string& name,
+ RBAModelElement* owner)
+{
+ RBAModelElement* ret {nullptr};
+
+ // If there is a class name, delete the class name
+ std::string fullName {name};
+ while (fullName.find(':') != std::string::npos) {
+ const auto start = fullName.find(':');
+ const auto end = fullName.find('/', start);
+ static_cast<void>(fullName.erase(start, end - start));
+ }
+
+ // In case of Elemetn with name
+   if(fullName != "") {
+ const auto elem = model->findModelElement(fullName);
+ // exists in model
+ if(elem != nullptr) {
+ ret = const_cast<RBAModelElement*>(elem);
+ }
+ // not exists in model
+ else {
+ std::unique_ptr<RBAModelElement> inst {createInstance(fullName)};
+ ret = model->addNamedElement(std::move(inst));
+ }
+ }
+ // In case of Elemetn without name
+ else {
+ std::unique_ptr<RBAModelElement> inst {createInstance()};
+ ret = model->addModelElement(std::move(inst));
+ }
+
+ return ret;
+}
+
+void
+RBAModelElementMaker::addMaker(const std::string& typeName, std::unique_ptr<RBAModelElementMaker> maker)
+{
+ makerMap_[typeName] = std::move(maker);
+}
+
+RBAModelElementMaker*
+RBAModelElementMaker::getMaker(const std::string& typeName)
+{
+ if (makerMap_.find(typeName) == makerMap_.end()) {
+ return nullptr;
+ }
+ return makerMap_[typeName].get();
+}
+
+}
diff --git a/src/core/model/RBAModelElementMaker.hpp b/src/core/model/RBAModelElementMaker.hpp
new file mode 100644
index 0000000..c038f5a
--- /dev/null
+++ b/src/core/model/RBAModelElementMaker.hpp
@@ -0,0 +1,135 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAModelElementMaker.hpp
+/// @brief ModelElement object genartor abstract class header
+
+#ifndef RBAMODELELEMENTMAKER_HPP
+#define RBAMODELELEMENTMAKER_HPP
+
+#include <memory>
+#include <string>
+#include "RBADllExport.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief ModelElement object genartor abstract class
+class DLL_EXPORT RBAModelElementMaker
+{
+public:
+ /// @brief Constructor that specifies the label
+ /// @details Set label and generate
+ /// @param[in] label labe to set
+ RBAModelElementMaker()=default;
+ explicit RBAModelElementMaker(const std::string& label);
+ virtual ~RBAModelElementMaker()=default;
+
+protected:
+ RBAModelElementMaker(const RBAModelElementMaker& maker)=delete;
+ RBAModelElementMaker& operator=(const RBAModelElementMaker& maker)=delete;
+ // Use "move" in RBAAbstractModelTable::addMaker()
+ RBAModelElementMaker(RBAModelElementMaker&&)=default;
+ RBAModelElementMaker& operator=(RBAModelElementMaker&&)=default;
+
+public:
+ /// @brief Set model factory
+ /// @param[in] factory model factory
+ void setFactory(RBAModelFactory* const factory);
+
+ /// @brief Get label
+ /// @details Returns the label of the corresponding JSON element
+ /// @return Label string
+ const std::string& getLabel() const;
+
+ /// @brief Create ModelElement object
+ /// @details create ModelElement object and register unique_ptr to model
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The moder to store created object
+ /// @param[in,out] owner Parent object (Not in use)
+ /// @return ModelElement object
+ virtual RBAModelElement* create(const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr);
+
+ /// @brief Get instance
+ /// @details Get the element corresponding to name from model.
+ /// If there is no name or it is not in model,
+ /// create an instance and register it in model.
+ /// @return ModelElement object
+ virtual RBAModelElement* getInstance(RBAModelImpl* model,
+ const std::string& name="",
+ RBAModelElement* owner=nullptr);
+
+ /// @brief Register Maker
+ /// @details Register the Maker corresponding to the class name
+ /// used in JSON in the map
+ /// @return void
+ static void addMaker(const std::string& typeName,
+ std::unique_ptr<RBAModelElementMaker> maker);
+
+ /// @brief Get Maker
+ /// @details Get the Maker corresponding to the class name from the map
+ /// @return Corresponding Maker. If it doesn't exist, return null.
+ static RBAModelElementMaker* getMaker(const std::string& typeName);
+
+protected:
+ /// @brief Create an empty instance
+ /// @details Create an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for instance
+ virtual std::unique_ptr<RBAModelElement> createInstance(const std::string& name="")=0;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ virtual RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr)=0;
+
+ /// @brief Get model factory
+ /// @details Get model factory
+ /// @return model factory
+ RBAModelFactory* getFactory() const;
+
+private:
+ /// @brief Factory for recursively generating objects
+ RBAModelFactory* factory_;
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ /// @brief Label of corresponding JSON element
+ const std::string label_;
+
+ /// @brief Correspondence map of each Maker and the character string that
+ /// represents the class used in JSON
+ static std::unordered_map<std::string, std::unique_ptr<RBAModelElementMaker>> makerMap_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAModelElementType.hpp b/src/core/model/RBAModelElementType.hpp
new file mode 100644
index 0000000..756f22b
--- /dev/null
+++ b/src/core/model/RBAModelElementType.hpp
@@ -0,0 +1,116 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ModelElementType class header
+ */
+
+#ifndef RBAMODELELEMENTTYPE_HPP
+#define RBAMODELELEMENTTYPE_HPP
+
+namespace rba
+{
+
+enum class RBAModelElementType : std::uint8_t
+{
+ AllInstanceOfArea,
+ AllInstanceOfViewContent,
+ AllInstanceOfZone,
+ AllInstanceOfSoundContent,
+ Allocatable,
+ AllocatedContent,
+ AndOperator,
+ Area,
+ AreaSet,
+ ArithmeticOperator,
+ Constraint,
+ ViewContent,
+ ViewContentSet,
+ ViewContentState,
+ ContentValue,
+ DisplayingContent,
+ ExistsOperator,
+ ForAllOperator,
+ GetAllocatables,
+ ActiveState,
+ ActiveContents,
+ GetContentsList,
+ IfStatement,
+ IfActionOperator,
+ ImpliesOperator,
+ IntegerValue,
+ IsActive,
+ IsDisplayed,
+ IsEqualToOperator,
+ IsGreaterThanEqualOperator,
+ IsGreaterThanOperator,
+ IsHidden,
+ IsLowerThanEqualOperator,
+ IsLowerThanOperator,
+ IsVisible,
+ LambdaContext,
+ LambdaExpression,
+ LetStatement,
+ NotOperator,
+ ObjectCompare,
+ ObjectReference,
+ MemberFeatureReference,
+ OrOperator,
+ PlusOperator,
+ PreviousModifier,
+ RuleObject,
+ Scene,
+ Property,
+ SetExpression,
+ SetOfOperator,
+ SetOperator,
+ ValueExpression,
+ Variable,
+ IsOn,
+ Zone,
+ ZoneSet,
+ SoundContent,
+ SoundContentSet,
+ SoundContentState,
+ IsAttenuated,
+ IsOutputted,
+ IsMuted,
+ IsSounding,
+ Rule,
+ OnScene,
+ OffScene,
+ GetProperty,
+ SetProperty,
+ IntegerProperty,
+ OutputtingSound,
+ StateValue,
+ HasBeenCanceled,
+ HasBeenDisplayed,
+ HasComeEarlier,
+ HasComeLater,
+ EventProcessing,
+ MaxOperator,
+ MinOperator,
+ SelectOperator,
+ SizeOperator,
+ Undisplayed,
+ IsTypeOfOperator,
+ Displayed,
+ None
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBAModelImpl.cpp b/src/core/model/RBAModelImpl.cpp
new file mode 100644
index 0000000..081607c
--- /dev/null
+++ b/src/core/model/RBAModelImpl.cpp
@@ -0,0 +1,823 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAModelmpl.cpp
+/// @brief Model implementation class
+
+#include "RBAModelImpl.hpp"
+#include "RBAConstraintImpl.hpp"
+
+namespace rba
+{
+
+const RBAContentState*
+RBAModelImpl::findContentState(const std::string& stateName)
+{
+ const auto elem = findModelElementImpl(stateName);
+ auto contentState = dynamic_cast<const RBAContentState*>(elem);
+ if (contentState == nullptr) {
+ const auto content = dynamic_cast<const RBAContent*>(elem);
+ if (content != nullptr) {
+ contentState = content->getStates().front();
+ }
+ }
+ return contentState;
+}
+
+const RBAArea*
+RBAModelImpl::findArea(const std::string& areaName) const
+{
+ return findAreaImpl(areaName);
+}
+
+const RBAViewContent*
+RBAModelImpl::findViewContent(const std::string& contName) const
+{
+ return findViewContentImpl(contName);
+}
+
+const RBAViewContentState*
+RBAModelImpl::findViewContentState(const std::string& stateName) const
+{
+ return findViewContentStateImpl(stateName);
+}
+
+const RBASize*
+RBAModelImpl::findSize(const std::string& sizeName) const
+{
+ return findSizeImpl(sizeName);
+}
+
+const RBAZone*
+RBAModelImpl::findZone(const std::string& zoneName) const
+{
+ return findZoneImpl(zoneName);
+}
+
+const RBASoundContent*
+RBAModelImpl::findSoundContent(const std::string& contName) const
+{
+ return findSoundContentImpl(contName);
+}
+
+const RBASoundContentState*
+RBAModelImpl::findSoundContentState(const std::string& stateName) const
+{
+ return findSoundContentStateImpl(stateName);
+}
+
+const RBAScene*
+RBAModelImpl::findScene(const std::string& sceneName) const
+{
+ return findSceneImpl(sceneName);
+}
+
+const RBADisplay*
+RBAModelImpl::findDisplay(const std::string& displayName) const
+{
+ return findDisplayImpl(displayName);
+}
+
+const RBAModelElement*
+RBAModelImpl::findModelElement(const std::string& elementName) const
+{
+ return findModelElementImpl(elementName);
+}
+
+const std::list<const RBAArea*>&
+RBAModelImpl::getAreas() const
+{
+ // @Deviation (A5-2-4)
+ // [Contents that deviate from the rules]
+ // reinterpret_cast shall not be used.
+ // [Reason that there is no problem if the rule is deviated]
+ // There is no problem because RBAArea is the base class of RBAAreaImpl.
+ // Since the conversion process is costly, it deviates because it hides
+ // the internal structure.
+ return reinterpret_cast<const std::list<const RBAArea*>&>(getAreaImpls());
+}
+
+const std::list<const RBAViewContent*>&
+RBAModelImpl::getViewContents() const
+{
+ // @Deviation (A5-2-4)
+ // [Contents that deviate from the rules]
+ // reinterpret_cast shall not be used.
+ // [Reason that there is no problem if the rule is deviated]
+ // There is no problem because RBAViewContent is the base class of
+ // RBAViewContentImpl.
+ // Since the conversion process is costly, it deviates because it hides
+ // the internal structure.
+ return reinterpret_cast<const std::list<const RBAViewContent*>&>(getViewContentImpls());
+}
+
+const std::list<const RBAViewContentState*>&
+RBAModelImpl::getViewContentStates() const
+{
+ // @Deviation (A5-2-4)
+ // [Contents that deviate from the rules]
+ // reinterpret_cast shall not be used.
+ // [Reason that there is no problem if the rule is deviated]
+ // There is no problem because RBAViewContentState is the base class of
+ // RBAViewContentStateImpl.
+ // Since the conversion process is costly, it deviates because it hides
+ // the internal structure.
+ return reinterpret_cast<const std::list<const RBAViewContentState*>&>(getViewContentStateImpls());
+}
+
+const std::list<const RBASize*>&
+RBAModelImpl::getSizes() const
+{
+ // @Deviation (A5-2-4)
+ // [Contents that deviate from the rules]
+ // reinterpret_cast shall not be used.
+ // [Reason that there is no problem if the rule is deviated]
+ // There is no problem because RBASize is the base class of RBASizeImpl.
+ // Since the conversion process is costly, it deviates because it hides
+ // the internal structure.
+ return reinterpret_cast<const std::list<const RBASize*>&>(getSizeImpls());
+}
+
+const std::list<const RBAZone*>&
+RBAModelImpl::getZones() const
+{
+ // @Deviation (A5-2-4)
+ // [Contents that deviate from the rules]
+ // reinterpret_cast shall not be used.
+ // [Reason that there is no problem if the rule is deviated]
+ // There is no problem because RBAZone is the base class of RBAZoneImpl.
+ // Since the conversion process is costly, it deviates because it hides
+ // the internal structure.
+ return reinterpret_cast<const std::list<const RBAZone*>&>(getZoneImpls());
+}
+
+const std::list<const RBASoundContent*>&
+RBAModelImpl::getSoundContents() const
+{
+ // @Deviation (A5-2-4)
+ // [Contents that deviate from the rules]
+ // reinterpret_cast shall not be used.
+ // [Reason that there is no problem if the rule is deviated]
+ // There is no problem because RBASoundContent is the base class of
+ // RBASoundContentImpl.
+ // Since the conversion process is costly, it deviates because it hides
+ // the internal structure.
+ return reinterpret_cast<const std::list<const RBASoundContent*>&>(getSoundContentImpls());
+}
+
+const std::list<const RBASoundContentState*>&
+RBAModelImpl::getSoundContentStates() const
+{
+ // @Deviation (A5-2-4)
+ // [Contents that deviate from the rules]
+ // reinterpret_cast shall not be used.
+ // [Reason that there is no problem if the rule is deviated]
+ // There is no problem because RBASoundContentState is the base class of
+ // RBASoundContentStateImpl.
+ // Since the conversion process is costly, it deviates because it hides
+ // the internal structure.
+ return reinterpret_cast<const std::list<const RBASoundContentState*>&>(getSoundContentStateImpls());
+}
+
+const std::list<const RBAScene*>&
+RBAModelImpl::getScenes() const
+{
+ // @Deviation (A5-2-4)
+ // [Contents that deviate from the rules]
+ // reinterpret_cast shall not be used.
+ // [Reason that there is no problem if the rule is deviated]
+ // There is no problem because RBAScene is the base class of
+ // RBASceneImpl.
+ // Since the conversion process is costly, it deviates because it hides
+ // the internal structure.
+ return reinterpret_cast<const std::list<const RBAScene*>&>(getSceneImpls());
+}
+
+const std::list<const RBAAreaSet*>&
+RBAModelImpl::getAreaSets() const
+{
+ return getAreaSetImpls();
+}
+
+const std::list<const RBAViewContentSet*>&
+RBAModelImpl::getViewContentSets() const
+{
+ return getViewContentSetImpls();
+}
+
+const std::list<const RBAZoneSet*>&
+RBAModelImpl::getZoneSets() const
+{
+ return getZoneSetImpls();
+}
+
+const std::list<const RBASoundContentSet*>&
+RBAModelImpl::getSoundContentSets() const
+{
+ return getSoundContentSetImpls();
+}
+
+const std::list<const RBAPositionContainer*>&
+RBAModelImpl::getPositionContainers() const
+{
+ // @Deviation (A5-2-4)
+ // [Contents that deviate from the rules]
+ // reinterpret_cast shall not be used.
+ // [Reason that there is no problem if the rule is deviated]
+ // There is no problem because RBAPositionContainer is the base class of
+ // RBAPositionContainerImpl.
+ // Since the conversion process is costly, it deviates because it hides
+ // the internal structure.
+ return reinterpret_cast<const std::list<const RBAPositionContainer*>&>(getPositionContainerImpls());
+}
+
+const std::list<const RBADisplay*>&
+RBAModelImpl::getDisplays() const
+{
+ // @Deviation (A5-2-4)
+ // [Contents that deviate from the rules]
+ // reinterpret_cast shall not be used.
+ // [Reason that there is no problem if the rule is deviated]
+ // There is no problem because RBADisplay is the base class of RBADisplayImpl.
+ // Since the conversion process is costly, it deviates because it hides
+ // the internal structure.
+ return reinterpret_cast<const std::list<const RBADisplay*>&>(getDisplayImpls());
+}
+
+std::list<RBAConstraint*>&
+RBAModelImpl::getConstraints()
+{
+ // @Deviation (A5-2-4)
+ // [Contents that deviate from the rules]
+ // reinterpret_cast shall not be used.
+ // [Reason that there is no problem if the rule is deviated]
+ // There is no problem because RBAConstraint is the base class of
+ // RBAConstraintImpl.
+ // Since the conversion process is costly, it deviates because it hides
+ // the internal structure.
+ return reinterpret_cast<std::list<RBAConstraint*>&>(getConstraintImpls());
+}
+
+void RBAModelImpl::clearElementsStatus()
+{
+ for (auto& o : unnamedObjects_) {
+ o->clearStatus();
+ }
+ for (auto& o : nameToObject_) {
+ o.second->clearStatus();
+ }
+}
+
+const RBAAllocatable*
+RBAModelImpl::findAllocatable(const std::string& allocatableName) const
+{
+ auto it = nameToObject_.find(allocatableName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBAAllocatable*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBAContent*
+RBAModelImpl::findContent(const std::string& contentName) const
+{
+ auto it = nameToObject_.find(contentName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBAContent*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBAAreaImpl*
+RBAModelImpl::findAreaImpl(const std::string& areaName) const
+{
+ auto it = nameToObject_.find(areaName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBAAreaImpl*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBAViewContentImpl*
+RBAModelImpl::findViewContentImpl(const std::string& contName) const
+{
+ auto it = nameToObject_.find(contName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBAViewContentImpl*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBAViewContentStateImpl*
+RBAModelImpl::findViewContentStateImpl(const std::string& stateName) const
+{
+ const RBAViewContentStateImpl* ret {nullptr};
+ if(RBAViewContentState::isUniqueName(stateName)) {
+ auto it = nameToObject_.find(stateName);
+ if(it != nameToObject_.end()) {
+ ret = dynamic_cast<const RBAViewContentStateImpl*>(it->second.get());
+ }
+ }
+ else {
+ const RBAViewContentImpl* const content {findViewContentImpl(stateName)};
+ if(content != nullptr) {
+ const RBAContentState* const state {content->getStates().front()};
+ ret = dynamic_cast<const RBAViewContentStateImpl*>(state);
+ }
+ }
+
+ return ret;
+}
+
+const RBASizeImpl*
+RBAModelImpl::findSizeImpl(const std::string& sizeName) const
+{
+ auto it = nameToObject_.find(sizeName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBASizeImpl*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBAZoneImpl*
+RBAModelImpl::findZoneImpl(const std::string& zoneName) const
+{
+ auto it = nameToObject_.find(zoneName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBAZoneImpl*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBASoundContentImpl*
+RBAModelImpl::findSoundContentImpl(const std::string& contName) const
+{
+ auto it = nameToObject_.find(contName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBASoundContentImpl*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBASoundContentStateImpl*
+RBAModelImpl::findSoundContentStateImpl(const std::string& stateName) const
+{
+ const RBASoundContentStateImpl* ret {nullptr};
+ if(RBASoundContentState::isUniqueName(stateName)) {
+ auto it = nameToObject_.find(stateName);
+ if(it != nameToObject_.end()) {
+ ret = dynamic_cast<const RBASoundContentStateImpl*>(it->second.get());
+ }
+ }
+ else {
+ const RBASoundContentImpl* const content {findSoundContentImpl(stateName)};
+ if(content != nullptr) {
+ const RBAContentState* const state {content->getStates().front()};
+ ret = dynamic_cast<const RBASoundContentStateImpl*>(state);
+ }
+ }
+
+ return ret;
+}
+
+const RBASceneImpl*
+RBAModelImpl::findSceneImpl(const std::string& sceneName) const
+{
+ auto it = nameToObject_.find(sceneName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBASceneImpl*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBADisplayImpl*
+RBAModelImpl::findDisplayImpl(const std::string& displayName) const
+{
+ auto it = nameToObject_.find(displayName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBADisplayImpl*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBAModelElement*
+RBAModelImpl::findModelElementImpl(const std::string& elementName) const
+{
+ auto it = nameToObject_.find(elementName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBAModelElement*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const std::list<const RBAAllocatable*>&
+RBAModelImpl::getAllocatables() const
+{
+ return allocatables_;
+}
+
+const std::list<const RBAContent*>&
+RBAModelImpl::getContents() const
+{
+ return contents_;
+}
+
+const std::list<const RBAContentState*>&
+RBAModelImpl::getContentStates() const
+{
+ return contentStates_;
+}
+
+const std::list<const RBAAreaImpl*>&
+RBAModelImpl::getAreaImpls() const
+{
+ return areas_;
+}
+
+const std::list<const RBAViewContentImpl*>&
+RBAModelImpl::getViewContentImpls() const
+{
+ return viewContents_;
+}
+
+const std::list<const RBAViewContentStateImpl*>&
+RBAModelImpl::getViewContentStateImpls() const
+{
+ return viewContentStates_;
+}
+
+const std::list<const RBASizeImpl*>&
+RBAModelImpl::getSizeImpls() const
+{
+ return sizes_;
+}
+
+const std::list<const RBAZoneImpl*>&
+RBAModelImpl::getZoneImpls() const
+{
+ return zones_;
+}
+
+const std::list<const RBASoundContentImpl*>&
+RBAModelImpl::getSoundContentImpls() const
+{
+ return soundContents_;
+}
+
+const std::list<const RBASoundContentStateImpl*>&
+RBAModelImpl::getSoundContentStateImpls() const
+{
+ return soundContentStates_;
+}
+
+const std::list<const RBASceneImpl*>&
+RBAModelImpl::getSceneImpls() const
+{
+ return scenes_;
+}
+
+const std::list<const RBAPositionContainerImpl*>&
+RBAModelImpl::getPositionContainerImpls() const
+{
+ return positionContainers_;
+}
+
+const std::list<const RBADisplayImpl*>&
+RBAModelImpl::getDisplayImpls() const
+{
+ return displays_;
+}
+
+void
+RBAModelImpl::createSortedAllocatables()
+{
+ if(!(sortedAllocatables_.empty())) {
+ sortedAllocatables_.clear();
+ }
+
+ for(auto& alloc : allocatables_) {
+ sortedAllocatables_.push_back(const_cast<RBAAllocatable*>(alloc));
+ }
+ sortedAllocatables_.sort(&RBAAllocatable::compare);
+
+ std::int32_t index{0};
+ for(RBAAllocatable* const allocatable : sortedAllocatables_) {
+ allocatable->setIndex(index);
+ index++;
+ }
+}
+
+std::list<RBAAllocatable*>&
+RBAModelImpl::getSortedAllocatables()
+{
+ return sortedAllocatables_;
+}
+
+RBAConstraintImpl*
+RBAModelImpl::findConstraintImpl(const std::string& consName) const
+{
+ auto it = nameToObject_.find(consName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<RBAConstraintImpl*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBAAreaSet*
+RBAModelImpl::findAreaSetImpl(const std::string& areaSetName) const
+{
+ auto it = nameToObject_.find(areaSetName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBAAreaSet*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBAZoneSet*
+RBAModelImpl::findZoneSetImpl(const std::string& zoneSetName) const
+{
+ auto it = nameToObject_.find(zoneSetName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBAZoneSet*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBAViewContentSet*
+RBAModelImpl::findViewContentSetImpl(const std::string& contSetName) const
+{
+ auto it = nameToObject_.find(contSetName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBAViewContentSet*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBASoundContentSet*
+RBAModelImpl::findSoundContentSetImpl(const std::string& contSetName) const
+{
+ auto it = nameToObject_.find(contSetName);
+ if(it != nameToObject_.end()) {
+ return dynamic_cast<const RBASoundContentSet*>(it->second.get());
+ }
+
+ return nullptr;
+}
+
+const RBAPositionContainerImpl*
+RBAModelImpl::findPositionContainerImpl(const std::string& areaName) const
+{
+ auto it = areaNameToPositionContainer_.find(areaName);
+ if(it != areaNameToPositionContainer_.end()) {
+ return dynamic_cast<const RBAPositionContainerImpl*>(it->second);
+ }
+
+ return nullptr;
+}
+
+/*
+ * get list functions
+ */
+
+std::list<const RBAConstraintImpl*>&
+RBAModelImpl::getConstraintImpls()
+{
+ return constraints_;
+}
+
+const std::list<const RBAAreaSet*>&
+RBAModelImpl::getAreaSetImpls() const
+{
+ return areaSets_;
+}
+
+const std::list<const RBAZoneSet*>&
+RBAModelImpl::getZoneSetImpls() const
+{
+ return zoneSets_;
+}
+
+const std::list<const RBAViewContentSet*>&
+RBAModelImpl::getViewContentSetImpls() const
+{
+ return viewContentSets_;
+}
+
+const std::list<const RBASoundContentSet*>&
+RBAModelImpl::getSoundContentSetImpls() const
+{
+ return soundContentSets_;
+}
+
+RBAModelElement*
+RBAModelImpl::addModelElement(std::unique_ptr<RBAModelElement> newElement)
+{
+ RBAModelElement* const element {newElement.get()};
+ unnamedObjects_.push_back(std::move(newElement));
+ return element;
+}
+
+RBANamedElement*
+RBAModelImpl::addNamedElement(std::unique_ptr<RBAModelElement> newElement)
+{
+ RBANamedElement* const element {dynamic_cast<RBANamedElement*>(newElement.get())};
+ nameToObject_[element->getUniqueName()] = std::move(newElement);
+ return element;
+}
+
+void
+RBAModelImpl::addAllocatable(const RBAAllocatable* newAlloc)
+{
+ allocatables_.push_back(newAlloc);
+ if(newAlloc->isArea()) {
+ areas_.push_back(dynamic_cast<const RBAAreaImpl*>(newAlloc));
+ }
+ else if (newAlloc->isZone()) {
+ zones_.push_back(dynamic_cast<const RBAZoneImpl*>(newAlloc));
+ } else {
+ ;
+ }
+}
+
+void
+RBAModelImpl::addContent(const RBAContent* newContent)
+{
+ contents_.push_back(newContent);
+ if(newContent->isViewContent()) {
+ viewContents_.push_back(dynamic_cast<const RBAViewContentImpl*>(newContent));
+ }
+ else if (newContent->isSoundContent()) {
+ soundContents_.push_back(dynamic_cast<const RBASoundContentImpl*>(newContent));
+ } else {
+ ;
+ }
+}
+
+void
+RBAModelImpl::addContentState(const RBAContentState* newState)
+{
+ contentStates_.push_back(newState);
+ if(newState->isViewContentState()) {
+ viewContentStates_.push_back(dynamic_cast<const RBAViewContentStateImpl*>(newState));
+ }
+ else {
+ soundContentStates_.push_back(dynamic_cast<const RBASoundContentStateImpl*>(newState));
+ }
+}
+
+void
+RBAModelImpl::addAreaSet(const RBAAreaSet* newAreaSet)
+{
+ areaSets_.push_back(newAreaSet);
+}
+
+void
+RBAModelImpl::addZoneSet(const RBAZoneSet* newZoneSet)
+{
+ zoneSets_.push_back(newZoneSet);
+}
+
+void
+RBAModelImpl::addConstraint(const RBAConstraintImpl* newConstraint)
+{
+ constraints_.push_back(newConstraint);
+}
+
+void
+RBAModelImpl::addViewContentSet(const RBAViewContentSet* newContentSet)
+{
+ viewContentSets_.push_back(newContentSet);
+}
+
+void
+RBAModelImpl::addSoundContentSet(const RBASoundContentSet* newContentSet)
+{
+ soundContentSets_.push_back(newContentSet);
+}
+
+void
+RBAModelImpl::addScene(const RBASceneImpl* newScene)
+{
+ scenes_.push_back(newScene);
+}
+
+RBASizeImpl*
+RBAModelImpl::addSizeInstance(const std::string& ownerName,
+ std::unique_ptr<RBAModelElement> newSize)
+{
+ RBASizeImpl* sizeImpl {dynamic_cast<RBASizeImpl*>(newSize.get())};
+ sizes_.push_back(sizeImpl);
+ nameToObject_[ownerName+std::string("/")+sizeImpl->getName()]
+ = std::move(newSize);
+ return sizeImpl;
+}
+
+void
+RBAModelImpl::addPositionContainer(const RBAPositionContainerImpl* newPositionContainer)
+{
+ positionContainers_.push_back(newPositionContainer);
+ areaNameToPositionContainer_[newPositionContainer->getArea()->getName()]
+ = newPositionContainer;
+}
+
+void
+RBAModelImpl::addDisplay(const RBADisplayImpl* newDisplay)
+{
+ displays_.push_back(newDisplay);
+}
+
+void
+RBAModelImpl::addLabeledElement(const std::string& label,
+ RBAModelElement* element)
+{
+ labelToElements_[label].push_back(element);
+}
+
+void
+RBAModelImpl::addLabeledConstraint(const std::string& label,
+ RBAAbstractConstraint* constraint)
+{
+ labelToConstraints_[label].push_back(constraint);
+}
+
+const std::list<const RBAModelElement*>
+RBAModelImpl::getLabeledElements(const std::string& label) const
+{
+ auto it = labelToElements_.find(label);
+ if(it != labelToElements_.end()) {
+ return it->second;
+ }
+
+ const std::list<const RBAModelElement*> emp;
+ return emp;
+}
+
+const std::list<RBAAbstractConstraint*>
+RBAModelImpl::getLabeledConstraints(const std::string& label) const
+{
+ auto it = labelToConstraints_.find(label);
+ if(it != labelToConstraints_.end()) {
+ return it->second;
+ }
+
+ const std::list<RBAAbstractConstraint*> emp;
+ return emp;
+}
+
+const RBAModelElement*
+RBAModelImpl::findLabeledElement(const std::string& label,
+ const std::string& name) const
+{
+ const std::list<const RBAModelElement*> elems {getLabeledElements(label)};
+ for(const RBAModelElement* const elem : elems) {
+ if(dynamic_cast<const RBANamedElement*>(elem)->getElementName() == name) {
+ return elem;
+ }
+ }
+
+ return nullptr;
+}
+
+void
+RBAModelImpl::addAffectedAllocsMap(const RBAModelElement* const owner, RBAAllocatable* const alloc)
+{
+ affectedAllocsMap_[owner].push_back(alloc);
+}
+
+const std::list<RBAAllocatable*>*
+RBAModelImpl::getAffectedAllocs(const RBAModelElement* const owner)
+{
+ auto itr = affectedAllocsMap_.find(owner);
+ if (itr != affectedAllocsMap_.end()) {
+ return &itr->second;
+ }
+ return nullptr;
+}
+
+}
diff --git a/src/core/model/RBAModelImpl.hpp b/src/core/model/RBAModelImpl.hpp
new file mode 100644
index 0000000..5773506
--- /dev/null
+++ b/src/core/model/RBAModelImpl.hpp
@@ -0,0 +1,221 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAModelImplhpp
+/// @brief Model implementaion class header
+
+#ifndef RBAMODELIMPL_HPP
+#define RBAMODELIMPL_HPP
+
+#include <memory>
+#include <string>
+#include <unordered_map>
+
+#include "RBAAreaImpl.hpp"
+#include "RBAConstraintImpl.hpp"
+#include "RBADisplayImpl.hpp"
+#include "RBAExpression.hpp"
+#include "RBAModel.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAPositionContainerImpl.hpp"
+#include "RBASceneImpl.hpp"
+#include "RBASizeImpl.hpp"
+#include "RBASoundContentImpl.hpp"
+#include "RBASoundContentStateImpl.hpp"
+#include "RBAVariable.hpp"
+#include "RBAViewContentImpl.hpp"
+#include "RBAViewContentStateImpl.hpp"
+#include "RBAZoneImpl.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAModelImpl : public RBAModel
+{
+public:
+ RBAModelImpl()=default;
+ RBAModelImpl(const RBAModelImpl&)=delete;
+ RBAModelImpl(const RBAModelImpl&&)=delete;
+ RBAModelImpl& operator=(const RBAModelImpl&)=delete;
+ RBAModelImpl& operator=(const RBAModelImpl&&)=delete;
+ virtual ~RBAModelImpl()=default;
+
+public:
+ const RBAArea* findArea(const std::string& areaName) const override;
+ const RBAViewContent* findViewContent(const std::string& contName) const override;
+ const RBAViewContentState* findViewContentState(const std::string& stateName) const override;
+ const RBASize* findSize(const std::string& sizeName) const override;
+ const RBAZone* findZone(const std::string& zoneName) const override;
+ const RBASoundContent* findSoundContent(const std::string& contName) const override;
+ const RBASoundContentState* findSoundContentState(const std::string& stateName) const override;
+ const RBAScene* findScene(const std::string& sceneName) const override;
+ const RBADisplay* findDisplay(const std::string& displayName) const override;
+ const RBAModelElement* findModelElement(const std::string& elementName) const override;
+
+ const std::list<const RBAArea*>& getAreas() const override;
+ const std::list<const RBAViewContent*>& getViewContents() const override;
+ const std::list<const RBAViewContentState*>& getViewContentStates() const override;
+ const std::list<const RBASize*>& getSizes() const override;
+ const std::list<const RBAZone*>& getZones() const override;
+ const std::list<const RBASoundContent*>& getSoundContents() const override;
+ const std::list<const RBASoundContentState*>& getSoundContentStates() const override;
+ const std::list<const RBAScene*>& getScenes() const override;
+ const std::list<const RBAAreaSet*>& getAreaSets() const override;
+ const std::list<const RBAViewContentSet*>& getViewContentSets() const override;
+ virtual const std::list<const RBAZoneSet*>& getZoneSets() const;
+ virtual const std::list<const RBASoundContentSet*>& getSoundContentSets() const;
+ const std::list<const RBAPositionContainer*>& getPositionContainers() const override;
+ const std::list<const RBADisplay*>& getDisplays() const override;
+ std::list<RBAConstraint*>& getConstraints() override;
+
+ virtual void clearElementsStatus();
+ virtual const RBAContentState* findContentState(const std::string& stateName);
+ const RBAAllocatable* findAllocatable(const std::string& allocatableName) const;
+ const RBAContent* findContent(const std::string& contentName) const;
+ virtual const RBAAreaImpl* findAreaImpl(const std::string& areaName) const;
+ virtual const RBAViewContentImpl* findViewContentImpl(const std::string& contName) const;
+ virtual const RBAViewContentStateImpl* findViewContentStateImpl(const std::string& stateName) const;
+ virtual const RBASizeImpl* findSizeImpl(const std::string& sizeName) const;
+ virtual const RBAZoneImpl* findZoneImpl(const std::string& zoneName) const;
+ virtual const RBASoundContentImpl* findSoundContentImpl(const std::string& contName) const;
+ virtual const RBASoundContentStateImpl* findSoundContentStateImpl(const std::string& stateName) const;
+ virtual const RBASceneImpl* findSceneImpl(const std::string& sceneName) const;
+ virtual const RBADisplayImpl* findDisplayImpl(const std::string& displayName) const;
+ virtual const RBAModelElement* findModelElementImpl(const std::string& elementName) const;
+
+ virtual const std::list<const RBAAllocatable*>& getAllocatables() const;
+ virtual const std::list<const RBAContent*>& getContents() const;
+ virtual const std::list<const RBAContentState*>& getContentStates() const;
+
+ virtual const std::list<const RBAAreaImpl*>& getAreaImpls() const;
+ virtual const std::list<const RBAViewContentImpl*>& getViewContentImpls() const;
+ virtual const std::list<const RBAViewContentStateImpl*>& getViewContentStateImpls() const;
+ virtual const std::list<const RBASizeImpl*>& getSizeImpls() const;
+ virtual const std::list<const RBAZoneImpl*>& getZoneImpls() const;
+ virtual const std::list<const RBASoundContentImpl*>& getSoundContentImpls() const;
+ virtual const std::list<const RBASoundContentStateImpl*>& getSoundContentStateImpls() const;
+ virtual const std::list<const RBASceneImpl*>& getSceneImpls() const;
+ virtual const std::list<const RBAPositionContainerImpl*>& getPositionContainerImpls() const;
+ virtual const std::list<const RBADisplayImpl*>& getDisplayImpls() const;
+
+ virtual void createSortedAllocatables();
+
+ virtual RBAConstraintImpl* findConstraintImpl(const std::string& consName) const;
+ virtual const RBAAreaSet* findAreaSetImpl(const std::string& areaSetName) const;
+ virtual const RBAZoneSet* findZoneSetImpl(const std::string& zoneSetName) const;
+ virtual const RBAViewContentSet* findViewContentSetImpl(const std::string& contSetName) const;
+ virtual const RBASoundContentSet* findSoundContentSetImpl(const std::string& contSetName) const;
+ virtual const RBAPositionContainerImpl* findPositionContainerImpl(const std::string& areaName) const;
+
+ virtual std::list<const RBAConstraintImpl*>& getConstraintImpls();
+ virtual const std::list<const RBAAreaSet*>& getAreaSetImpls() const;
+ virtual const std::list<const RBAZoneSet*>& getZoneSetImpls() const;
+ virtual const std::list<const RBAViewContentSet*>& getViewContentSetImpls() const;
+ virtual const std::list<const RBASoundContentSet*>& getSoundContentSetImpls() const;
+ // Do not set to const because the internal state is changed by arbitration
+ // processing
+ virtual std::list<RBAAllocatable*>& getSortedAllocatables();
+
+ virtual RBAModelElement* addModelElement(std::unique_ptr<RBAModelElement> newElement);
+ virtual RBANamedElement* addNamedElement(std::unique_ptr<RBAModelElement> newElement);
+ virtual RBASizeImpl* addSizeInstance(const std::string& ownerName,
+ std::unique_ptr<RBAModelElement> newSize);
+
+ virtual void addAllocatable(const RBAAllocatable* newAlloc);
+ virtual void addContent(const RBAContent* newContent);
+ virtual void addContentState(const RBAContentState* newState);
+ virtual void addAreaSet(const RBAAreaSet* newAreaSet);
+ virtual void addZoneSet(const RBAZoneSet* newZoneSet);
+ virtual void addConstraint(const RBAConstraintImpl* newConstraint);
+ virtual void addViewContentSet(const RBAViewContentSet* newContentSet);
+ virtual void addSoundContentSet(const RBASoundContentSet* newContentSet);
+ virtual void addScene(const RBASceneImpl* newScene);
+ virtual void addPositionContainer(const RBAPositionContainerImpl* newPositionContainer);
+ virtual void addDisplay(const RBADisplayImpl* newDisplay);
+ /// Add element with label
+ virtual void addLabeledElement(const std::string& label,
+ RBAModelElement* element);
+ /// Add constraint expression with label
+ virtual void addLabeledConstraint(const std::string& label,
+ RBAAbstractConstraint* constraint);
+
+ /// Add element list with label
+ virtual const std::list<const RBAModelElement*> getLabeledElements(const std::string& label) const;
+ /// Add constraint expression list with label
+ virtual const std::list<RBAAbstractConstraint*> getLabeledConstraints(const std::string& label) const;
+ /// Search element with label
+ virtual const RBAModelElement* findLabeledElement(const std::string& label,
+ const std::string& name) const;
+
+ // Add to Allcatable map
+ void addAffectedAllocsMap(const RBAModelElement* const owner, RBAAllocatable* const alloc);
+ // Get affected Allocatable list
+ const std::list<RBAAllocatable*>* getAffectedAllocs(const RBAModelElement* const owner);
+
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<const RBAAllocatable*> allocatables_;
+ std::list<const RBAContent*> contents_;
+ std::list<const RBAContentState*> contentStates_;
+ std::list<const RBAAreaImpl*> areas_;
+ std::list<const RBAViewContentImpl*> viewContents_;
+ std::list<const RBAViewContentStateImpl*> viewContentStates_;
+ std::list<const RBASizeImpl*> sizes_;
+ std::list<const RBAZoneImpl*> zones_;
+ std::list<const RBASoundContentImpl*> soundContents_;
+ std::list<const RBASoundContentStateImpl*> soundContentStates_;
+ std::list<const RBAConstraintImpl*> constraints_;
+ std::list<const RBAAreaSet*> areaSets_;
+ std::list<const RBAZoneSet*> zoneSets_;
+ std::list<const RBASceneImpl*> scenes_;
+ std::list<const RBAViewContentSet*> viewContentSets_;
+ std::list<const RBASoundContentSet*> soundContentSets_;
+ std::list<const RBAPositionContainerImpl*> positionContainers_;
+ std::list<const RBADisplayImpl*> displays_;
+
+ // Do not set to const because the internal state is changed by arbitration
+ // processing
+ std::list<RBAAllocatable*> sortedAllocatables_;
+
+ // For storing objects not managed by name
+ // expression, variable are applicable.
+ std::list<std::unique_ptr<RBAModelElement>> unnamedObjects_;
+
+ // Managing RBARuleObject and RBASize
+ std::unordered_map<std::string, std::unique_ptr<RBAModelElement>> nameToObject_;
+ // Position container is managed by map paired with Area name
+ std::unordered_map<std::string, const RBAPositionContainerImpl*> areaNameToPositionContainer_;
+
+ // Managing Labeled element model for extensions
+ std::unordered_map<std::string, std::list<const RBAModelElement*>> labelToElements_;
+ // Managing Labeled Constraint Expressions for extensions
+ std::unordered_map<std::string, std::list<RBAAbstractConstraint*>> labelToConstraints_;
+
+ // Allocatable map
+ std::unordered_map<const RBAModelElement*, std::list<RBAAllocatable*>> affectedAllocsMap_;
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBANamedElement.cpp b/src/core/model/RBANamedElement.cpp
new file mode 100644
index 0000000..9bfd1c0
--- /dev/null
+++ b/src/core/model/RBANamedElement.cpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * NamedElement clsass
+ */
+
+#include "RBANamedElement.hpp"
+
+namespace rba
+{
+
+RBANamedElement::RBANamedElement(const std::string& newName)
+ : RBAModelElement(),
+ name_(newName)
+{
+}
+
+std::string
+RBANamedElement::getUniqueName() const
+{
+ return getElementName();
+}
+
+const std::string&
+RBANamedElement::getElementName() const
+{
+ return name_;
+}
+
+const std::string&
+RBANamedElement::getDynamicName() const
+{
+ return dynamic_name_;
+}
+
+void
+RBANamedElement::setDynamicName(const std::string& newName)
+{
+ dynamic_name_ = newName;
+}
+}
diff --git a/src/core/model/RBANamedElement.hpp b/src/core/model/RBANamedElement.hpp
new file mode 100644
index 0000000..81db36d
--- /dev/null
+++ b/src/core/model/RBANamedElement.hpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * NamedElement clsass header
+ */
+
+#ifndef RBANAMEDELEMENT_HPP
+#define RBANAMEDELEMENT_HPP
+
+#include <string>
+#include "RBAModelElement.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBANamedElement : public RBAModelElement
+{
+protected:
+ explicit RBANamedElement(const std::string& newName = "");
+ RBANamedElement(const RBANamedElement&)=delete;
+ RBANamedElement(const RBANamedElement&&)=delete;
+ RBANamedElement& operator=(const RBANamedElement&)=delete;
+ RBANamedElement& operator=(const RBANamedElement&&)=delete;
+
+public:
+ virtual ~RBANamedElement()=default;
+ virtual std::string getUniqueName() const;
+ const std::string& getElementName() const;
+ const std::string& getDynamicName() const;
+ void setDynamicName(const std::string& newName);
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ const std::string name_;
+ std::string dynamic_name_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBARuleObject.cpp b/src/core/model/RBARuleObject.cpp
new file mode 100644
index 0000000..62aa1a5
--- /dev/null
+++ b/src/core/model/RBARuleObject.cpp
@@ -0,0 +1,105 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * RuleObject class
+ */
+
+#include <string>
+#include <unordered_map>
+#include "RBARuleObject.hpp"
+
+namespace rba
+{
+
+RBARuleObject::RBARuleObject(const std::string& name)
+ : RBANamedElement{name}
+{
+}
+
+bool
+RBARuleObject::isPrevious() const
+{
+ return false;
+}
+
+const RBARuleObject*
+RBARuleObject::getRawObject() const
+{
+ return this;
+}
+
+void RBARuleObject::addTag(const std::string& tag)
+{
+ static_cast<void>(tags_.insert(tag));
+}
+
+bool RBARuleObject::containsTag(const std::string& tag) const
+{
+ return (tags_.find(tag) != tags_.end());
+}
+
+void RBARuleObject::addMember(RBARuleObject* member)
+{
+ members_[member->getElementName()] = member;
+}
+
+const RBARuleObject* RBARuleObject::getMember(const std::string& memberName) const
+{
+ if (members_.find(memberName) != members_.end()) {
+ return (members_.at(memberName));
+ } else {
+ return nullptr;
+ }
+}
+
+void RBARuleObject::addMember(const std::string& memberName, RBARuleObject* const val)
+{
+ members_[memberName] = val;
+}
+
+RBARuleObject*
+RBARuleObject::getOwner() const
+{
+ return owner_;
+}
+
+void
+RBARuleObject::setOwner(RBARuleObject* owner)
+{
+ owner_ = owner;
+}
+
+std::string
+RBARuleObject::getUniqueName() const
+{
+ if (owner_ != nullptr) {
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // Calling getUniqueName() recursively.
+ // [Reason that there is no problem if the rule is deviated]
+ //  Since the number of elements in the rule model is finite and
+ // there is no cyclic relationship, stack overflow does not occur.
+ return owner_->getUniqueName() + "/" + getElementName();
+ }
+ return getElementName();
+}
+
+const std::unordered_map<std::string, RBARuleObject*>& RBARuleObject::getMembers() const
+{
+ return members_;
+}
+
+}
diff --git a/src/core/model/RBARuleObject.hpp b/src/core/model/RBARuleObject.hpp
new file mode 100644
index 0000000..3f03ddc
--- /dev/null
+++ b/src/core/model/RBARuleObject.hpp
@@ -0,0 +1,73 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * RuleObject class header
+ */
+
+#ifndef RBARULEOBJECT_HPP
+#define RBARULEOBJECT_HPP
+
+#include <unordered_map>
+#include <unordered_set>
+#include <string>
+
+#include "RBANamedElement.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBARuleObject : public RBANamedElement
+{
+protected:
+ explicit RBARuleObject(const std::string& name="");
+ RBARuleObject(const RBARuleObject&)=delete;
+ RBARuleObject(const RBARuleObject&&)=delete;
+ RBARuleObject& operator=(const RBARuleObject&)=delete;
+ RBARuleObject& operator=(const RBARuleObject&&)=delete;
+
+public:
+ virtual ~RBARuleObject()=default;
+ virtual bool isPrevious() const;
+ virtual const RBARuleObject* getRawObject() const;
+ bool containsTag(const std::string& tag) const;
+ void addTag(const std::string& tag);
+ virtual void addMember(RBARuleObject* member);
+ virtual const RBARuleObject* getMember(const std::string& memberName) const;
+ RBARuleObject* getOwner() const;
+ virtual void setOwner(RBARuleObject* owner);
+ std::string getUniqueName() const override;
+
+protected:
+ void addMember(const std::string& memberName, RBARuleObject* const val);
+ const std::unordered_map<std::string, RBARuleObject*>& getMembers() const;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::unordered_set<std::string> tags_;
+ std::unordered_map<std::string, RBARuleObject*> members_;
+ RBARuleObject* owner_ {nullptr};
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBARuleObjectMaker.cpp b/src/core/model/RBARuleObjectMaker.cpp
new file mode 100644
index 0000000..7b384e1
--- /dev/null
+++ b/src/core/model/RBARuleObjectMaker.cpp
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBARuleObjectMaker.cpp
+/// @brief RuleObject generator class
+
+#include "RBARuleObjectMaker.hpp"
+#include "RBARuleObject.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBARuleObjectMaker::RBARuleObjectMaker(const std::string& label)
+ : RBAModelElementMaker{label}
+{
+}
+
+RBAModelElement*
+RBARuleObjectMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ const auto ruleObj = dynamic_cast<RBARuleObject*>(element);
+
+ // Tag
+ const RBAJsonElement* const tags {jsonElem->findChildren("tags")};
+ if (tags != nullptr) {
+ for (const auto& tag : tags->getChildren()) {
+ const RBAJsonElement* const tagName {tag->findChildren("name")};
+ if (tagName != nullptr) {
+ ruleObj->addTag(tagName->getString());
+ }
+ }
+ }
+
+ // owner
+ const auto ownerRuleObj = dynamic_cast<RBARuleObject*>(owner);
+ if (ownerRuleObj != nullptr) {
+ ruleObj->setOwner(ownerRuleObj);
+ }
+
+ return ruleObj;
+}
+
+}
diff --git a/src/core/model/RBARuleObjectMaker.hpp b/src/core/model/RBARuleObjectMaker.hpp
new file mode 100644
index 0000000..661b0b7
--- /dev/null
+++ b/src/core/model/RBARuleObjectMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBARuleObjectMaker.cpp
+/// @brief RuleObject generator class header
+
+#ifndef RBARULEOBJECTMAKER_HPP
+#define RBARULEOBJECTMAKER_HPP
+
+#include "RBAModelElementMaker.hpp"
+
+namespace rba
+{
+
+/// @brief RuleObject generator class header
+class DLL_EXPORT RBARuleObjectMaker : public RBAModelElementMaker
+{
+public:
+ explicit RBARuleObjectMaker(const std::string& label="");
+ RBARuleObjectMaker(const RBARuleObjectMaker&)=delete;
+ RBARuleObjectMaker(const RBARuleObjectMaker&&)=delete;
+ RBARuleObjectMaker& operator=(const RBARuleObjectMaker&)=delete;
+ RBARuleObjectMaker& operator=(const RBARuleObjectMaker&&)=delete;
+ virtual ~RBARuleObjectMaker()=default;
+
+protected:
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBASceneImpl.cpp b/src/core/model/RBASceneImpl.cpp
new file mode 100644
index 0000000..82ecab2
--- /dev/null
+++ b/src/core/model/RBASceneImpl.cpp
@@ -0,0 +1,113 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Scene implementation class
+ */
+
+#include "RBASceneImpl.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAAbstractProperty.hpp"
+#include "RBAIntegerProperty.hpp"
+
+namespace rba
+{
+
+RBASceneImpl::RBASceneImpl(const std::string& name)
+ : RBAScene(),
+ RBARuleObject{name}
+{
+}
+
+std::string
+RBASceneImpl::getName() const
+{
+ return RBARuleObject::getElementName();
+}
+
+RBAModelElementType
+RBASceneImpl::getModelElementType() const
+{
+ return RBAModelElementType::Scene;
+}
+
+bool
+RBASceneImpl::isGlobal() const
+{
+ return global_;
+}
+
+const std::list<std::string>&
+RBASceneImpl::getPropertyNames() const
+{
+ return propertyNames_;
+}
+
+std::int32_t
+RBASceneImpl::getPropertyValue(const std::string& propertyName) const
+{
+ const RBAAbstractProperty* const prop {getProperty(propertyName)};
+ if(prop == nullptr) {
+ // Returns "-1" if the property is not registered
+ return -1;
+ }
+
+ // Returns default value
+ return prop->getValue();
+}
+
+const RBARuleObject* RBASceneImpl::getMember(const std::string& memberName) const
+{
+ return getProperty(memberName);
+}
+
+const RBAAbstractProperty*
+RBASceneImpl::getProperty(const std::string& propertyName) const
+{
+ auto p = nameToProperty_.find(propertyName);
+ if(p == nameToProperty_.end()) {
+ // Returns nullptr if the property is not registered
+ return nullptr;
+ }
+
+ return p->second;
+}
+
+void
+RBASceneImpl::setGlobal(const bool newGlobal)
+{
+ global_ = newGlobal;
+}
+
+const RBAAbstractProperty*
+RBASceneImpl::addProperty(const std::string& newName, std::int32_t newValue)
+{
+ auto p = nameToProperty_.find(newName);
+ if(p != nameToProperty_.end()) {
+ // No operation if the property is registered
+ return p->second;
+ }
+
+ // Registration
+ properties_.push_back(std::make_unique<RBAIntegerProperty>(this,
+ newName,
+ newValue));
+ propertyNames_.push_back(newName);
+ nameToProperty_[newName] = properties_.back().get();
+
+ return properties_.back().get();
+}
+
+}
diff --git a/src/core/model/RBASceneImpl.hpp b/src/core/model/RBASceneImpl.hpp
new file mode 100644
index 0000000..dd1fe3a
--- /dev/null
+++ b/src/core/model/RBASceneImpl.hpp
@@ -0,0 +1,65 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Scene implementation class header
+ */
+
+#ifndef RBASCENEIMPL_HPP
+#define RBASCENEIMPL_HPP
+
+#include <memory>
+#include "RBAScene.hpp"
+#include "RBARuleObject.hpp"
+
+namespace rba
+{
+
+class RBAAbstractProperty;
+
+class RBASceneImpl : public RBAScene, public RBARuleObject
+{
+public:
+ explicit RBASceneImpl(const std::string& name="");
+ RBASceneImpl(const RBASceneImpl&)=delete;
+ RBASceneImpl(const RBASceneImpl&&)=delete;
+ RBASceneImpl& operator=(const RBASceneImpl&)=delete;
+ RBASceneImpl& operator=(const RBASceneImpl&&)=delete;
+ virtual ~RBASceneImpl()=default;
+
+public:
+ std::string getName() const override;
+ RBAModelElementType getModelElementType() const override;
+ bool isGlobal() const override;
+ const std::list<std::string>& getPropertyNames() const override;
+ std::int32_t getPropertyValue(const std::string& propertyName) const override;
+ const RBARuleObject* getMember(const std::string& memberName) const override;
+ const RBAAbstractProperty* getProperty(const std::string& propertyName) const;
+
+ void setGlobal(const bool newGlobal);
+ const RBAAbstractProperty* addProperty(const std::string& newName,
+ std::int32_t newValue);
+
+private:
+ bool global_ {false};
+ // Used to get property name in RBAScene
+ std::list<std::string> propertyNames_;
+ std::list<std::unique_ptr<RBAAbstractProperty>> properties_;
+ std::unordered_map<std::string, RBAAbstractProperty*> nameToProperty_;
+};
+
+}
+
+#endif
diff --git a/src/core/model/RBASceneMaker.cpp b/src/core/model/RBASceneMaker.cpp
new file mode 100644
index 0000000..9c55f84
--- /dev/null
+++ b/src/core/model/RBASceneMaker.cpp
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASceneMaker.cpp
+/// @brief Scene object generator class
+
+#include "RBASceneMaker.hpp"
+#include "RBASceneImpl.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAAbstractProperty.hpp"
+
+namespace rba
+{
+
+RBASceneMaker::RBASceneMaker()
+ : RBARuleObjectMaker{"scenes"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBASceneMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBASceneImpl>(name);
+}
+
+RBAModelElement*
+RBASceneMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBARuleObjectMaker::setProperty(element, jsonElem, model, owner));
+
+ RBASceneImpl* const scene {dynamic_cast<RBASceneImpl*>(element)};
+
+ // Set global
+ const std::string global {jsonElem->findChildren("global")->getString()};
+ if(global == "true") {
+ scene->setGlobal(true);
+ }
+ else {
+ scene->setGlobal(false);
+ }
+
+ // Set property
+ const RBAJsonElement* const properties {jsonElem->findChildren("property")};
+ if(properties != nullptr) {
+ for(const auto& property : properties->getChildren()) {
+ const std::string propertyName {property->findChildren("name")->getString()};
+ const std::int32_t value {property->findChildren("value")->getInt()};
+ static_cast<void>(scene->addProperty(propertyName, value));
+ }
+ }
+
+ model->addScene(scene);
+
+ return scene;
+}
+
+}
diff --git a/src/core/model/RBASceneMaker.hpp b/src/core/model/RBASceneMaker.hpp
new file mode 100644
index 0000000..6d2ea5e
--- /dev/null
+++ b/src/core/model/RBASceneMaker.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASceneMaker.hpp
+/// @brief Scene object generator class header
+
+#ifndef RBASCENEMAKER_HPP
+#define RBASCENEMAKER_HPP
+
+#include "RBARuleObjectMaker.hpp"
+
+namespace rba
+{
+
+/// @brief Scene object generator class
+class RBASceneMaker : public RBARuleObjectMaker
+{
+public:
+ RBASceneMaker();
+ RBASceneMaker(const RBASceneMaker&)=delete;
+ RBASceneMaker(const RBASceneMaker&&)=delete;
+ RBASceneMaker& operator=(const RBASceneMaker&)=delete;
+ RBASceneMaker& operator=(const RBASceneMaker&&)=delete;
+ virtual ~RBASceneMaker()=default;
+
+protected:
+ /// @brief Create an empty instance
+ /// @details Create an empty instance of unique_ptr in derived class
+ /// @return unique_ptr for insitance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/doc/ArbitrationFW.md b/src/doc/ArbitrationFW.md
new file mode 100644
index 0000000..3e83d2f
--- /dev/null
+++ b/src/doc/ArbitrationFW.md
@@ -0,0 +1,99 @@
+# Explanatory material of JSON file to be read by RBA-FW
+
+## Table of Contents
+
+* [Overview](#anchor1)
+
+* [JSON rule file format](#anchor2)
+
+* [Class property types](#anchor3)
+
+ * Attribute
+
+ * Relation
+
+ * Composition
+
+* [JSON object configuration](#anchor4)
+
+<div style="page-break-after:always"></div>
+
+<a id="anchor1"></a>
+
+## Overview
+
+The format of the JSON rule file is shown in UML class diagram notation.
+
+<a id="anchor2"></a>
+
+## JSON rule file format
+
+The JSON object in the JSON rule file becomes an instance of the UML class.
+What is defined as a class property becomes a property of the JSON object.
+The property name of the class becomes the property name of the JSON object.
+The value of the property of the JSON object differs depending on the property type (attribute, association, composition) of the class.
+
+<a id="anchor3"></a>
+
+## Class property types
+
+### Attribute
+
+That value becomes the value of the JSON property as it is.
+The int type attribute is an integer value, and the other attributes are the string representation of that value as the value of the JSON property.
+If it is an enumerated type, it will be the string of its value.
+
+### Relation
+
+The value is either the value of the name of the referencing object or [name]: [class name].
+Which value is used should be compatible with both, as specifications may change in the future.
+
+### Composition
+
+The value will be a JSON object.
+If the class being referred to is an abstract class, a property named className is created in the JSON object that will be its value, and the value of that property will be the name of the class.
+If the class being referred to is a concrete class, className is omitted.
+If the composition multiplicity is multiple, it will be an array of JSON objects.
+
+<div style="page-break-after:always"></div>
+
+<a id="anchor4"></a>
+
+## JSON object configuration
+
+### #1.
+
+![config1](images/JSON_configuration1.png)
+
+The root object of the JSON rule file is RBAModel, and the attributes are "model" that describes the name and version name of the rule model and "template" that is the version information of the tool that generates the JSON rule file.
+Version information is given to "template" with a six-digit numerical value of "xx.yy.zz".
+zz is updated when there is no change in the format of the JSON rule file due to a bug fix of the JSON generation tool.
+yy is updated when there is a change in the format but it is compatible with the past format.
+xx is updated when there is a change in the format and the compatibility with the past format is lost.
+"areas" stores all areas included in the rule model, "zones" stores all zones, "viewcontents" stores all display contents, and "soundcontents" stores all audio contents.
+
+### #2.
+
+![config2](images/JSON_configuration2.png)
+
+"displays" stores all display objects, and the size and layout information of the display are stored below the object.
+"areasets", "zonesets", "viewcontentsets", and "soundcontentsets" are all area sets, zone sets, display content sets, and audio content sets defined in the model.
+"scenes" stores all scenes defined in the model.
+
+### #3.
+
+![config3](images/JSON_configuration3.png)
+
+"constraints" contains all the constraint expressions defined in the model, the action determination processing constraint expression at the time of defeat, and the control execution expression.
+These objects have an expression.
+The type of Expression is a derived attribute, and its value is determined by the subclass of Expression.
+See the notes in the figure for details.
+"area_constraint_map", "area_hidden_true_check_constraint_map", "area_hidden_false_check_constraint_map", "zone_constraint_map", "zone_mute_true_check_constraint_map", "zone_mute_false_check_constraint_map", and "zone__check_contain_map_int" are maps using the area / zone ID (name) as keys, and correspond to the maps described in <span style="color: #00ffff;">the constraint expressions to be evaluated in each area / zone</span>.
+
+### #4.
+
+![config4](images/JSON_configuration4.png)
+
+![config5](images/JSON_configuration5.png)
+
+![config6](images/JSON_configuration6.png)
diff --git a/src/doc/Doxygen b/src/doc/Doxygen
new file mode 100755
index 0000000..19030a7
--- /dev/null
+++ b/src/doc/Doxygen
@@ -0,0 +1,2473 @@
+# Doxyfile 1.8.13
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project.
+#
+# All text after a double hash (##) is considered a comment and is placed in
+# front of the TAG it is preceding.
+#
+# All text after a single hash (#) is considered a comment and will be ignored.
+# The format is:
+# TAG = value [value, ...]
+# For lists, items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (\" \").
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all text
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
+# for the list of possible encodings.
+# The default value is: UTF-8.
+
+DOXYFILE_ENCODING = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
+# double-quotes, unless you are using Doxywizard) that should identify the
+# project for which the documentation is generated. This name is used in the
+# title of most generated pages and in a few other places.
+# The default value is: My Project.
+
+PROJECT_NAME = "Arbitration FW API Reference Manual"
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
+# could be handy for archiving the generated documentation or if some version
+# control system is used.
+
+PROJECT_NUMBER = 1.0
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description
+# for a project that appears at the top of each page and should give viewer a
+# quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF =
+
+# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
+# in the documentation. The maximum height of the logo should not exceed 55
+# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
+# the logo to the output directory.
+
+PROJECT_LOGO =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
+# into which the generated documentation will be written. If a relative path is
+# entered, it will be relative to the location where doxygen was started. If
+# left blank the current directory will be used.
+
+OUTPUT_DIRECTORY =
+
+# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
+# directories (in 2 levels) under the output directory of each output format and
+# will distribute the generated files over these directories. Enabling this
+# option can be useful when feeding doxygen a huge amount of source files, where
+# putting all generated files in the same directory would otherwise causes
+# performance problems for the file system.
+# The default value is: NO.
+
+CREATE_SUBDIRS = NO
+
+# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
+# characters to appear in the names of generated files. If set to NO, non-ASCII
+# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
+# U+3044.
+# The default value is: NO.
+
+ALLOW_UNICODE_NAMES = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
+# Ukrainian and Vietnamese.
+# The default value is: English.
+
+OUTPUT_LANGUAGE = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
+# descriptions after the members that are listed in the file and class
+# documentation (similar to Javadoc). Set to NO to disable this.
+# The default value is: YES.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
+# description of a member or function before the detailed description
+#
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+# The default value is: YES.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator that is
+# used to form the text in various listings. Each string in this list, if found
+# as the leading text of the brief description, will be stripped from the text
+# and the result, after processing the whole list, is used as the annotated
+# text. Otherwise, the brief description is used as-is. If left blank, the
+# following values are used ($name is automatically replaced with the name of
+# the entity):The $name class, The $name widget, The $name file, is, provides,
+# specifies, contains, represents, a, an and the.
+
+ABBREVIATE_BRIEF = "The $name class" \
+ "The $name widget" \
+ "The $name file" \
+ is \
+ provides \
+ specifies \
+ contains \
+ represents \
+ a \
+ an \
+ the
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# doxygen will generate a detailed section even if there is only a brief
+# description.
+# The default value is: NO.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+# The default value is: NO.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
+# before files name in the file list and in the header files. If set to NO the
+# shortest path that makes the file name unique will be used
+# The default value is: YES.
+
+FULL_PATH_NAMES = NO
+
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
+# Stripping is only done if one of the specified strings matches the left-hand
+# part of the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the path to
+# strip.
+#
+# Note that you can specify absolute paths here, but also relative paths, which
+# will be relative from the directory where doxygen is started.
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.
+
+STRIP_FROM_PATH =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
+# path mentioned in the documentation of a class, which tells the reader which
+# header file to include in order to use a class. If left blank only the name of
+# the header file containing the class definition is used. Otherwise one should
+# specify the list of include paths that are normally passed to the compiler
+# using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
+# less readable) file names. This can be useful is your file systems doesn't
+# support long names like on DOS, Mac, or CD-ROM.
+# The default value is: NO.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
+# first line (until the first dot) of a Javadoc-style comment as the brief
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-
+# style comments (thus requiring an explicit @brief command for a brief
+# description.)
+# The default value is: NO.
+
+JAVADOC_AUTOBRIEF = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
+# line (until the first dot) of a Qt-style comment as the brief description. If
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
+# requiring an explicit \brief command for a brief description.)
+# The default value is: NO.
+
+QT_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
+# a brief description. This used to be the default behavior. The new default is
+# to treat a multi-line C++ comment block as a detailed description. Set this
+# tag to YES if you prefer the old behavior instead.
+#
+# Note that setting this tag to YES also means that rational rose comments are
+# not recognized any more.
+# The default value is: NO.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
+# documentation from any documented member that it re-implements.
+# The default value is: YES.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
+# page for each member. If set to NO, the documentation of a member will be part
+# of the file/class/namespace that contains it.
+# The default value is: NO.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
+# uses this value to replace tabs by spaces in code fragments.
+# Minimum value: 1, maximum value: 16, default value: 4.
+
+TAB_SIZE = 4
+
+# This tag can be used to specify a number of aliases that act as commands in
+# the documentation. An alias has the form:
+# name=value
+# For example adding
+# "sideeffect=@par Side Effects:\n"
+# will allow you to put the command \sideeffect (or @sideeffect) in the
+# documentation, which will result in a user-defined paragraph with heading
+# "Side Effects:". You can put \n's in the value part of an alias to insert
+# newlines.
+
+ALIASES =
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only).
+# A mapping has the form "name=value". For example adding "class=itcl::class"
+# will allow you to use the command class in the itcl::class meaning.
+
+TCL_SUBST =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
+# only. Doxygen will then generate output that is more tailored for C. For
+# instance, some of the names that are used will be different. The list of all
+# members will be omitted, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_FOR_C = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
+# Python sources only. Doxygen will then generate output that is more tailored
+# for that language. For instance, namespaces will be presented as packages,
+# qualified scopes will look different, etc.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources. Doxygen will then generate output that is tailored for Fortran.
+# The default value is: NO.
+
+OPTIMIZE_FOR_FORTRAN = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for VHDL.
+# The default value is: NO.
+
+OPTIMIZE_OUTPUT_VHDL = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it
+# parses. With this tag you can assign which parser to use for a given
+# extension. Doxygen has a built-in mapping, but you can override or extend it
+# using this tag. The format is ext=language, where ext is a file extension, and
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
+# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
+# Fortran. In the later case the parser tries to guess whether the code is fixed
+# or free formatted code, this is the default for Fortran type files), VHDL. For
+# instance to make doxygen treat .inc files as Fortran files (default is PHP),
+# and .f files as C (default is Fortran), use: inc=Fortran f=C.
+#
+# Note: For files without extension you can use no_extension as a placeholder.
+#
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
+# the files are not read by doxygen.
+
+EXTENSION_MAPPING =
+
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
+# according to the Markdown format, which allows for more readable
+# documentation. See http://daringfireball.net/projects/markdown/ for details.
+# The output of markdown processing is further processed by doxygen, so you can
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
+# case of backward compatibilities issues.
+# The default value is: YES.
+
+MARKDOWN_SUPPORT = YES
+
+# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
+# to that level are automatically included in the table of contents, even if
+# they do not have an id attribute.
+# Note: This feature currently applies only to Markdown headings.
+# Minimum value: 0, maximum value: 99, default value: 0.
+# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
+
+TOC_INCLUDE_HEADINGS = 0
+
+# When enabled doxygen tries to link words that correspond to documented
+# classes, or namespaces to their corresponding documentation. Such a link can
+# be prevented in individual cases by putting a % sign in front of the word or
+# globally by setting AUTOLINK_SUPPORT to NO.
+# The default value is: YES.
+
+AUTOLINK_SUPPORT = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should set this
+# tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string);
+# versus func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+# The default value is: NO.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+# The default value is: NO.
+
+CPP_CLI_SUPPORT = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
+# will parse them like normal C++ but will assume all classes use public instead
+# of private inheritance when no explicit protection keyword is present.
+# The default value is: NO.
+
+SIP_SUPPORT = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate
+# getter and setter methods for a property. Setting this option to YES will make
+# doxygen to replace the get and set methods by a property in the documentation.
+# This will only work if the methods are indeed getting or setting a simple
+# type. If this is not the case, or you want to show the methods anyway, you
+# should set this option to NO.
+# The default value is: YES.
+
+IDL_PROPERTY_SUPPORT = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+# The default value is: NO.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# If one adds a struct or class to a group and this option is enabled, then also
+# any nested class or struct is added to the same group. By default this option
+# is disabled and one has to add nested compounds explicitly via \ingroup.
+# The default value is: NO.
+
+GROUP_NESTED_COMPOUNDS = NO
+
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type
+# (for instance a group of public functions) to be put as a subgroup of that
+# type (e.g. under the Public Functions section). Set it to NO to prevent
+# subgrouping. Alternatively, this can be done per class using the
+# \nosubgrouping command.
+# The default value is: YES.
+
+SUBGROUPING = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
+# are shown inside the group in which they are included (e.g. using \ingroup)
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
+# and RTF).
+#
+# Note that this feature does not work in combination with
+# SEPARATE_MEMBER_PAGES.
+# The default value is: NO.
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
+# with only public data fields or simple typedef fields will be shown inline in
+# the documentation of the scope in which they are defined (i.e. file,
+# namespace, or group documentation), provided this scope is documented. If set
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and
+# Man pages) or section (for LaTeX and RTF).
+# The default value is: NO.
+
+INLINE_SIMPLE_STRUCTS = NO
+
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
+# enum is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically be
+# useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+# The default value is: NO.
+
+TYPEDEF_HIDES_STRUCT = NO
+
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
+# cache is used to resolve symbols given their name and scope. Since this can be
+# an expensive process and often the same symbol appears multiple times in the
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
+# doxygen will become slower. If the cache is too large, memory is wasted. The
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
+# symbols. At the end of a run doxygen will report the cache usage and suggest
+# the optimal cache size from a speed point of view.
+# Minimum value: 0, maximum value: 9, default value: 0.
+
+LOOKUP_CACHE_SIZE = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
+# documentation are documented, even if no documentation was available. Private
+# class members and static file members will be hidden unless the
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
+# Note: This will also disable the warnings about undocumented members that are
+# normally produced when WARNINGS is set to YES.
+# The default value is: NO.
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
+# be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PRIVATE = NO
+
+# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
+# scope will be included in the documentation.
+# The default value is: NO.
+
+EXTRACT_PACKAGE = NO
+
+# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
+# included in the documentation.
+# The default value is: NO.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
+# locally in source files will be included in the documentation. If set to NO,
+# only classes defined in header files are included. Does not have any effect
+# for Java sources.
+# The default value is: YES.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. If set to YES, local methods,
+# which are defined in the implementation section but not in the interface are
+# included in the documentation. If set to NO, only methods in the interface are
+# included.
+# The default value is: NO.
+
+EXTRACT_LOCAL_METHODS = YES
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base name of
+# the file that contains the anonymous namespace. By default anonymous namespace
+# are hidden.
+# The default value is: NO.
+
+EXTRACT_ANON_NSPACES = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
+# undocumented members inside documented classes or files. If set to NO these
+# members will be included in the various overviews, but no documentation
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy. If set
+# to NO, these classes will be included in the various overviews. This option
+# has no effect if EXTRACT_ALL is enabled.
+# The default value is: NO.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
+# (class|struct|union) declarations. If set to NO, these declarations will be
+# included in the documentation.
+# The default value is: NO.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
+# documentation blocks found inside the body of a function. If set to NO, these
+# blocks will be appended to the function's detailed documentation block.
+# The default value is: NO.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation that is typed after a
+# \internal command is included. If the tag is set to NO then the documentation
+# will be excluded. Set it to YES to include the internal documentation.
+# The default value is: NO.
+
+INTERNAL_DOCS = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
+# names in lower-case letters. If set to YES, upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+# The default value is: system dependent.
+
+CASE_SENSE_NAMES = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
+# their full class and namespace scopes in the documentation. If set to YES, the
+# scope will be hidden.
+# The default value is: NO.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
+# append additional text to a page's title, such as Class Reference. If set to
+# YES the compound reference will be hidden.
+# The default value is: NO.
+
+HIDE_COMPOUND_REFERENCE= NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
+# the files that are included by a file in the documentation of that file.
+# The default value is: YES.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
+# grouped member an include statement to the documentation, telling the reader
+# which file to include in order to use the member.
+# The default value is: NO.
+
+SHOW_GROUPED_MEMB_INC = NO
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
+# files with double quotes in the documentation rather than with sharp brackets.
+# The default value is: NO.
+
+FORCE_LOCAL_INCLUDES = NO
+
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
+# documentation for inline members.
+# The default value is: YES.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
+# (detailed) documentation of file and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order.
+# The default value is: YES.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
+# descriptions of file, namespace and class members alphabetically by member
+# name. If set to NO, the members will appear in declaration order. Note that
+# this will also influence the order of the classes in the class list.
+# The default value is: NO.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
+# (brief and detailed) documentation of class members so that constructors and
+# destructors are listed first. If set to NO the constructors will appear in the
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
+# member documentation.
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
+# detailed member documentation.
+# The default value is: NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
+# of group names into alphabetical order. If set to NO the group names will
+# appear in their defined order.
+# The default value is: NO.
+
+SORT_GROUP_NAMES = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
+# fully-qualified names, including namespaces. If set to NO, the class list will
+# be sorted only by class name, not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the alphabetical
+# list.
+# The default value is: NO.
+
+SORT_BY_SCOPE_NAME = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
+# type resolution of all parameters of a function it will reject a match between
+# the prototype and the implementation of a member function even if there is
+# only one candidate or it is obvious which candidate to choose by doing a
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
+# accept a match between prototype and implementation in such cases.
+# The default value is: NO.
+
+STRICT_PROTO_MATCHING = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo
+# list. This list is created by putting \todo commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test
+# list. This list is created by putting \test commands in the documentation.
+# The default value is: YES.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug
+# list. This list is created by putting \bug commands in the documentation.
+# The default value is: YES.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO)
+# the deprecated list. This list is created by putting \deprecated commands in
+# the documentation.
+# The default value is: YES.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>
+# ... \endcond blocks.
+
+#ENABLED_SECTIONS = english
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
+# initial value of a variable or macro / define can have for it to appear in the
+# documentation. If the initializer consists of more lines than specified here
+# it will be hidden. Use a value of 0 to hide initializers completely. The
+# appearance of the value of individual variables and macros / defines can be
+# controlled using \showinitializer or \hideinitializer command in the
+# documentation regardless of this setting.
+# Minimum value: 0, maximum value: 10000, default value: 30.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
+# the bottom of the documentation of classes and structs. If set to YES, the
+# list will mention the files that were used to generate the documentation.
+# The default value is: YES.
+
+SHOW_USED_FILES = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
+# will remove the Files entry from the Quick Index and from the Folder Tree View
+# (if specified).
+# The default value is: YES.
+
+SHOW_FILES = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
+# page. This will remove the Namespaces entry from the Quick Index and from the
+# Folder Tree View (if specified).
+# The default value is: YES.
+
+SHOW_NAMESPACES = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command command input-file, where command is the value of the
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
+# by doxygen. Whatever the program writes to standard output is used as the file
+# version. For an example see the documentation.
+
+FILE_VERSION_FILTER =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
+# by doxygen. The layout file controls the global structure of the generated
+# output files in an output format independent way. To create the layout file
+# that represents doxygen's defaults, run doxygen with the -l option. You can
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml
+# will be used as the name of the layout file.
+#
+# Note that if you run doxygen from a directory containing a file called
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
+# tag is left empty.
+
+LAYOUT_FILE =
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
+# the reference definitions. This must be a list of .bib files. The .bib
+# extension is automatically appended if omitted. This requires the bibtex tool
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
+# For LaTeX the style of the bibliography can be controlled using
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
+# search path. See also \cite for info how to create references.
+
+CITE_BIB_FILES =
+
+#---------------------------------------------------------------------------
+# Configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated to
+# standard output by doxygen. If QUIET is set to YES this implies that the
+# messages are off.
+# The default value is: NO.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES
+# this implies that the warnings are on.
+#
+# Tip: Turn warnings on while writing the documentation.
+# The default value is: YES.
+
+WARNINGS = YES
+
+# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
+# will automatically be disabled.
+# The default value is: YES.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some parameters
+# in a documented function, or documenting parameters that don't exist or using
+# markup commands wrongly.
+# The default value is: YES.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
+# are documented, but have no documentation for their parameters or return
+# value. If set to NO, doxygen will only warn about wrong or incomplete
+# parameter documentation, but not about the absence of documentation.
+# The default value is: NO.
+
+WARN_NO_PARAMDOC = NO
+
+# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
+# a warning is encountered.
+# The default value is: NO.
+
+WARN_AS_ERROR = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen
+# can produce. The string should contain the $file, $line, and $text tags, which
+# will be replaced by the file and line number from which the warning originated
+# and the warning text. Optionally the format may contain $version, which will
+# be replaced by the version of the file (if it could be obtained via
+# FILE_VERSION_FILTER)
+# The default value is: $file:$line: $text.
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error
+# messages should be written. If left blank the output is written to standard
+# error (stderr).
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag is used to specify the files and/or directories that contain
+# documented source files. You may enter file names like myfile.cpp or
+# directories like /usr/src/myproject. Separate the files or directories with
+# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
+# Note: If this tag is empty the current directory is searched.
+
+INPUT = ../include/rba
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of
+# possible encodings.
+# The default value is: UTF-8.
+
+INPUT_ENCODING = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
+# *.h) to filter out the source-files in the directories.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# read by doxygen.
+#
+# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
+# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
+# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
+# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
+# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf.
+
+FILE_PATTERNS = *.c \
+ *.cc \
+ *.cxx \
+ *.cpp \
+ *.c++ \
+ *.java \
+ *.ii \
+ *.ixx \
+ *.ipp \
+ *.i++ \
+ *.inl \
+ *.idl \
+ *.ddl \
+ *.odl \
+ *.h \
+ *.hh \
+ *.hxx \
+ *.hpp \
+ *.h++ \
+ *.cs \
+ *.d \
+ *.php \
+ *.php4 \
+ *.php5 \
+ *.phtml \
+ *.inc \
+ *.m \
+ *.markdown \
+ *.md \
+ *.mm \
+ *.dox \
+ *.py \
+ *.pyw \
+ *.f90 \
+ *.f95 \
+ *.f03 \
+ *.f08 \
+ *.f \
+ *.for \
+ *.tcl \
+ *.vhd \
+ *.vhdl \
+ *.ucf \
+ *.qsf
+
+# The RECURSIVE tag can be used to specify whether or not subdirectories should
+# be searched for input files as well.
+# The default value is: NO.
+
+RECURSIVE = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+#
+# Note that relative paths are relative to the directory from which doxygen is
+# run.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
+# directories that are symbolic links (a Unix file system feature) are excluded
+# from the input.
+# The default value is: NO.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories.
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories for example use the pattern */test/*
+
+EXCLUDE_PATTERNS =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+#
+# Note that the wildcards are matched against the file with absolute path, so to
+# exclude all test directories use the pattern */test/*
+
+EXCLUDE_SYMBOLS =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories
+# that contain example code fragments that are included (see the \include
+# command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
+# *.h) to filter out the source-files in the directories. If left blank all
+# files are included.
+
+EXAMPLE_PATTERNS = *
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude commands
+# irrespective of the value of the RECURSIVE tag.
+# The default value is: NO.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or directories
+# that contain images that are to be included in the documentation (see the
+# \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command:
+#
+# <filter> <input-file>
+#
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
+# name of an input file. Doxygen will then use the output that the filter
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag
+# will be ignored.
+#
+# Note that the filter must not add or remove lines; it is applied before the
+# code is scanned, but not when the output code is generated. If lines are added
+# or removed, the anchors will not be placed correctly.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form: pattern=filter
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
+# patterns match the file name, INPUT_FILTER is applied.
+#
+# Note that for custom extensions or not directly supported extensions you also
+# need to set EXTENSION_MAPPING for the extension otherwise the files are not
+# properly processed by doxygen.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will also be used to filter the input files that are used for
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
+# The default value is: NO.
+
+FILTER_SOURCE_FILES = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
+# it is also possible to disable source filtering for a specific pattern using
+# *.ext= (so without naming a filter).
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
+
+FILTER_SOURCE_PATTERNS =
+
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
+# is part of the input, its contents will be placed on the main page
+# (index.html). This can be useful if you have a project on for instance GitHub
+# and want to reuse the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE =
+
+#---------------------------------------------------------------------------
+# Configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
+# generated. Documented entities will be cross-referenced with these sources.
+#
+# Note: To get rid of all source code in the generated output, make sure that
+# also VERBATIM_HEADERS is set to NO.
+# The default value is: NO.
+
+SOURCE_BROWSER = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,
+# classes and enums directly into the documentation.
+# The default value is: NO.
+
+INLINE_SOURCES = YES
+
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
+# special comment blocks from generated source code fragments. Normal C, C++ and
+# Fortran comments will always remain visible.
+# The default value is: YES.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
+# function all documented functions referencing it will be listed.
+# The default value is: NO.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES then for each documented function
+# all documented entities called/used by that function will be listed.
+# The default value is: NO.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
+# to YES then the hyperlinks from functions in REFERENCES_RELATION and
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
+# link to the documentation.
+# The default value is: YES.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
+# source code will show a tooltip with additional information such as prototype,
+# brief description and links to the definition and documentation. Since this
+# will make the HTML file larger and loading of large files a bit slower, you
+# can opt to disable this feature.
+# The default value is: YES.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+SOURCE_TOOLTIPS = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code will
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in
+# source browser. The htags tool is part of GNU's global source tagging system
+# (see http://www.gnu.org/software/global/global.html). You will need version
+# 4.8.6 or higher.
+#
+# To use it do the following:
+# - Install the latest version of global
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
+# - Make sure the INPUT points to the root of the source tree
+# - Run doxygen as normal
+#
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these
+# tools must be available from the command line (i.e. in the search path).
+#
+# The result: instead of the source browser generated by doxygen, the links to
+# source code will now point to the output of htags.
+# The default value is: NO.
+# This tag requires that the tag SOURCE_BROWSER is set to YES.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
+# verbatim copy of the header file for each class for which an include is
+# specified. Set to NO to disable this.
+# See also: Section \class.
+# The default value is: YES.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
+# compounds will be generated. Enable this if the project contains a lot of
+# classes, structs, unions or interfaces.
+# The default value is: YES.
+
+ALPHABETICAL_INDEX = YES
+
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
+# which the alphabetical index list will be split.
+# Minimum value: 1, maximum value: 20, default value: 5.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all classes will
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
+# can be used to specify a prefix (or a list of prefixes) that should be ignored
+# while generating the index headers.
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output
+# The default value is: YES.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_OUTPUT = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
+# generated HTML page (for example: .htm, .php, .asp).
+# The default value is: .html.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
+# each generated HTML page. If the tag is left blank doxygen will generate a
+# standard header.
+#
+# To get valid HTML the header file that includes any scripts and style sheets
+# that doxygen needs, which is dependent on the configuration options used (e.g.
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
+# default header using
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css
+# YourConfigFile
+# and then modify the file new_header.html. See also section "Doxygen usage"
+# for information on how to generate the default header that doxygen normally
+# uses.
+# Note: The header is subject to change so you typically have to regenerate the
+# default header when upgrading to a newer version of doxygen. For a description
+# of the possible markers and block names see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
+# generated HTML page. If the tag is left blank doxygen will generate a standard
+# footer. See HTML_HEADER for more information on how to generate a default
+# footer and what special commands can be used inside the footer. See also
+# section "Doxygen usage" for information on how to generate the default footer
+# that doxygen normally uses.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
+# sheet that is used by each HTML page. It can be used to fine-tune the look of
+# the HTML output. If left blank doxygen will generate a default style sheet.
+# See also section "Doxygen usage" for information on how to generate the style
+# sheet that doxygen normally uses.
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become
+# obsolete.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_STYLESHEET =
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# cascading style sheets that are included after the standard style sheets
+# created by doxygen. Using this option one can overrule certain style aspects.
+# This is preferred over using HTML_STYLESHEET since it does not replace the
+# standard style sheet and is therefore more robust against future updates.
+# Doxygen will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list). For an example see the documentation.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_STYLESHEET =
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the HTML output directory. Note
+# that these files will be copied to the base HTML output directory. Use the
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
+# files will be copied as-is; there are no commands or markers available.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_EXTRA_FILES =
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
+# will adjust the colors in the style sheet and background images according to
+# this color. Hue is specified as an angle on a colorwheel, see
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
+# purple, and 360 is red again.
+# Minimum value: 0, maximum value: 359, default value: 220.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_HUE = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
+# in the HTML output. For a value of 0 the output will use grayscales only. A
+# value of 255 will produce the most vivid colors.
+# Minimum value: 0, maximum value: 255, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_SAT = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
+# luminance component of the colors in the HTML output. Values below 100
+# gradually make the output lighter, whereas values above 100 make the output
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
+# change the gamma.
+# Minimum value: 40, maximum value: 240, default value: 80.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_COLORSTYLE_GAMMA = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting this
+# to YES can help to show when doxygen was last run and thus if the
+# documentation is up to date.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_TIMESTAMP = NO
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_DYNAMIC_SECTIONS = NO
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
+# shown in the various tree structured indices initially; the user can expand
+# and collapse entries dynamically later on. Doxygen will expand the tree to
+# such a level that at most the specified number of entries are visible (unless
+# a fully collapsed tree already exceeds this amount). So setting the number of
+# entries 1 will produce a full collapsed tree by default. 0 is a special value
+# representing an infinite number of entries and will result in a full expanded
+# tree by default.
+# Minimum value: 0, maximum value: 9999, default value: 100.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be
+# generated that can be used as input for Apple's Xcode 3 integrated development
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
+# Makefile in the HTML output directory. Running make will produce the docset in
+# that directory and running make install will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
+# for more information.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_DOCSET = NO
+
+# This tag determines the name of the docset feed. A documentation feed provides
+# an umbrella under which multiple documentation sets from a single provider
+# (such as a company or product suite) can be grouped.
+# The default value is: Doxygen generated docs.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_FEEDNAME = "Doxygen generated docs"
+
+# This tag specifies a string that should uniquely identify the documentation
+# set bundle. This should be a reverse domain-name style string, e.g.
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_BUNDLE_ID = org.doxygen.Project
+
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
+# the documentation publisher. This should be a reverse domain-name style
+# string, e.g. com.mycompany.MyDocSet.documentation.
+# The default value is: org.doxygen.Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
+# The default value is: Publisher.
+# This tag requires that the tag GENERATE_DOCSET is set to YES.
+
+DOCSET_PUBLISHER_NAME = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
+# Windows.
+#
+# The HTML Help Workshop contains a compiler that can convert all HTML output
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
+# files are now used as the Windows 98 help format, and will replace the old
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed
+# HTML files also contain an index, a table of contents, and you can search for
+# words in the documentation. The HTML workshop also contains a viewer for
+# compressed HTML files.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_HTMLHELP = NO
+
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm
+# file. You can add a path in front of the file if the result should not be
+# written to the html output directory.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_FILE =
+
+# The HHC_LOCATION tag can be used to specify the location (absolute path
+# including file name) of the HTML help compiler (hhc.exe). If non-empty,
+# doxygen will try to run the HTML help compiler on the generated index.hhp.
+# The file has to be specified with full path.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+HHC_LOCATION =
+
+# The GENERATE_CHI flag controls if a separate .chi index file is generated
+# (YES) or that it should be included in the master .chm file (NO).
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+GENERATE_CHI = NO
+
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc)
+# and project file content.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+CHM_INDEX_ENCODING =
+
+# The BINARY_TOC flag controls whether a binary table of contents is generated
+# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it
+# enables the Previous and Next buttons.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+BINARY_TOC = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to
+# the table of contents of the HTML help documentation and to the tree view.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
+
+TOC_EXPAND = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
+# (.qch) of the generated HTML documentation.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_QHP = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
+# the file name of the resulting .qch file. The path specified is relative to
+# the HTML output folder.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QCH_FILE =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
+# Project output. For more information please see Qt Help Project / Namespace
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_NAMESPACE = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
+# Help Project output. For more information please see Qt Help Project / Virtual
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
+# folders).
+# The default value is: doc.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_VIRTUAL_FOLDER = doc
+
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
+# filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_NAME =
+
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
+# custom filter to add. For more information please see Qt Help Project / Custom
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
+# filters).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_CUST_FILTER_ATTRS =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
+# project's filter section matches. Qt Help Project / Filter Attributes (see:
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHP_SECT_FILTER_ATTRS =
+
+# The QHG_LOCATION tag can be used to specify the location of Qt's
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
+# generated .qhp file.
+# This tag requires that the tag GENERATE_QHP is set to YES.
+
+QHG_LOCATION =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
+# generated, together with the HTML files, they form an Eclipse help plugin. To
+# install this plugin and make it available under the help contents menu in
+# Eclipse, the contents of the directory containing the HTML and XML files needs
+# to be copied into the plugins directory of eclipse. The name of the directory
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
+# After copying Eclipse needs to be restarted before the help appears.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_ECLIPSEHELP = NO
+
+# A unique identifier for the Eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have this
+# name. Each documentation set should have its own identifier.
+# The default value is: org.doxygen.Project.
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
+
+ECLIPSE_DOC_ID = org.doxygen.Project
+
+# If you want full control over the layout of the generated HTML pages it might
+# be necessary to disable the index and replace it with your own. The
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
+# of each HTML page. A value of NO enables the index and the value YES disables
+# it. Since the tabs in the index contain the same information as the navigation
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+DISABLE_INDEX = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information. If the tag
+# value is set to YES, a side panel will be generated containing a tree-like
+# index structure (just like the one that is generated for HTML Help). For this
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required
+# (i.e. any modern browser). Windows users are probably better off using the
+# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can
+# further fine-tune the look of the index. As an example, the default style
+# sheet generated by doxygen has an example that shows how to put an image at
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
+# the same information as the tab index, you could consider setting
+# DISABLE_INDEX to YES when enabling this option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+GENERATE_TREEVIEW = NO
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
+# doxygen will group on one line in the generated HTML documentation.
+#
+# Note that a value of 0 will completely suppress the enum values from appearing
+# in the overview section.
+# Minimum value: 0, maximum value: 20, default value: 4.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
+# to set the initial width (in pixels) of the frame in which the tree is shown.
+# Minimum value: 0, maximum value: 1500, default value: 250.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+TREEVIEW_WIDTH = 250
+
+# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to
+# external symbols imported via tag files in a separate window.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+EXT_LINKS_IN_WINDOW = NO
+
+# Use this tag to change the font size of LaTeX formulas included as images in
+# the HTML documentation. When you change the font size after a successful
+# doxygen run you need to manually remove any form_*.png images from the HTML
+# output directory to force them to be regenerated.
+# Minimum value: 8, maximum value: 50, default value: 10.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_FONTSIZE = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images
+# generated for formulas are transparent PNGs. Transparent PNGs are not
+# supported properly for IE 6.0, but are supported on all modern browsers.
+#
+# Note that when changing this option you need to delete any form_*.png files in
+# the HTML output directory before the changes have effect.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+FORMULA_TRANSPARENT = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
+# http://www.mathjax.org) which uses client side Javascript for the rendering
+# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
+# installed or if you want to formulas look prettier in the HTML output. When
+# enabled you may also need to install MathJax separately and configure the path
+# to it using the MATHJAX_RELPATH option.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+USE_MATHJAX = NO
+
+# When MathJax is enabled you can set the default output format to be used for
+# the MathJax output. See the MathJax site (see:
+# http://docs.mathjax.org/en/latest/output.html) for more details.
+# Possible values are: HTML-CSS (which is slower, but has the best
+# compatibility), NativeMML (i.e. MathML) and SVG.
+# The default value is: HTML-CSS.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_FORMAT = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the HTML
+# output directory using the MATHJAX_RELPATH option. The destination directory
+# should contain the MathJax.js script. For instance, if the mathjax directory
+# is located at the same level as the HTML output directory, then
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
+# Content Delivery Network so you can quickly see the result without installing
+# MathJax. However, it is strongly recommended to install a local copy of
+# MathJax from http://www.mathjax.org before deployment.
+# The default value is: http://cdn.mathjax.org/mathjax/latest.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
+# extension names that should be enabled during MathJax rendering. For example
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_EXTENSIONS =
+
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
+# of code that will be used on startup of the MathJax code. See the MathJax site
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
+# example see the documentation.
+# This tag requires that the tag USE_MATHJAX is set to YES.
+
+MATHJAX_CODEFILE =
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
+# the HTML output. The underlying search engine uses javascript and DHTML and
+# should work on any modern browser. Note that when using HTML help
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
+# there is already a search function so this one should typically be disabled.
+# For large projects the javascript based search engine can be slow, then
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
+# search using the keyboard; to jump to the search box use <access key> + S
+# (what the <access key> is depends on the OS and browser, but it is typically
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
+# key> to jump into the search results window, the results can be navigated
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
+# the search. The filter options can be selected when the cursor is inside the
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
+# to select a filter and <Enter> or <escape> to activate or cancel the filter
+# option.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_HTML is set to YES.
+
+SEARCHENGINE = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
+# implemented using a web server instead of a web client using Javascript. There
+# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
+# setting. When disabled, doxygen will generate a PHP script for searching and
+# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
+# and searching needs to be provided by external tools. See the section
+# "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SERVER_BASED_SEARCH = NO
+
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
+# script for searching. Instead the search results are written to an XML file
+# which needs to be processed by an external indexer. Doxygen will invoke an
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
+# search results.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/).
+#
+# See the section "External Indexing and Searching" for details.
+# The default value is: NO.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server
+# which will return the search results when EXTERNAL_SEARCH is enabled.
+#
+# Doxygen ships with an example indexer (doxyindexer) and search engine
+# (doxysearch.cgi) which are based on the open source search engine library
+# Xapian (see: http://xapian.org/). See the section "External Indexing and
+# Searching" for details.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHENGINE_URL =
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
+# search data is written to a file for indexing by an external tool. With the
+# SEARCHDATA_FILE tag the name of this file can be specified.
+# The default file is: searchdata.xml.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+SEARCHDATA_FILE = searchdata.xml
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
+# projects and redirect the results back to the right project.
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTERNAL_SEARCH_ID =
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
+# projects other than the one defined by this configuration file, but that are
+# all added to the same external search index. Each project needs to have a
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
+# to a relative location where the documentation can be found. The format is:
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
+# This tag requires that the tag SEARCHENGINE is set to YES.
+
+EXTRA_SEARCH_MAPPINGS =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
+# The default value is: YES.
+
+GENERATE_LATEX = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_OUTPUT = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked.
+#
+# Note that when enabling USE_PDFLATEX this option is only used for generating
+# bitmaps for formulas in the HTML output, but not in the Makefile that is
+# written to the output directory.
+# The default file is: latex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_CMD_NAME = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
+# index for LaTeX.
+# The default file is: makeindex.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+MAKEINDEX_CMD_NAME = makeindex
+
+# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+COMPACT_LATEX = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used by the
+# printer.
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
+# 14 inches) and executive (7.25 x 10.5 inches).
+# The default value is: a4.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PAPER_TYPE = a4
+
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
+# that should be included in the LaTeX output. The package can be specified just
+# by its name or with the correct syntax as to be used with the LaTeX
+# \usepackage command. To get the times font for instance you can specify :
+# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times}
+# To use the option intlimits with the amsmath package you can specify:
+# EXTRA_PACKAGES=[intlimits]{amsmath}
+# If left blank no extra packages will be included.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+EXTRA_PACKAGES =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
+# generated LaTeX document. The header should contain everything until the first
+# chapter. If it is left blank doxygen will generate a standard header. See
+# section "Doxygen usage" for information on how to let doxygen write the
+# default header to a separate file.
+#
+# Note: Only use a user-defined header if you know what you are doing! The
+# following commands have a special meaning inside the header: $title,
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber,
+# $projectbrief, $projectlogo. Doxygen will replace $title with the empty
+# string, for the replacement values of the other commands the user is referred
+# to HTML_HEADER.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HEADER =
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
+# generated LaTeX document. The footer should contain everything after the last
+# chapter. If it is left blank doxygen will generate a standard footer. See
+# LATEX_HEADER for more information on how to generate a default footer and what
+# special commands can be used inside the footer.
+#
+# Note: Only use a user-defined footer if you know what you are doing!
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_FOOTER =
+
+# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined
+# LaTeX style sheets that are included after the standard style sheets created
+# by doxygen. Using this option one can overrule certain style aspects. Doxygen
+# will copy the style sheet files to the output directory.
+# Note: The order of the extra style sheet files is of importance (e.g. the last
+# style sheet in the list overrules the setting of the previous ones in the
+# list).
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_STYLESHEET =
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
+# other source files which should be copied to the LATEX_OUTPUT output
+# directory. Note that the files will be copied as-is; there are no commands or
+# markers available.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_EXTRA_FILES =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
+# contain links (just like the HTML output) instead of page references. This
+# makes the output suitable for online browsing using a PDF viewer.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+PDF_HYPERLINKS = YES
+
+# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
+# the PDF file directly from the LaTeX files. Set this option to YES, to get a
+# higher quality PDF documentation.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+USE_PDFLATEX = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
+# command to the generated LaTeX files. This will instruct LaTeX to keep running
+# if errors occur, instead of asking the user for help. This option is also used
+# when generating formulas in HTML.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BATCHMODE = NO
+
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
+# index chapters (such as File Index, Compound Index, etc.) in the output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_HIDE_INDICES = NO
+
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
+# code with syntax highlighting in the LaTeX output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_SOURCE_CODE = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
+# bibliography, e.g. plainnat, or ieeetr. See
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
+# The default value is: plain.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_BIB_STYLE = plain
+
+# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
+# page will contain the date and time when the page was generated. Setting this
+# to NO can help when comparing the output of multiple runs.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_LATEX is set to YES.
+
+LATEX_TIMESTAMP = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF
+# readers/editors.
+# The default value is: NO.
+
+GENERATE_RTF = YES
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: rtf.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_OUTPUT = rtf
+
+# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF
+# documents. This may be useful for small projects and may help to save some
+# trees in general.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+COMPACT_RTF = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
+# contain hyperlink fields. The RTF file will contain links (just like the HTML
+# output) instead of page references. This makes the output suitable for online
+# browsing using Word or some other Word compatible readers that support those
+# fields.
+#
+# Note: WordPad (write) and others do not support links.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_HYPERLINKS = YES
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config
+# file, i.e. a series of assignments. You only have to provide replacements,
+# missing definitions are set to their default value.
+#
+# See also section "Doxygen usage" for information on how to generate the
+# default style sheet that doxygen normally uses.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_STYLESHEET_FILE =
+
+# Set optional variables used in the generation of an RTF document. Syntax is
+# similar to doxygen's config file. A template extensions file can be generated
+# using doxygen -e rtf extensionFile.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_EXTENSIONS_FILE =
+
+# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code
+# with syntax highlighting in the RTF output.
+#
+# Note that which sources are shown also depends on other settings such as
+# SOURCE_BROWSER.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_RTF is set to YES.
+
+RTF_SOURCE_CODE = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for
+# classes and files.
+# The default value is: NO.
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it. A directory man3 will be created inside the directory specified by
+# MAN_OUTPUT.
+# The default directory is: man.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to the generated
+# man pages. In case the manual section does not start with a number, the number
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
+# optional.
+# The default value is: .3.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_EXTENSION = .3
+
+# The MAN_SUBDIR tag determines the name of the directory created within
+# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
+# MAN_EXTENSION with the initial . removed.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_SUBDIR =
+
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
+# will generate one additional man file for each entity documented in the real
+# man page(s). These additional files only source the real man page, but without
+# them the man command would be unable to find the correct page.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_MAN is set to YES.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that
+# captures the structure of the code including all documentation.
+# The default value is: NO.
+
+GENERATE_XML = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
+# it.
+# The default directory is: xml.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_OUTPUT = xml
+
+# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program
+# listings (including syntax highlighting and cross-referencing information) to
+# the XML output. Note that enabling this will significantly increase the size
+# of the XML output.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_XML is set to YES.
+
+XML_PROGRAMLISTING = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files
+# that can be used to generate PDF.
+# The default value is: NO.
+
+GENERATE_DOCBOOK = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
+# front of it.
+# The default directory is: docbook.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_OUTPUT = docbook
+
+# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the
+# program listings (including syntax highlighting and cross-referencing
+# information) to the DOCBOOK output. Note that enabling this will significantly
+# increase the size of the DOCBOOK output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
+
+DOCBOOK_PROGRAMLISTING = NO
+
+#---------------------------------------------------------------------------
+# Configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
+# AutoGen Definitions (see http://autogen.sf.net) file that captures the
+# structure of the code including all documentation. Note that this feature is
+# still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_AUTOGEN_DEF = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module
+# file that captures the structure of the code including all documentation.
+#
+# Note that this feature is still experimental and incomplete at the moment.
+# The default value is: NO.
+
+GENERATE_PERLMOD = NO
+
+# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
+# output from the Perl module output.
+# The default value is: NO.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_LATEX = NO
+
+# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely
+# formatted so it can be parsed by a human reader. This is useful if you want to
+# understand what is going on. On the other hand, if this tag is set to NO, the
+# size of the Perl module output will be much smaller and Perl will parse it
+# just the same.
+# The default value is: YES.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_PRETTY = YES
+
+# The names of the make variables in the generated doxyrules.make file are
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
+# so different doxyrules.make files included by the same Makefile don't
+# overwrite each other's variables.
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all
+# C-preprocessor directives found in the sources and include files.
+# The default value is: YES.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names
+# in the source code. If set to NO, only conditional compilation will be
+# performed. Macro expansion can be done in a controlled way by setting
+# EXPAND_ONLY_PREDEF to YES.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+MACRO_EXPANSION = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
+# the macro expansion is limited to the macros specified with the PREDEFINED and
+# EXPAND_AS_DEFINED tags.
+# The default value is: NO.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES, the include files in the
+# INCLUDE_PATH will be searched if a #include is found.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by the
+# preprocessor.
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be
+# used.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that are
+# defined before the preprocessor is started (similar to the -D option of e.g.
+# gcc). The argument of the tag is a list of macros of the form: name or
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
+# is assumed. To prevent a macro definition from being undefined via #undef or
+# recursively expanded use the := operator instead of the = operator.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+PREDEFINED =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
+# tag can be used to specify a list of macro names that should be expanded. The
+# macro definition that is found in the sources will be used. Use the PREDEFINED
+# tag if you want to use a different macro definition that overrules the
+# definition found in the source code.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
+# remove all references to function-like macros that are alone on a line, have
+# an all uppercase name, and do not end with a semicolon. Such function macros
+# are typically used for boiler-plate code, and will confuse the parser if not
+# removed.
+# The default value is: YES.
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration options related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES tag can be used to specify one or more tag files. For each tag
+# file the location of the external documentation should be added. The format of
+# a tag file without this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the
+# section "Linking to external documentation" for more information about the use
+# of tag files.
+# Note: Each tag file must have a unique name (where the name does NOT include
+# the path). If a tag file is not located in the directory in which doxygen is
+# run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
+# tag file that is based on the input files it reads. See section "Linking to
+# external documentation" for more information about the usage of tag files.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES, all external class will be listed in
+# the class index. If set to NO, only the inherited external classes will be
+# listed.
+# The default value is: NO.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will be
+# listed.
+# The default value is: YES.
+
+EXTERNAL_GROUPS = YES
+
+# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in
+# the related pages index. If set to NO, only the current project's pages will
+# be listed.
+# The default value is: YES.
+
+EXTERNAL_PAGES = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of 'which perl').
+# The default file (with absolute path) is: /usr/bin/perl.
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT
+# disabled, but it is recommended to install and use dot, since it yields more
+# powerful graphs.
+# The default value is: YES.
+
+CLASS_DIAGRAMS = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see:
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH =
+
+# You can include diagrams made with dia in doxygen documentation. Doxygen will
+# then run dia to produce the diagram and insert it in the documentation. The
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.
+# If left empty dia is assumed to be found in the default search path.
+
+DIA_PATH =
+
+# If set to YES the inheritance and collaboration graphs will hide inheritance
+# and usage relations if the target is undocumented or is not a class.
+# The default value is: YES.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz (see:
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
+# Bell Labs. The other options in this section have no effect if this option is
+# set to NO
+# The default value is: NO.
+
+HAVE_DOT = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
+# to run in parallel. When set to 0 doxygen will base this on the number of
+# processors available in the system. You can set it explicitly to a value
+# larger than 0 to get control over the balance between CPU load and processing
+# speed.
+# Minimum value: 0, maximum value: 32, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_NUM_THREADS = 0
+
+# When you want a differently looking font in the dot files that doxygen
+# generates you can specify the font name using DOT_FONTNAME. You need to make
+# sure dot is able to find the font, which can be done by putting it in a
+# standard location or by setting the DOTFONTPATH environment variable or by
+# setting DOT_FONTPATH to the directory containing the font.
+# The default value is: Helvetica.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTNAME = Helvetica
+
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
+# dot graphs.
+# Minimum value: 4, maximum value: 24, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTSIZE = 10
+
+# By default doxygen will tell dot to use the default font as specified with
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
+# the path where dot can find it using this tag.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_FONTPATH =
+
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
+# each documented class showing the direct and indirect inheritance relations.
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
+# graph for each documented class showing the direct and indirect implementation
+# dependencies (inheritance, containment, and class references variables) of the
+# class with other documented classes.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
+# groups, showing the direct groups dependencies.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LOOK = YES
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
+# class node. If there are many fields or methods and many nodes the graph may
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
+# number of items for each type to make the size more manageable. Set this to 0
+# for no limit. Note that the threshold may be exceeded by 50% before the limit
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
+# but if the number exceeds 15, the total amount of fields shown is limited to
+# 10.
+# Minimum value: 0, maximum value: 100, default value: 10.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+UML_LIMIT_NUM_FIELDS = 10
+
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
+# collaboration graphs will show the relations between templates and their
+# instances.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+TEMPLATE_RELATIONS = YES
+
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
+# YES then doxygen will generate a graph for each documented file showing the
+# direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDE_GRAPH = YES
+
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
+# set to YES then doxygen will generate a graph for each documented file showing
+# the direct and indirect include dependencies of the file with other documented
+# files.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command. Disabling a call graph can be
+# accomplished by means of the command \hidecallgraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALL_GRAPH = YES
+
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
+# dependency graph for every global function or class method.
+#
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command. Disabling a caller graph can be
+# accomplished by means of the command \hidecallergraph.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
+# hierarchy of all classes instead of a textual one.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
+# dependencies a directory has on other directories in a graphical way. The
+# dependency relations are determined by the #include relations between the
+# files in the directories.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. For an explanation of the image formats see the section
+# output formats in the documentation of the dot tool (Graphviz (see:
+# http://www.graphviz.org/)).
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
+# to make the SVG files visible in IE 9+ (other browsers do not have this
+# requirement).
+# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo,
+# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and
+# png:gdiplus:gdiplus.
+# The default value is: png.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_IMAGE_FORMAT = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
+# enable generation of interactive SVG images that allow zooming and panning.
+#
+# Note that this requires a modern browser other than Internet Explorer. Tested
+# and working are Firefox, Chrome, Safari, and Opera.
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
+# the SVG files visible. Older versions of IE do not have SVG support.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+INTERACTIVE_SVG = NO
+
+# The DOT_PATH tag can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the \dotfile
+# command).
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOTFILE_DIRS =
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that
+# contain msc files that are included in the documentation (see the \mscfile
+# command).
+
+MSCFILE_DIRS =
+
+# The DIAFILE_DIRS tag can be used to specify one or more directories that
+# contain dia files that are included in the documentation (see the \diafile
+# command).
+
+DIAFILE_DIRS =
+
+# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the
+# path where java can find the plantuml.jar file. If left blank, it is assumed
+# PlantUML is not used or called during a preprocessing step. Doxygen will
+# generate a warning when it encounters a \startuml command in this case and
+# will not generate output for the diagram.
+
+PLANTUML_JAR_PATH =
+
+# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
+# configuration file for plantuml.
+
+PLANTUML_CFG_FILE =
+
+# When using plantuml, the specified paths are searched for files specified by
+# the !include statement in a plantuml block.
+
+PLANTUML_INCLUDE_PATH =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
+# that will be shown in the graph. If the number of nodes in a graph becomes
+# larger than this value, doxygen will truncate the graph, which is visualized
+# by representing a node as a red box. Note that doxygen if the number of direct
+# children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+# Minimum value: 0, maximum value: 10000, default value: 50.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_GRAPH_MAX_NODES = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
+# generated by dot. A depth value of 3 means that only nodes reachable from the
+# root by following a path via at most 3 edges will be shown. Nodes that lay
+# further from the root node will be omitted. Note that setting this option to 1
+# or 2 may greatly reduce the computation time needed for large code bases. Also
+# note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+# Minimum value: 0, maximum value: 1000, default value: 0.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not seem
+# to support this out of the box.
+#
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support
+# this, this feature is disabled by default.
+# The default value is: NO.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_MULTI_TARGETS = YES
+
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
+# explaining the meaning of the various boxes and arrows in the dot generated
+# graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot
+# files that are used to generate the various graphs.
+# The default value is: YES.
+# This tag requires that the tag HAVE_DOT is set to YES.
+
+DOT_CLEANUP = YES
diff --git a/src/doc/RBA_IF_Specification.md b/src/doc/RBA_IF_Specification.md
new file mode 100644
index 0000000..daf2e61
--- /dev/null
+++ b/src/doc/RBA_IF_Specification.md
@@ -0,0 +1,2721 @@
+# RBA Interface Specification
+
+
+
+### Version 1.0
+
+
+
+### 2020/02/28
+
+
+
+<div style="page-break-after:always"></div>
+
+### Table of Contents
+
+​[**1. Purpose of this document**](#anchor0)
+
+​[**2. Arbitration Policy Type class**](#anchor1)
+2.1. Definition name
+2.2. Overview
+2.3. Class member
+
+[**3. Arbitrator Logic class**](#anchor2)
+3.1. Definition name
+3.2. Overview
+3.3. Class member
+
+[**4. Area class**](#anchor3)
+4.1. Definition name
+4.2. Overview
+4.3. Class member
+
+[**5. Base Point class**](#anchor4)
+5.1. Definition name
+5.2. Overview
+5.3. Class member
+
+[**6. Content Loser Type class**](#anchor5)
+6.1. Definition name
+6.2. Overview
+6.3. Class member
+
+[**7. Display class**](#anchor6)
+7.1. Definition name
+7.2. Overview
+7.3. Class member
+
+[**8. Json Parser class**](#anchor7)
+8.1. Definition name
+8.2. Overview
+8.3. Class member
+
+[**9. Model class**](#anchor8)
+9.1. Definition name
+9.2. Overview
+9.3. Class member
+
+[**10. Position Container class**](#anchor9)
+10.1. Definition name
+10.2. Overview
+10.3. Class member
+
+[**11. Result class**](#anchor10)
+11.1. Definition name
+11.2. Overview
+11.3. Class member
+
+[**12. Arbitration Result Status Type class**](#anchor11)
+12.1. Definition name
+12.2. Overview
+12.3. Class member
+
+[**13. Scene class**](#anchor12)
+13.1. Definition name
+13.2. Overview
+13.3. Class member
+
+[**14. Size class**](#anchor13)
+14.1. Definition name
+14.2. Overview
+14.3. Class member
+
+[**15. Sound Content class**](#anchor14)
+15.1. Definition name
+15.2. Overview
+15.3. Class member
+
+[**16. Sound Content State class**](#anchor15)
+16.1. Definition name
+16.2. Overview
+16.3. Class member
+
+[**17. View Action class**](#anchor16)
+17.1. Definition name
+17.2. Overview
+17.3. Class member
+
+[**18. View Action Type class**](#anchor17)
+18.1. Definition name
+18.2. Overview
+18.3. Class member
+
+[**19. View Content class**](#anchor18)
+19.1. Definition name
+19.2. Overview
+19.3. Class member
+
+[**20. View Content State class**](#anchor19)
+20.1. Definition name
+20.2. Overview
+20.3. Class member
+
+[**21. Zone class**](#anchor20)
+21.1. Definition name
+21.2. Overview
+21.3. Class member
+
+<div style="page-break-after:always"></div>
+<a id="anchor0"></a>
+
+# **1. Purpose**
+
+<span style="font-size:130%;">This document describes the interface specifications for RBA(Rule -based Arbitration).
+Chapter 2 explains each interface.</span>
+
+<div style="page-break-after:always"></div>
+<a id="anchor1"></a>
+
+# **2. Arbitration Policy Type class**
+
+<span style="font-size:130%;">**2.1. Definition name**</span>
+<span style="font-size:130%;">RBAArbitrationPolicy : std::uint8_t</span>
+
+<span style="font-size:130%;">**2.2. Overview**</span>
+<span style="font-size:130%;">Type of arbitration policy.</span>
+
+<span style="font-size:130%;">**2.3. Class member**</span>
+**DEFAULT**
+@brief
+Same as PRIORITY_LAST_COME_FIRST.
+
+**FIRST_COME_FIRST**
+@brief
+First Come First Arbitration.
+
+@details
+Give priority to first come request.
+
+**LAST_COME_FIRST**
+@brief
+Last Come First Arbitration.
+
+@details
+Give priority to last come request.
+
+**PRIORITY_FIRST_COME_FIRST**
+@brief
+Priority and First Come First Arbitration.
+
+@details
+Follow the Priority of Contents.
+If same priority then give priority to first come request.
+
+**PRIORITY_LAST_COME_FIRST**
+@brief
+Priority and Last Come First Arbitration.
+
+@details
+Follow the Priority of Contents.
+If same priority then give priority to last come request.
+
+<div style="page-break-after:always"></div>
+<a id="anchor2"></a>
+
+# **3. Arbitrator Logic class**
+
+<span style="font-size:130%;">**3.1. Definition name**</span>
+<span style="font-size:130%;">DLL_EXPORT RBAArbitrator</span>
+
+<span style="font-size:130%;">**3.2. Overview**</span>
+<span style="font-size:130%;">An object that performs arbitration processing based on rules generated from a model.
+Set the model generated using rba::RBAJsonParser in the constructor.</span>
+
+<span style="font-size:130%;">**3.3. Class member**</span>
+**RBAArbitrator(RBAModel\* newModel);**
+@brief
+Arbitrator logic constructor.
+
+@param newModel
+Processing model.
+The model is generated by rba::RBAJsonParser.
+
+**virtual ~RBAArbitrator() noexcept;**
+@brief
+Arbitrator logic destructor.
+
+**void setModel(RBAModel\* newModel);**
+@brief
+Sets the model for arbitration.
+The model is generated by rba::RBAJsonParser.
+
+@param newModel
+The model for arbitration.
+
+@details
+Replace the model with newModel.
+An arbitrator has only one model at all times.
+Model can be generated by using rba::RBAJsonParser. nullptr can not be set.
+
+**const RBAModel\* getModel() const;**
+@brief
+Returns the model for arbitration.
+
+@return
+The model for arbitration.
+
+@details
+Because the arbitrator always has a model, this API never returns nullptr.
+
+**void initialize(std::list\<std::string>& contexts);**
+@brief
+Set initial requirements of contents and scenes.
+
+@param contexts
+Context list of contents and scenes requests.
+Following is the structure of context name.
+<CONTENT_NAME> / <STATE_NAME>
+
+Example of context name:
+TEL/Calling
+TPMS/NORMAL
+AutoDriveScene
+
+You can omit "/ <STATE_NAME>" if content has only one state.
+
+@details
+After arbitrator creation or calling clearArbitration(), you can set initial state of contents and scenes for first arbitration.
+This API does not execute arbitration.
+The information of arbitration result will be empty.
+Don't call this API after starting arbitration until calling clearArbitration().
+
+**Example**
+```cpp
+RBAJsonParser parser;
+rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+std::list\<std::string> defaultContents = {
+ "CONTENT_A/NORMAL",
+ "CONTENT_B/NORMAL",
+ "CONTENT_C/NORMAL",
+ "CONTENT_D/NORMAL",
+};
+arb->initialize(defaultContents);
+std::unique_ptr\<RBAResult> result = arb->execute();
+```
+
+**std::unique_ptr\<RBAResult> execute(const std::string& contextName="", bool require=true);**
+@brief
+Executes arbitration with one requirement.
+
+@param contextName
+Context string of arbitration request.
+Display request or sound request :
+"<CONTENT_NAME>/<STATE_NAME>"
+If the content has only one state, the \<STATE> can be omitted.
+Scene request :
+"<SCENE_NAME>"
+
+@param require
+true : request displaying / outputting content or scene on (default)
+false : withdraw a request or scene off.
+
+@return
+The result of arbitration.
+
+@details
+Execute Arbitration with one requirement of a content or scene without properties.
+The arbitration result as the return value will be generated at every arbitration and will not be changed by another arbitration.
+Context indicates a content state or a scene.
+If the content or scene is not defined in the model, the arbitration will not executed and the state of the arbitration result will be UNKNWON_CONTENT_STATE.
+In this case, other property values are undefined.
+If the context is empty, this API just execute arbitration.
+
+**Exapmle**
+```cpp
+RBAJsonParser parser;
+rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+std::unique_ptr\<RBAResult> result = arb->execute("CONTENT_A/NORMAL", true);
+
+if (result->getStatusType() != rba::RBAResultStatusType::SUCCESS) {
+ std::cout << "ERROR: Unknown context" << std::endl;
+}
+```
+
+**std::unique_ptr\<RBAResult> execute(std::list\<std::string>& contexts, bool require=true);**
+@brief
+Executes arbitration with multiple requirements.
+
+@param contexts
+List of contexts.
+
+@param require
+true : request displaying / outputting content or scene on (default)
+false : withdraw a request or scene off.
+
+@return
+The result of arbitration.
+
+@details
+Execute Arbitration with multiple requirements of contents or scenes.
+Contents and Scenes can be mixed in the list.
+Display / Outputting request and withdraw request, scene on and scene off request can not be mixed.
+The arbitration result as the return value will be generated at every arbitration and will not be changed by another arbitration.
+Context indicates a content state or a scene.
+If the content or scene is not defined in the model, the arbitration will not executed and the state of the arbitration result will be UNKNWON_CONTENT_STATE.
+In this case, other property values are undefined.
+If the context is empty, this API just execute arbitration.
+Request order is the with the list. Beginning of the list will be treated as the first coming request.
+
+**Exapmle**
+```cpp
+RBAJsonParser parser;
+rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+std::list\<std::string> contents = {
+ "CONTENT_A/NORMAL",
+ "CONTENT_B/NORMAL",
+ "CONTENT_C/NORMAL",
+ "CONTENT_D/NORMAL",
+};
+std::unique_ptr\<RBAResult> result = arb->execute(contents, true);
+
+if (result->getStatusType() != rba::RBAResultStatusType::SUCCESS) {
+ std::cout << "ERROR: Unknown context" << std::endl;
+}
+```
+
+**std::unique_ptr\<RBAResult> execute(const std::string& sceneName, std::list\<std::pair\<std::string,std::int32_t>>& properties);**
+@brief
+Executes arbitration with a requirement of scene and scene properties.
+
+@param sceneName
+The Scene name of arbitration reauest.
+
+@param properties
+The list of pairs of property name and value.
+
+@return
+The result of arbitration.
+
+@details
+Sets the scene indicated by sceneName to the property specified by properties, and execute arbitration processing.
+If sceneName is empty, this API just execute arbitration.
+If the required scene is not defined in the model, the arbitration will not executed and the state of the arbitration result will be UNKNWON_CONTENT_STATE.
+Even If there is a property not defined in the model, the arbitration will be executed.
+
+@note
+You cannot set scene off and property at the same time, by this API.
+Use setScene() to set scene off and properties, and then call execute(const std::string&,bool) without specifying arguments.
+Or Use setScene() to set properties, and then call execute(scene name,false).
+
+**Example**
+```cpp
+RBAJsonParser parser;
+rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+std::list<std::pair<std::string, std::int32_t>> properties;
+properties.push_back(std::make_pair("Prop1", 10));
+properties.push_back(std::make_pair("Prop2", 20));
+std::unique_ptr<RBAResult> result = arb->execute("Scene1", properties);
+
+if (result->getStatusType() != rba::RBAResultStatusType::SUCCESS) {
+ std::cout << "ERROR: Unknown context" << std::endl;
+}
+```
+
+**std::unique_ptr\<RBAResult> setResultContentState(const std::string& allocatableName, const std::string& contextName);**
+@brief
+Replaces the result of arbitration.
+
+@param allocatableName
+Area or zone name.
+
+@param contextName
+Context string of arbitration request.
+
+@return
+The result of arbitration.
+
+@details
+Replace allocated a content state to area or zone of the last arbitration result.
+If the allocatableName or contextName is undefined, return the errror code from the method getStatusType() of result.
+If the contextName is non-active, activate the content request.
+This API execute the "Request handling on lost" process and the "Execution expression" process, and doesn't execute the check of constraint expression process.
+Therefore, this API can lead the result that does not satisfy the constraints.
+If the specified area or zone by allocatableName is hidden, mute or attenuated, these statuses will be kept.
+
+@deprecated
+Because there is a possibility that the result does not satisfy the constraints, please use execute() instead of this API.
+
+**Example**
+```cpp
+RBAJsonParser parser;
+rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+std::unique_ptr\<RBAResult> result = arb->execute("CONTENT_A/NORMAL", true);
+std::unique_ptr\<RBAResult> result_replaced =
+ arb->setResultContentState("AREA_A", "CONTENT_B/NORMAL");
+
+if (result_replaced->getStatusType() != rba::RBAResultStatusType::SUCCESS) {
+ std::cout << "ERROR" << std::endl;
+}
+```
+
+**std::unique_ptr\<RBAResult> cancelArbitration();**
+@brief
+Cancel last arbitration.
+
+@return
+The result of arbitration.
+
+@details
+Cancel last arbitration and restore internal state immediately.
+This API returns the restored result but the ViewActions will be empty.
+Do not execute this function more than once continuously.
+In that case, an error occurs.
+Even when executed without performing arbitration processing, an error occurs.
+In case of error, the status of the arbitration result is set to CANCEL_ERROR.
+
+**Example**
+```cpp
+RBAJsonParser parser;
+rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+std::unique_ptr\<RBAResult> result = arb->execute("CONTENT_A/NORMAL", true);
+std::unique_ptr\<RBAResult> result_back = arb->cancelArbitration();
+
+if (result_replaced->getStatusType() != rba::RBAResultStatusType::SUCCESS) {
+ std::cout << "ERROR" << std::endl;
+}
+```
+
+**void clearArbitration();**
+@brief
+Clear internal states of arbitration.
+
+@details
+Initialize internal states of arbitration (ex. Previous arbitration result, request of content states, etc...) and set to the initial state.
+
+@note
+This API is intended for setting up initial state of unit tests.
+
+**Example**
+```cpp
+std::unique_ptr\<RBAResult> result1 = arb->execute("CONTENT_A/NORMAL", true);
+std::unique_ptr\<RBAResult> result2 = arb->execute("CONTENT_B/NORMAL", true);
+// reset display requests
+arb->clearArbitration();
+std::unique_ptr\<RBAResult> result2 = arb->execute("CONTENT_C/NORMAL", true);
+std::unique_ptr\<RBAResult> result3 = arb->execute("CONTENT_D/NORMAL", true);
+```
+
+**bool setScene(const std::string& sceneName, bool require, std::list<std::pair<std::string, std::int32_t>>& properties);**
+@brief
+Sets scene ON/OFF requests and properties.
+
+@param sceneName
+The Scene name of arbitration reauest.
+
+@param require
+true : Valid request
+false : Invalid request
+
+@param properties
+The pair of property name and value.
+
+@return
+true: Success
+false: Unknown scene
+
+@details
+Sets the scene indicated by sceneName to the property specified by properties, and without execute arbitration processing.
+Returns true if the scene set succeeded.
+If an unknown scene name is specified, false is returned.
+
+@note
+This API is intended for setting up initial state of unit tests or setting global scene and scene properties.
+
+**Example**
+```cpp
+std::list<std::pair<std::string, std::int32_t>> props;
+props.push_back(std::make_pair("PropertyA", 10);
+props.push_back(std::make_pair("PropertyB", -3);
+res = arb->setScene("SCENE_A", true, props);
+if (res == false) {
+ // Unknwon scene
+}
+```
+
+**bool setContentState(const std::string& contextName, bool require);**
+@brief
+Sets content requests or scene ON/OFF request.
+
+@param contextName
+Context string of arbitration request.
+
+@param require
+true : request displaying / outputting content or scene on (default)
+false : withdraw a request or scene off.
+
+@return
+true: Success
+false: Unknown context
+
+@details
+Sets a display request for the context without arbitration.
+Returns true if the request setting is succeeded.
+If an unknown context name is specified, false is returned.
+
+@note
+This API is intended for setting up initial state of unit tests.
+While initialize() has only the function to turn on the request, this API can turn off the request.
+It is used for switch of each requests when initialization setting of unit test.
+
+**Example**
+```cpp
+res = arb->setContentState("ContentA/NORMAL", true);
+if (res == false) {
+ // Unknwon context
+}
+```
+
+**bool setAllocatableResult(const std::string& allocatableName, const std::string& contextName);**
+@brief
+Allocates content state to area or zone.
+
+@param allocatableName
+Name of area or zone.
+
+@param contextName
+Context string of content state.
+contextName : "<CONTENT_NAME>/<STATE_NAME>"
+If the content has only one state, the \<STATE> can be omitted.
+
+@return
+true: Success
+false: Unknown area, zone or context
+
+@details
+Allocates the content state to the area or zone.
+Arbitration and post arbitration will not be executed.
+The display / outputting request of the specified content state will be active.
+The statuses of hidden, mute and attenuated will not be changed.
+Returns true if the request setting is succeeded.
+If an unknown context name is specified, false is returned.
+
+@note
+This API is intended for setting up initial state of unit tests.
+In setResultContentState(), in addition to content state assignment, evaluation of the action determination process at the time of arbitration losing and control execution expression is performed, whereas in this API only content state assignment is performed.
+
+@deprecated
+Since there is a possibility of contradiction with the constraint, it is recommended not to use it except unit test.
+
+**Example**
+```cpp
+res = arb->setAllocatableResult("AreaA", "ContentA/NORMAL");
+if (res == false) {
+ // Unknwon area, zone or context
+}
+```
+
+<div style="page-break-after:always"></div>
+<a id="anchor3"></a>
+
+# **4. Area class**
+
+<span style="font-size:130%;">**4.1. Definition name**</span>
+<span style="font-size:130%;">DLL_EXPORT RBAArea</span>
+
+<span style="font-size:130%;">**4.2. Overview**</span>
+<span style="font-size:130%;">Defines a Frame for displaying the view content.
+At run time, at most one view content is allocated to one area.</span>
+
+<span style="font-size:130%;">**4.3. Class member**</span>
+**virtual std::string getName() const=0;**
+@brief
+Returns the name of the area.
+
+@return
+Area name.
+
+**virtual std::int32_t getX() const=0;**
+@brief
+Returns the x-axis value of the base point of the area.
+
+@return
+X-axis Value of the base point.
+
+**virtual std::int32_t getY() const=0;**
+@brief
+Returns the y-axis value of the base point of the area.
+
+@return
+Y-axis Value of the base point.
+
+**virtual std::int32_t getZorder() const=0;**
+@brief
+Returns the z-order value.
+An area with a large z-order value is displayed on the front of an area with small z-order value.
+
+@return
+Z-order value.
+
+**virtual const std::list<const RBAViewContent\*>& getContents() const=0;**
+@brief
+Returns the list of content which can be displayed on this area.
+
+@return
+List of content.
+
+**virtual const std::list<const RBASize\*>& getSizes() const=0;**
+@brief
+Returns the list of size defined to this area.
+Since multiple size can be defined, returns a list of size.
+
+@return
+List of size.
+
+**virtual RBAArbitrationPolicy getArbitrationPolicy() const=0;**
+@brief
+Returns the arbitration policy value defined to this area.
+
+@return
+Arbitration policy value.
+
+<div style="page-break-after:always"></div>
+<a id="anchor4"></a>
+
+# **5. Base Point class**
+
+<span style="font-size:130%;">**5.1. Definition name**</span>
+<span style="font-size:130%;">RBABasePoint : std::uint8_t</span>
+
+<span style="font-size:130%;">**5.2. Overview**</span>
+<span style="font-size:130%;">Base point for object having size. For example Area.</span>
+
+<span style="font-size:130%;">**5.3. Class member**</span>
+**LEFT_TOP**
+@brief
+Defines Left-Top coordinate as the base point of (x, y)
+The rectangle is represented by (x, y)-(x+width, y+height)
+
+**LEFT_MIDDLE**
+@brief
+Defines Left-Middle coordinate as the base point of (x, y)
+The rectangle is represented by (x, y-height/2)-(x+width, y+height/2)
+
+**LEFT_BOTTOM**
+@brief
+Defines Left-Bottom coordinate as the base point of (x, y)
+The rectangle is represented by (x, y-height)-(x+width, y)
+
+**RIGHT_TOP**
+@brief
+Defines Right-Top coordinate as the base point of (x, y)
+The rectangle is represented by (x-width, y)-(x, y+height)
+
+**RIGHT_MIDDLE**
+@brief
+Defines Right-Middle coordinate as the base point of (x, y)
+The rectangle is represented by (x-width, y-height/2)-(x, y+height/2)
+
+**RIGHT_BOTTOM**
+@brief
+Defines Right-Bottom coordinate as the base point of (x, y)
+The rectangle is represented by (x-width, y-height)-(x, y)
+
+**CENTER_TOP**
+@brief
+Defines Center-Top coordinate as the base point of (x, y)
+The rectangle is represented by (x-width/2, y)-(x+width/2, y+height)
+
+**CENTER_MIDDLE**
+@brief
+Defines Center-Middle coordinate as the base point of (x, y)
+The rectangle is represented by (x-width/2, y-height/2)- (x+width/2, y+height/2)
+
+**CENTER_BOTTOM**
+@brief
+Defines Center-Bottom coordinate as the base point of (x, y)
+The rectangle is represented by (x-width/2, y-height)-(x+width/2, y)
+
+<div style="page-break-after:always"></div>
+<a id="anchor5"></a>
+
+# **6. Content Loser Type class**
+
+<span style="font-size:130%;">**6.1. Definition name**</span>
+<span style="font-size:130%;">RBAContentLoserType : std::uint8_t</span>
+
+<span style="font-size:130%;">**6.2. Overview**</span>
+<span style="font-size:130%;">Type of behavior when content loses the arbitration.</span>
+
+<span style="font-size:130%;">**6.3. Class member**</span>
+**GOOD_LOSER=0**
+@brief
+Always cancels its request when losing arbitration.
+
+**DO_NOT_GIVEUP_UNTIL_WIN**
+@brief
+Cancels its request only if it lost the arbitration in the displaying state.
+
+**NEVER_GIVEUP**
+@brief
+Never cancels its request.
+
+<div style="page-break-after:always"></div>
+<a id="anchor6"></a>
+
+# **7. Display class**
+
+<span style="font-size:130%;">**7.1. Definition name**</span>
+<span style="font-size:130%;">RBADisplay</span>
+
+<span style="font-size:130%;">**7.2. Overview**</span>
+<span style="font-size:130%;">Defines a screen layout of the display.
+You can define multiple displays for Multi-Display products.
+Display defines a set of areas which are laid out on it.</span>
+
+<span style="font-size:130%;">**7.3. Class member**</span>
+**virtual std::string getName() const=0;**
+@brief
+Returns the name of display.
+
+@return
+Display name.
+
+**virtual const RBASize\* getSize() const=0;**
+@brief
+Returns the size of display.
+
+@return
+Size
+
+**virtual const std::list<const RBAArea\*>& getAreas() const=0;**
+@brief
+Returns areas which are allocated to the display.
+
+@return
+List of area.
+
+<div style="page-break-after:always"></div>
+<a id="anchor7"></a>
+
+# **8. Json Parser class**
+
+<span style="font-size:130%;">**8.1. Definition name**</span>
+<span style="font-size:130%;">DLL_EXPORT RBAJsonParser</span>
+
+<span style="font-size:130%;">**8.2. Overview**</span>
+<span style="font-size:130%;">Provides the facility that loads a model file in JSON format and generate a Model object.</span>
+
+<span style="font-size:130%;">**8.3. Class member**</span>
+**RBAModel\* parse(const std::string& filename);**
+@brief
+Loads a JSON file and generates a model object.
+
+@param filename
+Path of JSON file.
+
+@return
+Model
+If the file is not found, returns nullptr.
+
+**Example**
+```cpp
+rba::RBAJsonParser parser;
+rba::RBAModel* model = parser.parse("RBAModel.json");
+if (model == nullptr) {
+ std::cout << "ERRROR: Could not read JSON file" << std::endl;
+ return 1;
+}
+rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+```
+
+<div style="page-break-after:always"></div>
+<a id="anchor8"></a>
+
+# **9. Model class**
+
+<span style="font-size:130%;">**9.1. Definition name**</span>
+<span style="font-size:130%;">DLL_EXPORT RBAModel</span>
+
+<span style="font-size:130%;">**9.2. Overview**</span>
+<span style="font-size:130%;">Defines the arbitration rule model which is used by Arbitrator.
+The model consists of model elements such as areas, zones, contens, scenes, constraint expressions, and so on.
+Elements can be searched by name, and the list of elements for each type can be retrieved.</span>
+
+<span style="font-size:130%;">**9.3. Class member**</span>
+**virtual const RBAArea\* findArea(const std::string& areaName) const=0;**
+@brief
+Search for area with a name.
+
+@param areaName
+Area name.
+
+@return
+Area
+
+@details
+If the area name does not exist, returns nullptr.
+
+**virtual const RBAViewContent\* findViewContent(const std::string& contName) const=0;**
+@brief
+Search for view content with a name.
+
+@param contName
+Content name.
+
+@return
+Content
+
+@details
+If the content name does not exist, returns nullptr.
+
+**virtual const RBAViewContentState\* findViewContentState(const std::string& stateName) const=0;**
+@brief
+Search for view content state with a name.
+
+@param stateName
+Content state name.
+
+@return
+State of view content.
+
+@details
+If the content state name does not exist, returns nullptr.
+
+**virtual const RBASize\* findSize(const std::string& sizeName) const=0;**
+@brief
+Search for size with a name.
+
+@param sizeName
+Name of the search size.
+
+@return
+Size
+
+@details
+Specify the name of the search size as follows.
+In the case of the size linked to the area: <area_name>/<size_name>
+In the case of the size linked to the content: <content_name>/<size_name>
+If the name of the search size does not exist, returns nullptr.
+
+**virtual const RBAZone\* findZone(const std::string& zoneName) const=0;**
+@brief
+Search for zone with a name.
+
+@param zoneName
+Zone name.
+
+@return
+Zone
+
+@details
+If the zone name does not exist, returns nullptr.
+
+**virtual const RBASoundContent\* findSoundContent(const std::string& contName) const=0;**
+@brief
+Search for sound content with a name.
+
+@param stateName
+Content state name.
+
+@return
+Sound content state.
+
+@details
+If the content name does not exist, returns nullptr.
+
+**virtual const RBASoundContentState\* findSoundContentState(const std::string& stateName) const=0;**
+@brief
+Search for sound content state with a name.
+
+@param stateName
+Content state name.
+
+@return
+Sound content state.
+
+@details
+If the content state name does not exist, returns nullptr.
+
+**virtual const RBAScene\* findScene(const std::string& sceneName) const=0;**
+@brief
+Search for scene with a name.
+
+@param sceneName
+Scene name.
+
+@return
+Scene
+
+@details
+If the scene name does not exist, returns nullptr.
+
+**virtual const RBADisplay\* findDisplay(const std::string& displayName) const=0;**
+@brief
+Search for display with a name.
+
+@param displayName
+Display name.
+
+@return
+Display
+
+@details
+If the display name does not exist, returns nullptr.
+
+**virtual const std::list<const RBAArea\*>& getAreas() const=0;**
+@brief
+Returns all the areas.
+
+@return
+List of areas.
+
+**virtual const std::list<const RBAViewContent\*>& getViewContents() const=0;**
+@brief
+Returns all the view contents.
+
+@return
+List of contents.
+
+**virtual const std::list<const RBAViewContentState\*>& getViewContentStates() const=0;**
+@brief
+Returns all the view content states.
+
+@return
+List of view content states.
+
+**virtual const std::list<const RBASize\*>& getSizes() const=0;**
+@brief
+Returns all the sizes.
+
+@return
+List of sizes.
+
+**virtual const std::list<const RBAZone\*>& getZones() const=0;**
+@brief
+Returns all the zones.
+
+@return
+List of zones.
+
+**virtual const std::list<const RBASoundContent\*>& getSoundContents() const=0;**
+@brief
+Returns all the sound contents.
+
+@return
+List of sound contents.
+
+**virtual const std::list<const RBASoundContentState\*>& getSoundContentStates() const=0;**
+@brief
+Returns all the sound content states.
+
+@return
+List of sound content states.
+
+**virtual const std::list<const RBAScene\*>& getScenes() const=0;**
+@brief
+Returns all the scenes.
+
+@return
+List of scenes.
+
+**virtual const std::list<const RBADisplay\*>& getDisplays() const=0;**
+@brief
+Returns all the displays.
+
+@return
+List of displays.
+
+**virtual const RBAModelElement\* findModelElement(const std::string& elementName) const=0;**
+@brief
+Search for Model element with a name.
+
+@param elementName
+Model element name.
+
+@return
+Model element.
+
+@details
+If the Model element name does not exist, returns nullptr.
+
+**virtual const std::list<const RBAAreaSet\*>& getAreaSets() const=0;**
+@brief
+Returns all the sets of areas.
+
+@return
+List of sets of areas.
+
+**virtual const std::list<const RBAViewContentSet\*>& getViewContentSets() const=0;**
+@brief
+Returns all the sets of view contents.
+
+@return
+List of sets of view contents.
+
+**virtual const std::list<const RBAPositionContainer\*>& getPositionContainers() const=0;**
+@brief
+Returns all the position containers.
+
+@return
+List of sets of position containers.
+
+**virtual std::list<RBAConstraint\*>& getConstraints()=0;**
+@brief
+Returns all the constraints.
+
+@return
+List of constraints.
+
+**virtual std::list<RBAPostConstraint\*>& getPostConstraints()=0;**
+@brief
+Returns all the post constraints.
+
+@return
+List of post constraints.
+
+<div style="page-break-after:always"></div>
+<a id="anchor9"></a>
+
+# **10. Position Container class**
+
+<span style="font-size:130%;">**10.1. Definition name**</span>
+<span style="font-size:130%;">RBAPositionContainer</span>
+
+<span style="font-size:130%;">**10.2. Overview**</span>
+<span style="font-size:130%;">Get the type and position of the area to be displayed.</span>
+
+<span style="font-size:130%;">**10.3. Class member**</span>
+**virtual std::int32_t getX() const=0;**
+@brief
+Get X coordinate.
+
+@return
+X coordinate value.
+
+**virtual std::int32_t getY() const=0;**
+@brief
+Get Y coordinate.
+
+@return
+Y coordinate value.
+
+**virtual RBABasePoint getBasePoint() const=0;**
+@brief
+Get a base point.
+
+@return
+Base point.
+
+**virtual const RBAArea\* getArea() const=0;**
+@brief
+Get allocated area.
+
+@return
+Assigned area.
+
+**const static std::int32_t X_EDEFAULT=0;**
+@brief
+Default value of X coordinate.
+
+**const static std::int32_t Y_EDEFAULT=0;**
+@brief
+Default value of Y coordinate.
+
+**const static RBABasePoint BASE_POINT_EDEFAULT= RBABasePoint::LEFT_TOP;**
+@brief
+Base point default value.
+
+<div style="page-break-after:always"></div>
+<a id="anchor10"></a>
+
+# **11. Result class**
+
+<span style="font-size:130%;">**11.1. Definition name**</span>
+<span style="font-size:130%;">DLL_EXPORT RBAResult</span>
+
+<span style="font-size:130%;">**11.2. Overview**</span>
+<span style="font-size:130%;">Stores an arbitration result.
+The Arbitrator allocates Contents to Areas.
+Related information of those can be acquired from RBAResult.
+The arbitration result indicates which content is allocated to each area / zone.
+Also, snapshot information and view action information (only display results) indicating the difference from the last arbitration are included.</span>
+
+<span style="font-size:130%;">**11.3. Class member**</span>
+**virtual const std::list<const RBAArea\*>& getVisibleAreas() const=0;**
+@brief
+Returns the displaying areas determined by the last arbitration.
+
+@return
+List of visible areas.
+
+**virtual const std::list<const RBAZone\*>& getSoundingZones() const=0;**
+@brief
+Returns the outputting zones determined by the last arbitration.
+
+@return
+List of sounding zones.
+
+**virtual const std::list<const RBAViewContentState\*>& getVisibleContentStates() const=0;**
+@brief
+Returns the view content states to be displayed determined by the last arbitration.
+
+@return
+List of visible view content states.
+
+**virtual const std::list<const RBASoundContentState\*>& getSoundingContentStates() const=0;**
+@brief
+Returns the sound content states to be output determined by the last arbitration.
+
+@return
+List of sound content states to be output.
+
+@details
+The list contains sound contents to be attenuated.
+
+**virtual const std::list<const RBAViewContentState\*>& getActiveViewContentStates() const=0;**
+@brief
+Returns the active view content states at the last arbitration result.
+
+@return
+List of active view content states.
+
+@details
+The active view content states are those that have been requested to display so far.
+They do not include the view content state whose request has been withdrawn or canceled.
+
+**virtual const std::list<const RBASoundContentState\*>& getActiveSoundContentStates() const=0;**
+@brief
+Returns the active sound content states at the last arbitration result.
+
+@return
+List of active sound content states.
+
+@details
+The active sound content states are those that have been requested to output so far.
+They do not include the sound content state whose request has been withdrawn or canceled.
+
+**virtual const std::list<const RBAScene\*>& getActiveScenes() const=0;**
+@brief
+Returns the active scenes at the last arbitration.
+
+@return
+List of active scenes.
+
+@details
+The active scenes are those that have been requested for ON so far.
+They do not include scenes requested for OFF afterwards.
+
+**virtual const std::list<const RBAArea\*>& getInvisibleAreas() const=0;**
+@brief
+Returns the invisible areas determined by the last arbitration.
+
+@return
+List of invisible areas.
+
+@details
+Returns the areas which are not displayed out of all areas.
+The list contains areas to be hidden.
+
+**virtual const std::list<const RBAZone\*>& getUnsoundingZones() const=0;**
+@brief
+Returns the unsounding zones determined by the last arbitration.
+
+@return
+List of unsounding zones.
+
+@details
+Returns the zones which are not output out of all zones.
+The list contains zones to be muted.
+
+**virtual const std::list<const RBAArea\*>& getHiddenAreas() const=0;**
+@brief
+Returns the area that is hidden state and content has been allocated.
+
+@return
+List of areas.
+
+@details
+Returns the area which become to be invisible.
+The area invisible in the previous time is not included.
+The hidden state is a state in which the area must be hidden by a constraint expression.
+
+**virtual const std::list<const RBAZone\*>& getMuteZones() const=0;**
+@brief
+Returns the zone that is muted state and content has been allocated.
+
+@return
+List of muted zones.
+
+@details
+Retuens the zones that is defeted and canceled sound contents.
+The muted state is a state in which the zone must be muted by a constraint expression.
+
+**virtual const std::list<const RBAZone\*>& getAttenuatedZones() const=0;**
+@brief
+Returns the attenuated zones determined by the last arbitration.
+
+@return
+List of attenuated zones.
+
+**virtual const std::list<const RBAViewContent\*>& getCanceledViewContents() const=0;**
+@brief
+Returns the canceled view contents determined by the last arbitration.
+
+@return
+List of canceled view contents.
+
+@details
+Reterns list of view contents which are canceled by Request handling on lost definition such as Loser Type and Post Constraints.
+The list does not contain contents which are withdrawn.
+
+**virtual const std::list<const RBASoundContent\*>& getCanceledSoundContents() const=0;**
+@brief
+Returns the canceled sound contents determined by the last arbitration.
+
+@return
+List of canceled sound contents.
+
+@details
+Reterns list of sound contents which are canceled by Request handling on lost definition such as Loser Type and Post Constraints.
+The list does not contain contents which are withdrawn.
+
+**virtual const std::list<const RBAViewContent\*>& getStandbyViewContents() const=0;**
+@brief
+Returns the stand by view contents due to defeated at the last arbitration.
+
+@return
+List of stand by view contents.
+
+@details
+Returns list of view contents which are active but not allocated to any area.
+The list does not contains which are canceled contents or are allocated to hidden area.
+
+**virtual const std::list<const RBASoundContent\*>& getStandbySoundContents() const=0;**
+@brief
+Returns the stand by sound contents due to defeated at the last arbitration.
+
+@return
+List of stand by sound contents.
+
+@details
+Returns list of sound contents which are active but not allocated to any area.
+The list does not contains which are canceled contents or are allocated to muted area.
+
+**virtual const RBAViewContentState\* getContentState(const RBAArea\* area) const=0;**
+@brief
+Returns the view content state assigned to the area of the last arbitration.
+
+@param area
+Area
+
+@return
+The view content state assign to the area.
+
+@details
+If no view content state is allocated to the area, nullptr is returnd.
+If area is not defined in the Model or nullptr, nullptr is returnd.
+
+**virtual const RBASoundContentState\* getContentState(const RBAZone\* zone) const=0;**
+@brief
+Returns the sound content state assigned to the zone of the last arbitration.
+
+@param zone
+Zone
+
+@return
+The sound content state assign to the zone.
+
+@details
+If no sound content state is allocated to the zone, nullptr is returned.
+If zone is not defined in the Model or nullptr, nullptr is returnd.
+
+**virtual const std::list<const RBAArea\*> getArea(const RBAViewContentState\* state) const=0;**
+@brief
+Returns the area to which the view content state is allocated at the last arbitration.
+
+@param state
+View content state.
+
+@return
+The areas to which the view content state.
+
+@details
+If the view content state is not assigned to any area, empty list is returned.
+If state is not defined in the Model or nullptr, empty list is returned.
+
+**virtual const std::list<const RBAZone\*> getZone(const RBASoundContentState\* state) const=0;**
+@brief
+Get the zone to which the sound content state is allocated of the last arbitration.
+
+@param state
+Sound content state.
+
+@return
+The zones to which the sound content state is allocated.
+
+@details
+If the sound content state is not assigned to any zone, empty list is retuened.
+If state is not defined in the Model or nullptr, empty list is returned.
+
+**virtual const std::list<const RBAArea\*> getArea(const RBAViewContent\* content)const=0;**
+@brief
+Returns the area to which the view content is allocated of the last arbitration.
+
+@param content
+View content.
+
+@return
+The areas to which the view content is allocated.
+
+@details
+If the view content is not assigned to any area, empty list is returned.
+If content is not defined in the Model or nullptr, empty list is returned.
+This API is the same as getArea(RBAViewContentState*) except for the type of argument.
+
+**virtual const std::list<const RBAZone\*> getZone(const RBASoundContent\* content) const=0;**
+@brief
+Returns the zone to which the sound content state is allocated of the last arbitration.
+
+@param content
+Sound content.
+
+@return
+The zones to which the sound content is allocated.
+
+@details
+If the sound content is not assigned to any area, nullptr is returned.
+If content is not defined in the Model or nullptr, empty list is returned.
+This API is the same as getZone(RBASoundContentState*) except for the type of argument.
+
+**virtual const RBASize\* getSize(const RBAArea\* area) const=0;**
+@brief
+Returns the size of the area determined in the last arbitration.
+
+@param area
+Area
+
+@return
+The size of the area.
+
+@details
+Area may have multiple sizes and its size will vary by the allocated content.
+This API returns the size which are matched with allocated content.
+If no content is allocated to the area, returns nullptr.
+If area is not defined in the Model or nullptr, returns nullptr.
+Returns nullptr if nullptr is specified for area.
+
+**virtual bool isActive(const RBAScene\* scene) const=0;**
+@brief
+Returns true if the scene is ON at the last arbitration.
+
+@param scene
+Reference scene to be checked.
+
+@return
+true: the scene is ON
+false: the scene is OFF
+
+@details
+If scene is not defined in the Model or nullptr, returns false.
+Returns false if nullptr is specified for scene.
+
+**virtual bool isActive(const RBAViewContent\* content) const=0;**
+@brief
+Returns true if the view content is active.
+
+@param state
+Reference view content to be checked.
+
+@return
+true: Active
+false: Not active
+
+@details
+If content is not defined in the Model or nullptr, returns false.
+Returns false if nullptr is specified for content.
+
+**virtual bool isActive(const RBASoundContent\* content) const=0;**
+@brief
+Returns true if the sound content is active.
+
+@param state
+Reference sound content to be checked.
+
+@return
+true: Active
+false: Not active
+
+@details
+If content is not defined in the Model or nullptr, returns false.
+Returns false if nullptr is specified for content.
+
+**virtual bool isVisible(const RBAArea\* area) const=0;**
+@brief
+Returns true if the area is visible of the last arbitration.
+
+@param area
+Reference area to be checked.
+
+@return
+true: Visible
+false: Not visible
+
+@details
+Returns false if the area is hidden.
+If area is not defined in the Model or nullptr, returns false.
+Returns false if nullptr is specified for area.
+
+**virtual bool isSounding(const RBAZone\* zone) const=0;**
+@brief
+Returns true if the zone is sounding of the last arbitration.
+
+@param zone
+Reference zone to be checked.
+
+@return
+true: Sounding
+false: Not sounding
+
+@details
+Returns false if the zone is muted.
+If zone is not defined in the Model or nullptr, returns false.
+Returns false if nullptr is specified for zone.
+
+**virtual bool isVisible(const RBAViewContentState\* state) const=0;**
+@brief
+Returns true if the view content state is visible of the last arbitration.
+
+@param state
+Reference view content state to be checked.
+
+@return
+true: state is allocated to visible area.
+false: state is not allocated to visible area.
+
+@details
+If all of the areas to which the content is allocated are hidden, returns false.
+If state is not defined in the Model or nullptr, returns false.
+Returns false if nullptr is specified for state.
+
+**virtual bool isSounding(const RBASoundContentState\* state) const=0;**
+@brief
+Returns true if the sound content state is sounding of the last arbitration.
+
+@param state
+Reference sound content state to be check.
+
+@return
+true: state is allocated to outputting zone.
+false: state is not allocated to outputting zone.
+
+@details
+If all of the zones to which the content is allocated are muted, returns false.
+If state is not defined in the Model or nullptr, returns false.
+Returns false if nullptr is specified for state.
+
+**virtual const RBAViewContentState\* getViewContentState(const RBAArea\* area) const=0;**
+@brief
+Returns the view content state allocated to the area of the last arbitration.
+
+@param area
+Area
+
+@return
+The view content state allocated to the area.
+
+@details
+Even if the area is hidden, Returns the allocated content state.
+If no visible view content state is allocated the area, nullptr is returnd.
+If area is not defined in the Model or nullptr, returns nullptr.
+Returns nullptr if nullptr is specified for area.
+
+**virtual const RBASoundContentState\* getSoundContentState(const RBAZone\* zone) const=0;**
+@brief
+Returns the sounding sound content state assigned to the zone of the last arbitration.
+
+@param zone
+Zone
+
+@return
+The sounding sound content state assign to the zone.
+
+@details
+Even if the zone is muted, Returns the allocated content state.
+If no sounding sound content state is allocated the area, nullptr is returnd.
+If zone is not defined in the Model or nullptr, returns nullptr.
+Returns nullptr if nullptr is specified for zone.
+
+**virtual bool isHidden(const RBAArea\* area) const=0;**
+@brief
+Returns true if the area is hidden state of the last arbitration.
+
+@param area
+Reference area to be checked.
+
+@return
+true: Hidden
+false: Not hidden
+
+@Details
+The hidden state is a state in which the area must be hidden by a constraint expression.
+In the hidden state, it returns true even if the content is not assigned.
+If area is not defined in the Model or nullptr, returns false.
+Returns false if nullptr is specified for area.
+
+**virtual bool isMute(const RBAZone\* zone) const=0;**
+@brief
+Returns true if the zone is muted state of the last arbitration.
+
+@param zone
+Reference zone to be checked.
+
+@return
+true: Muted
+false: Not muted
+
+@details
+The muted state is a state in which the zone must be muted by a constraint expression.
+In the muted state, it returns true even if the content is not assigned.
+If zone is not defined in the Model or nullptr, returns nullptr.
+Returns false if nullptr is specified for zone.
+
+**virtual bool isAttenuated(const RBAZone\* zone) const=0;**
+@brief
+Returns true if the zone is attenuated of the last arbitration.
+
+@param zone
+Reference zone to be check.
+
+@return
+true: Attenuated
+false: Not attenuated
+
+@details
+If zone is not defined in the Model or nullptr, returns nullptr.
+Returns false if nullptr is specified for zone.
+
+**virtual bool isCancel(const RBAViewContentState\* state) const=0;**
+@brief
+Returns true if the view content state is canceled at the last arbitration.
+
+@param state
+Reference view content state to be checked.
+
+@return
+true: Canceled
+false: Not canceled or Not request view content state
+
+@details
+If state is not active, returns false.
+If state is not defined in the Model or nullptr, returns false.
+Returns false if nullptr is specified for state.
+
+**virtual bool isCancel(const RBASoundContentState\* state) const=0;**
+@brief
+Returns true if the sound content state is canceled at the last arbitration.
+
+@param state
+Reference view content state to be checked.
+
+@return
+true: Canceled
+false: Not canceled
+
+@details
+If state is not active, returns false.
+If state is not defined in the Model or nullptr, returns false.
+Returns false if nullptr is specified for state.
+
+**virtual const std::list<const RBAViewAction\*>& getViewActions() const=0;**
+@brief
+Returns information of view status changes (the view actions) of the last arbitration.
+
+@return
+List of view actions.
+
+@details
+ViewAction is an information of differences between the last arbitration result and its previous result.
+There is no difference between hidden and not displayed for visible status.
+
+**virtual RBAResultStatusType getStatusType() const=0;**
+@brief
+Returns the result status type of the last arbitration.
+
+@return
+SUCCESS: Success
+UNKNOWN_CONTENT_STATE: Failed (The reuqest is unknown)
+CANCEL_ERROR: Cancel arbitrration error
+
+**virtual bool satisfiesConstraints() const=0;**
+@brief
+Returns satisfied status of all online constraints.
+
+@return
+true: All online constraints check result is OK, and arbitration finished.
+false: All online constraints check result is NG, and arbitration finished.
+
+**virtual std::int32_t getSceneProperty(const RBAScene\* scene, const std::string& propertyName) const=0;**
+@brief
+Returns the property value of scene.
+
+@return
+Property value.
+
+@details
+If the scene or propertyName is not defined in the Model, returns -99.
+Returns -99 if a property name not defined in the model is specified in propertyName.
+
+**virtual const std::list<const RBAArea\*>& getPreVisibleAreas() const=0;**
+@brief
+Returns the displaying areas of the previous arbitration.
+
+@return
+List of visible areas.
+
+**virtual const std::list<const RBAZone\*>& getPreSoundingZones() const=0;**
+@brief
+Returns the outputting sounding zones of the previous arbitration.
+
+@return
+List of sounding zones.
+
+**virtual const std::list<const RBAViewContentState\*>& getPreVisibleContentStates() const=0;**
+@brief
+Returns the view content states to be displayed of the previous arbitration.
+
+@return
+List of visible view content states.
+
+**virtual const std::list<const RBASoundContentState\*>& getPreSoundingContentStates() const=0;**
+@brief
+Returns the sound content states to be outputted of the previous arbitration.
+
+@return
+List of sounding sound content states.
+
+@details
+The list contains attenuated content states.
+
+**virtual const std::list<const RBAViewContentState\*>& getPreActiveViewContentStates() const=0;**
+@brief
+Returns the active view content states of the previous arbitration result.
+
+@return
+List of active view content states.
+
+@details
+The active view content states are those that have been requested to display so far.
+They do not include the view content state whose request has been withdrawn or canceled.
+
+**virtual const std::list<const RBASoundContentState\*>& getPreActiveSoundContentStates() const=0;**
+@brief
+Returns the active sound content states of the previous arbitration result.
+
+@return
+List of active sound content states.
+
+@details
+The active sound content states are those that have been requested to output so far.
+They do not include the sound content state whose request has been withdrawn or canceled.
+
+**virtual const std::list<const RBAScene\*>& getPreActiveScenes() const=0;**
+@brief
+Returns the active scenes of the previous arbitration.
+
+@return
+List of active scenes.
+
+@details
+The active scenes are those that have been requested for ON so far.
+They do not include scenes requested for OFF afterwards.
+
+**virtual const std::list<const RBAArea\*>& getPreInvisibleAreas() const=0;**
+@brief
+Returns the invisible areas of the previous arbitration.
+
+@return
+List of invisible areas.
+
+@details
+Returns the areas which are not displayed out of all areas.
+The hidden area is also acquired.
+
+**virtual const std::list<const RBAZone\*>& getPreUnsoundingZones() const=0;**
+@brief
+Returns the unsounding zones of the previous arbitration.
+
+@return
+List of unsounding zones.
+
+@details
+Returns the zones which are not outputted out of all zones.
+Muted zones are also acquired.
+
+**virtual const std::list<const RBAArea\*>& getPreHiddenAreas() const=0;**
+@brief
+Returns the areas which have become invisible at the previous arbitration.
+
+@return
+List of areas.
+
+@details
+Returns the area which become to be invisible.
+
+**virtual const std::list<const RBAZone\*>& getPreMuteZones() const=0;**
+@brief
+Get the muted zones of the previous arbitration.
+
+@return
+List of muted zones.
+
+@details
+Retuens the zones that is defeted and canceled sound contents.
+
+**virtual const std::list<const RBAZone\*>& getPreAttenuatedZones() const=0;**
+@brief
+Returns the attenuated zones of the previous arbitration.
+
+@return
+List of attenuated zones.
+
+**virtual const std::list<const RBAViewContent\*>& getPreCanceledViewContents() const=0;**
+@brief
+Returns the canceled view contents of the previous arbitration.
+
+@return
+List of canceled view contents.
+
+@details
+In the previous arbitration process, the display content that has been canceled by the losing action is acquired.
+Due to the display withdrawal request, those for which the display request has been withdrawn are not acquired.
+
+**virtual const std::list<const RBASoundContent\*>& getPreCanceledSoundContents() const=0;**
+@brief
+Returns the canceled sound contents of the previous arbitration.
+
+@return
+List of canceled sound contents.
+
+@details
+In the previous arbitration process, the voice content that has been canceled by the losing action is acquired.
+A request whose output request has been withdrawn by the output withdrawal request is not acquired.
+
+**virtual const std::list<const RBAViewContent\*>& getPreStandbyViewContents() const=0;**
+@brief
+Returns the stand by view contents due to defeated at the previous arbitration.
+
+@return
+List of stand by view contents.
+
+@details
+There is a display request, and the display content that has not been allocated to the area is acquired.
+Due to the losing action, the display content whose request has been canceled or the display content which has been allocated to the area but has the area hidden is not obtained.
+
+**virtual const std::list<const RBASoundContent\*>& getPreStandbySoundContents() const=0;**
+@brief
+Returns the stand by sound contents due to defeated at previous arbitration.
+
+@return
+List of stand by sound contents.
+
+@details
+There is an output request, and the audio content not assigned to the zone is acquired.
+Due to the losing action, the audio content whose request has been canceled or the audio content assigned to the zone but the zone has been muted are not obtained.
+
+**virtual const RBAViewContentState\* getPreContentState(const RBAArea\* area) const=0;**
+@brief
+Returns the view content state assigned to the area of the previous arbitration.
+
+@param area
+Area
+
+@return
+The view content state assign to the area.
+
+@details
+If no view content state is allocated to the area, nullptr is returnd.
+If an area that is not defined in the model set in the arbitration FW that has performed arbitration processing is specified, nullptr is returned.
+If nullptr is specified in area, nullptr is returned.
+
+**virtual const RBASoundContentState\* getPreContentState(const RBAZone\* zone) const=0;**
+@brief
+Returns the sound content state assigned to the zone of the previous arbitration.
+
+@param zone
+Zone
+
+@return
+The sound content state assign to the zone.
+
+@details
+If no sound content state is allocated to the zone, nullptr is returned.
+If a zone that is not defined in the model set in the arbitration FW that has performed arbitration processing is specified, nullptr is returned.
+If nullptr is specified in zone, nullptr is returned.
+
+**virtual const std::list<const RBAArea\*> getPreArea(const RBAViewContentState\* state) const=0;**
+@brief
+Returns the area to which the view content state is allocated of the previous arbitration.
+
+@param state
+View content state.
+
+@return
+The areas to which the view content state.
+
+@details
+If no display content state has been assigned to the area, an empty list is returned.
+If a state that is not defined in the model set in the arbitration FW that has performed arbitration processing is specified, an empty list is returned.
+If nullptr is specified for state, an empty list is returned.
+
+**virtual const std::list<const RBAZone\*> getPreZone(const RBASoundContentState\* state) const=0;**
+@brief
+Get the zone to which the sound content state is allocated of the previous arbitration.
+
+@param state
+Sound content state.
+
+@return
+The zones to which the sound content state is allocated.
+
+@details
+Returns an empty list if no audio content state has been assigned to the zone.
+If a state that is not defined in the model set in the arbitration FW that has performed arbitration processing is specified, an empty list is returned.
+If nullptr is specified for state, an empty list is returned.
+
+**virtual const std::list<const RBAArea\*> getPreArea(const RBAViewContent\* content) const=0;**
+@brief
+Returns the area to which the view content is allocated of the previous arbitration.
+
+@param content
+View content.
+
+@return
+The areas to which the view content is allocated.
+
+@details
+If no display content has been assigned to the area, an empty list is returned.
+If content that has no definition is specified in the model set in the arbitration FW that has performed arbitration processing, an empty list is returned.
+If nullptr is specified for content, an empty list is returned.
+The only difference from getArea (RBAViewContentState *) is the type of the argument. If the request is for the same content, the return value always matches.
+
+**virtual const std::list<const RBAZone\*> getPreZone(const RBASoundContent\* content) const=0;**
+@brief
+Returns the zone to which the sound content state is allocated of the previous arbitration.
+
+@param content
+Sound content.
+
+@return
+The zones to which the sound content is allocated.
+
+@details
+If no audio content has been assigned to the zone, return an empty list.
+If content that has no definition is specified in the model set in the arbitration FW that has performed arbitration processing, an empty list is returned.
+If nullptr is specified for content, an empty list is returned.
+The only difference from getZone (RBASoundContentState *) is the type of the argument. If the request is for the same content, the return value always matches.
+
+**virtual const RBASize\* getPreSize(const RBAArea\* area) const=0;**
+@brief
+Returns the size of the area determined in the previous arbitration.
+
+@param area
+Area
+
+@return
+The size of the area.
+
+@details
+A plurality of sizes can be defined for the area, and the size changes according to the display content.
+Respond the size according to the display content allocated to the area.
+Returns nullptr if no display content has been assigned to the area.
+If an area that is not defined in the model set in the arbitration FW that has performed arbitration processing is specified, nullptr is returned.
+If nullptr is specified in area, nullptr is returned.
+
+**virtual bool isPreActive(const RBAScene\* scene) const=0;**
+@brief
+Returns true if the scene is active of the previous arbitration.
+
+@param scene
+Reference scene to be checked.
+
+@return
+true: Active
+false: Not active
+
+@details
+The active scene is the scene requested to ON.
+If a scene with no definition in the model set in the arbitration FW that has performed the arbitration process is specified, false is returned.
+Returns false if nullptr is specified in scene.
+
+**virtual bool isPreActive(const RBAViewContent\* content) const=0;**
+@brief
+Returns true if the view content is active of the previous arbitration.
+
+@param state
+Reference view content to be checked.
+
+@return
+true: Active
+false: Not active
+
+@details
+The active view content is the content requested to be displayed.
+If a display content with no definition in the model set in the arbitration FW that performed the arbitration process is specified, false is returned.
+Returns false if nullptr is specified for content.
+
+**virtual bool isPreActive(const RBASoundContent\* content) const=0;**
+@brief
+Returns true if the sound content is active of the previous arbitration.
+
+@param state
+Reference sound content to be checked.
+
+@return
+true: Active
+false: Not active
+
+@details
+The active sound content is the content requested to be outputted.
+If an audio content that is not defined in the model set in the arbitration FW that has performed arbitration processing is specified, false is returned.
+Returns false if nullptr is specified for content.
+
+**virtual bool isPreVisible(const RBAArea\* area) const=0;**
+@brief
+Returns true if the area is visible of the previous arbitration.
+
+@param area
+Reference area to be checked.
+
+@return
+true: Visible
+false: Not visible
+
+@details
+The concealed area returns false.
+If an area that is not defined in the model set in the arbitration FW that has performed arbitration processing is specified, false is returned.
+Returns false if nullptr is specified for area.
+
+**virtual bool isPreSounding(const RBAZone\* zone) const=0;**
+@brief
+Returns true if the zone is sounding of the previous arbitration.
+
+@param zone
+Reference zone to be checked.
+
+@return
+true: Sounding
+false: Not sounding
+
+@details
+Areas that have been muted return false.
+If a zone that is not defined in the model set in the arbitration FW that performed the arbitration process is specified, false is returned.
+Returns false if nullptr is specified in zone.
+
+**virtual bool isPreVisible(const RBAViewContentState\* state) const=0;**
+@brief
+Returns true if the view content state is visible of the previous arbitration.
+
+@param state
+Reference view content state to be checked.
+
+@return
+true: state is allocated to visible area.
+false: state is not allocated to visible area.
+
+@details
+Returns false if it is only assigned to a hidden area.
+If an area that is not defined in the model set in the arbitration FW that has performed arbitration processing is specified, false is returned.
+Returns false if nullptr is specified for state.
+
+**virtual bool isPreSounding(const RBASoundContentState\* state) const=0;**
+@brief
+Returns true if the sound content state is sounding of the previous arbitration.
+
+@param state
+Reference sound content state to check.
+
+@return
+true: state is allocated to outputting zone.
+false: state is not allocated to outputting zone.
+
+@details
+Returns false if assigned only to a muted zone.
+If a state that is not defined in the model set in the arbitration FW that performed the arbitration process is specified, false is returned.
+Returns false if nullptr is specified for state.
+
+**virtual const RBASoundContentState\* getPreSoundContentState(const RBAZone\* zone) const=0;**
+@brief
+Returns the sounding sound content state assigned to the zone of the previous arbitration.
+
+@param zone
+Zone
+
+@return
+The sounding sound content state assign to the zone.
+
+@details
+When a zone is muted, Returns the content state.
+If no sounding sound content state is allocated the area, nullptr is returnd.
+If a zone that is not defined in the model set in the arbitration FW that has performed arbitration processing is specified, nullptr is returned.
+If nullptr is specified in zone, nullptr is returned.
+
+**virtual bool isPreHidden(const RBAArea\* area) const=0;**
+@brief
+Returns true if the area is hidden of the previous arbitration.
+
+@param area
+Reference area to be checked.
+
+@return
+true: Hidden
+false: Not hidden
+
+@details
+If an area that is not defined in the model set in the arbitration FW that has performed arbitration processing is specified, false is returned.
+Returns false if nullptr is specified for area.
+
+**virtual bool isPreMute(const RBAZone\* zone) const=0;**
+@brief
+Returns true if the zone is muted of the previous arbitration.
+
+@param zone
+Reference zone to be checked.
+
+@return
+true: Muted
+false: Not muted
+
+@details
+If a zone that is not defined in the model set in the arbitration FW that performed the arbitration process is specified, false is returned.
+Returns false if nullptr is specified in zone.
+
+**virtual bool isPreAttenuated(const RBAZone\* zone) const=0;**
+@brief
+Returns true if the zone is attenuated of the previous arbitration.
+
+@param zone
+Reference zone to be checked.
+
+@return
+true: Attenuated
+false: Not attenuated
+
+@details
+If a zone that is not defined in the model set in the arbitration FW that performed the arbitration process is specified, false is returned.
+Returns false if nullptr is specified in zone.
+
+**virtual bool isPreCancel(const RBAViewContentState\* state) const=0;**
+@brief
+Returns true if the view content state is canceled of the previous arbitration.
+
+@param state
+Reference view content state to be checked.
+
+@return
+true: Canceled
+false: Not canceled or Not request view content state
+
+@details
+If the display content state for which there was no display request before the arbitration process is specified in state, false is returned.
+If a state that is not defined in the model set in the arbitration FW that performed the arbitration process is specified, false is returned.
+Returns false if nullptr is specified for state.
+
+**virtual bool isPreCancel(const RBASoundContentState\* state) const=0;**
+@brief
+Returns true if the sound content state is canceled of the previous arbitration.
+
+@param state
+Reference view content state to be checked.
+
+@return
+true: Canceled
+false: Not canceled
+
+@details
+If the audio content state for which no output request was made before the arbitration process is specified in state, false is returned.
+If a state that is not defined in the model set in the arbitration FW that performed the arbitration process is specified, false is returned.
+Returns false if nullptr is specified for state.
+
+**virtual std::string getLog() const=0;**
+@brief
+Returns the log of the last arbitration.
+
+@return
+Log string.
+
+**virtual bool hasDisplayingArea(const RBADisplay\* display) const=0;**
+@brief
+Get the display state of the display.
+
+@param display
+Display to check.
+
+@return
+true: Something is displayed
+false: Nothing is displayed
+
+<div style="page-break-after:always"></div>
+<a id="anchor11"></a>
+
+# **12. Arbitration Result Status Type class**
+
+<span style="font-size:130%;">**12.1. Definition name**</span>
+<span style="font-size:130%;">RBAResultStatusType : std::uint8_t</span>
+
+<span style="font-size:130%;">**12.2. Overview**</span>
+<span style="font-size:130%;">Status of the arbitration result.</span>
+
+<span style="font-size:130%;">**12.3. Class member**</span>
+**SUCCESS**
+@brief
+Success
+
+**FAILED**
+@brief
+Failed
+
+**UNKNOWN_CONTENT_STATE**
+@brief
+Unknown context or content state.
+
+**CANCEL_ERROR**
+@brief
+Cancel arbitration error.
+
+<div style="page-break-after:always"></div>
+<a id="anchor12"></a>
+
+# **13. Scene class**
+
+<span style="font-size:130%;">**13.1. Definition name**</span>
+<span style="font-size:130%;">RBAScene</span>
+
+<span style="font-size:130%;">**13.2. Overview**</span>
+<span style="font-size:130%;">Express the state(Including system state) at that time comprehensively.
+Used scene for switch area/zone and view/sound content state.
+And plural RBA model(project) can share arbitration result by definitions global scene.</span>
+
+<span style="font-size:130%;">**13.3. Class member**</span>
+**virtual std::string getName() const=0;**
+@brief
+Returns the scene name.
+
+@return
+Scene name.
+
+**virtual bool isGlobal() const=0;**
+@brief
+Returns the global scene status.
+
+@return
+Global scene status.
+
+**virtual const std::list\<std::string>& getPropertyNames() const=0;**
+@brief
+Returns List of the scene property name.
+
+@return
+List of the scene property name.
+
+**virtual std::int32_t getPropertyValue(const std::string& propertyName) const=0;**
+@brief
+Returns Default value of the scene property.
+
+@param propertyName
+Scene property name.
+
+@return
+Default value of the scene property.
+
+<div style="page-break-after:always"></div>
+<a id="anchor13"></a>
+
+# **14. Size class**
+
+<span style="font-size:130%;">**14.1. Definition name**</span>
+<span style="font-size:130%;">DLL_EXPORT RBASize</span>
+
+<span style="font-size:130%;">**14.2. Overview**</span>
+<span style="font-size:130%;">Size definitions for object such as areas or view contents.
+Each object can define plural size.
+Can refer to size from object.</span>
+
+<span style="font-size:130%;">**14.3. Class member**</span>
+**virtual std::string getName() const=0;**
+@brief
+Returns the name of the size.
+
+@return
+Size name.
+
+**virtual std::int32_t getWidth() const=0;**
+@brief
+Returns the width of the size.
+
+@return
+Width of the size.
+
+**virtual std::int32_t getHeight() const=0;**
+@brief
+Returns the height of the size.
+
+@return
+Height of the size.
+
+**const static std::int32_t WIDTH_EDEFAULT = 0;**
+@brief
+Default width of size.
+
+**const static std::int32_t HEIGHT_EDEFAULT = 0;**
+@brief
+Default height of size.
+
+<div style="page-break-after:always"></div>
+<a id="anchor14"></a>
+
+# **15. Sound Content class**
+
+<span style="font-size:130%;">**15.1. Definition name**</span>
+<span style="font-size:130%;">DLL_EXPORT RBASoundContent</span>
+
+<span style="font-size:130%;">**15.2. Overview**</span>
+<span style="font-size:130%;">Define the object of sound content.
+Sound content has plural status.
+When sound contents connected to a zone, active status is output.
+Object has zone definitions, that can output itself.
+Each object can define plural zone which can output sound contents.</span>
+
+<span style="font-size:130%;">**15.3. Class member**</span>
+**virtual std::string getName() const=0;**
+@brief
+Returns the name of the sound content.
+
+@return
+Sound content name.
+
+**virtual const std::list<const RBASoundContentState\*>& getContentStates() const=0;**
+@brief
+Returns the state of the sound content.
+
+@return
+List of the sound content state.
+
+**virtual const std::list<const RBAZone\*>& getZones() const=0;**
+@brief
+Returns the zone of the sound content.
+
+@return
+List of the zone.
+
+**virtual RBAContentLoserType getLoserType() const=0;**
+@brief
+Returns the loser type.
+
+@return
+Loser type.
+
+**const static RBAContentLoserType LOSER_TYPE_EDEFAULT = RBAContentLoserType::NEVER_GIVEUP;**
+@brief
+Defines the default loser type.
+
+<div style="page-break-after:always"></div>
+<a id="anchor15"></a>
+
+# **16. Sound Content State class**
+
+<span style="font-size:130%;">**16.1. Definition name**</span>
+<span style="font-size:130%;">DLL_EXPORT RBASoundContentState</span>
+
+<span style="font-size:130%;">**16.2. Overview**</span>
+<span style="font-size:130%;">Define the state of sound contents.</span>
+
+<span style="font-size:130%;">**16.3. Class member**</span>
+**virtual std::string getName() const=0;**
+@brief
+Returns the name of the sound contents state.
+
+@return
+Sound contents state name.
+
+**virtual std::int32_t getPriority() const=0;**
+@brief
+Returns the priority.
+
+@return
+Priority value.
+
+**virtual const RBASoundContent\* getOwner() const=0;**
+@brief
+Returns the sound content.
+
+@return
+Sound content.
+
+**virtual std::int32_t getOrder() const=0;**
+@brief
+Returns the order.
+
+@return
+Order value.
+
+@details
+The order is a number of sequence of the entry sound content state by request.
+The order value is an integer value starting from 1 and incremented in order, and the order value of the sound content state without sound request is set to 0.
+The order of the sound content state does not include the output request of the view content state.
+
+**virtual std::string getUniqueName() const=0;**
+@brief
+Returns the unique character string of the sound contents state.
+
+@return
+Unique character string of the sound contents state.
+
+@details
+Unique character string is sound content name + CONTEXT_SEPARATER + sound content state name.
+Use the unique character string as a context name.
+
+**static std::string getContentNameByContext(const std::string& context);**
+@brief
+Returns the name of the sound content from context name.
+
+@param context
+The context name.
+
+@return
+Name of the sound content.
+
+**static std::string getContentStateNameByContext(const std::string& context);**
+@brief
+Returns the state of the sound content from context name.
+
+@param context
+The context name.
+
+@return
+State of the sound content.
+
+**static bool isUniqueName(const std::string& context);**
+@brief
+Check if argument is The unique character string(context name).
+
+@param context
+The context name.
+
+@return
+true: unique character string(context name)
+false: Not unique character string(context name)
+
+**const static std::int32_t PRIORITY_EDEFAULT = 0;**
+@brief
+Defines the default priority value.
+
+**const static char CONTEXT_SEPARATER = '/';**
+@brief
+Defines the separator for separating sound content name and sound content state name.
+And be the character to connect it.
+
+<div style="page-break-after:always"></div>
+<a id="anchor16"></a>
+
+# **17. View Action class**
+
+<span style="font-size:130%;">**17.1. Definition name**</span>
+<span style="font-size:130%;">DLL_EXPORT RBAViewAction</span>
+
+<span style="font-size:130%;">**17.2. Overview**</span>
+<span style="font-size:130%;">Define the change information of view contents.
+Change information has 2 type.
+The contents transition, that view contents change for an area.
+The contents move, that the view content displayed area changes.</span>
+
+<span style="font-size:130%;">**17.3. Class member**</span>
+**virtual const RBAArea\* getArea() const;**
+@brief
+Returns the area of the contents transition.
+
+@return
+Area of the contents transition.
+
+**virtual const RBAViewContent\* getFromContent() const;**
+@brief
+Returns previously displayed the view content.
+Used when change information type is the contents transition(TRANSITION_REPLACE).
+
+@return
+Previously displayed the view content.
+
+@details
+If the change information type is not the contents transition(TRANSITION_REPLACE), returns nullptr.
+
+**virtual const RBAViewContent\* getToContent() const;**
+@brief
+Returns subsequently displayed the view content.
+Used when change information type is the contents transition(TRANSITION_REPLACE).
+
+@return
+Subsequently displayed the view content.
+
+@details
+If the change information type is not the contents transition(TRANSITION_REPLACE), returns nullptr.
+
+**virtual const RBAViewContentState\* getFromContentState() const;**
+@brief
+Returns previously displayed the view content state.
+Used when change information type is the contents transition(TRANSITION_REPLACE).
+
+@return
+Previously displayed the view content state.
+
+@details
+If the change information type is not the contents transition(TRANSITION_REPLACE), returns nullptr.
+
+**virtual const RBAViewContentState\* getToContentState() const;**
+@brief
+Returns subsequently displayed the view content state.
+Used when change information type is the contents transition(TRANSITION_REPLACE).
+
+@return
+Subsequently displayed the view content state.
+
+@details
+If the change information type is not the contents transition(TRANSITION_REPLACE), returns nullptr.
+
+**virtual const RBAArea\* getFromArea() const;**
+@brief
+Returns previously displayed the area.
+Used when change information type is the contents move(MOVE).
+@return
+Previously displayed the area.
+
+@details
+If the change information type is not the contents move(MOVE), returns nullptr.
+
+**virtual const RBAArea\* getToArea() const;**
+@brief
+Returns subsequently displayed the area.
+Used when change information type is the contents move(MOVE).
+
+@return
+Subsequently displayed the area.
+
+@details
+If the change information type is not the contents move(MOVE), returns nullptr.
+
+**virtual const RBAViewContent\* getContent() const;**
+@brief
+Returns view content of change information.
+
+@return
+View content of change information.
+
+@details
+If getViewActionType() == TRANSITION_ADD, returns display view content.
+If getViewActionType() == TRANSITION_REMOVE, returns hide view content.
+If getViewActionType() == TRANSITION_REPLACE, returns nullptr.
+If getViewActionType() == MOVE, returns view content which changes the area.
+
+**virtual const RBAViewContentState\* getContentState() const;**
+@brief
+Returns view content state of change information.
+
+@return
+View content state of change information.
+
+@details
+If getViewActionType() == TRANSITION_ADD, returns display view content state.
+If getViewActionType() == TRANSITION_REMOVE, returns hide view content state.
+If getViewActionType() == TRANSITION_REPLACE, returns nullptr.
+If getViewActionType() == MOVE, returns view content state which changes the area.
+
+**virtual RBAViewActionType getViewActionType() const=0;**
+@brief
+Returns view action type.
+
+@return
+View action type.
+
+**virtual bool operator==(const RBAViewAction& viewAction)=0;**
+@brief
+Equal operator.
+
+@return
+true: equal
+false: not equal
+
+<div style="page-break-after:always"></div>
+<a id="anchor17"></a>
+
+# **18. View Action Type class**
+
+<span style="font-size:130%;">**18.1. Definition name**</span>
+<span style="font-size:130%;">RBAViewActionType : std::uint8_t</span>
+
+<span style="font-size:130%;">**18.2. Overview**</span>
+<span style="font-size:130%;">Indicates the type of view action.</span>
+
+<span style="font-size:130%;">**18.3. Class member**</span>
+**TRANSITION_ADD**
+@brief
+The content transition(ADD) : content is displayed in the area.
+
+**TRANSITION_REMOVE**
+@brief
+The content transition(REMOVE) : content is deleted from the area.
+
+**TRANSITION_REPLACE**
+@brief
+The content transition(REPLACE) : content is replaced on the area.
+
+**MOVE**
+@brief
+The content move(MOVE) : The display of content changes to another area.
+
+<div style="page-break-after:always"></div>
+<a id="anchor18"></a>
+
+# **19. View Content class**
+
+<span style="font-size:130%;">**19.1. Definition name**</span>
+<span style="font-size:130%;">RBAViewContent</span>
+
+<span style="font-size:130%;">**19.2. Overview**</span>
+<span style="font-size:130%;">Define the object of view content.
+View content has plural status.
+When view contents connected to a area, active status is displayed.
+Each object can define plural area which can displayed view contents.</span>
+
+<span style="font-size:130%;">**19.3. Class member**</span>
+**virtual std::string getName() const=0;**
+@brief
+Returns the name of the view content.
+
+@return
+View content name.
+
+**virtual const std::list<const RBAViewContentState\*>& getContentStates() const=0;**
+@brief
+Returns the state of the view content.
+
+@return
+List of view content state.
+
+**virtual const std::list<const RBAArea\*>& getAreas() const=0;**
+@brief
+Returns the area of the view content.
+
+@return
+List of the area.
+
+**virtual const std::list<const RBASize\*>& getSizes() const=0;**
+@brief
+Returns the list of size assignment to this content.
+
+@return
+List of size.
+
+**virtual RBAContentLoserType getLoserType() const=0;**
+@brief
+Returns the loser type.
+
+@return
+Loser type.
+
+**const static RBAContentLoserType LOSER_TYPE_EDEFAULT =
+RBAContentLoserType::NEVER_GIVEUP;**
+@brief
+Defines the default loser type.
+
+<div style="page-break-after:always"></div>
+<a id="anchor19"></a>
+
+# **20. View Content State class**
+
+<span style="font-size:130%;">**20.1. Definition name**</span>
+<span style="font-size:130%;">DLL_EXPORT RBAViewContentState</span>
+
+<span style="font-size:130%;">**20.2. Overview**</span>
+<span style="font-size:130%;">Define the state of view contents.</span>
+
+<span style="font-size:130%;">**20.3. Class member**</span>
+**virtual std::string getName() const=0;**
+@brief
+Returns the name of the view contents state.
+
+@return
+View contents state name.
+
+**virtual std::int32_t getPriority() const=0;**
+@brief
+Returns the priority.
+
+@return
+Priority value.
+
+**virtual const RBAViewContent\* getOwner() const=0;**
+@brief
+Returns the view content.
+
+@return
+View content.
+
+**virtual std::int32_t getOrder() const=0;**
+@brief
+Returns the order.
+
+@return
+Order value.
+
+@details
+The order is a number of sequence of the entry view content state by request.
+The order value is an integer value starting from 1 and incremented in order, and the order value of the view content state without view request is set to 0.
+The order of the view content state does not include the output request of the sound content state.
+
+**virtual std::string getUniqueName() const=0;**
+@brief
+Returns the unique character string of the view contents state.
+
+@return
+Unique character string of the view contents state.
+
+@details
+Unique character string is view content name + CONTEXT_SEPARATER + view content state name.
+Use the unique character string as a context name.
+
+**static std::string getContentNameByContext(const std::string& context);**
+@brief
+Returns the name of the view content from context name.
+
+@param context
+The context name.
+
+@return
+Name of the view content.
+
+**static std::string getContentStateNameByContext(const std::string& context);**
+@brief
+Returns the state of the view content from context name.
+
+@param context
+The context name.
+
+@return
+State of the view content.
+
+**static bool isUniqueName(const std::string& context);**
+@brief
+Check if argument is The unique character string(context name).
+
+@param context
+The context name.
+
+@return
+true: unique character string(context name)
+false: Not unique character string(context name)
+
+**const static std::int32_t PRIORITY_EDEFAULT = 0;**
+@brief
+Defines the default priority value.
+
+**const static char CONTEXT_SEPARATER = '/';**
+@brief
+Defines the separator for separating view content name and view content state name.
+And be the character to connect it.
+
+<div style="page-break-after:always"></div>
+<a id="anchor20"></a>
+
+# **21. Zone class**
+
+<span style="font-size:130%;">**21.1. Definition name**</span>
+<span style="font-size:130%;">DLL_EXPORT RBAZone</span>
+
+<span style="font-size:130%;">**21.2. Overview**</span>
+<span style="font-size:130%;">Defines a Frame for outputting sound content.
+At run time, at most one sound content is allocated to one zone.
+This class has arbitration policy definitions, because it is executed for each zone.</span>
+
+<span style="font-size:130%;">**21.3. Class member**</span>
+**virtual std::string getName() const=0;**
+@brief
+Returns the name of the zone.
+
+@return
+Zone name.
+
+**virtual std::int32_t getPriority() const=0;**
+@brief
+Returns the priority.
+
+@return
+Priority value.
+
+**virtual const std::list<const RBASoundContent\*>& getContents() const=0;**
+@brief
+Returns the list of content which can be output in this zone.
+
+@return
+List of content.
+
+**virtual RBAArbitrationPolicy getArbitrationPolicy() const=0;**
+@brief
+Returns the arbitration policy value defined to this zone.
+
+@return
+Arbitration policy value.
diff --git a/src/doc/images/ArbitrationFW.png b/src/doc/images/ArbitrationFW.png
new file mode 100644
index 0000000..e3725cb
--- /dev/null
+++ b/src/doc/images/ArbitrationFW.png
Binary files differ
diff --git a/src/doc/images/ArbitrationFW.pu b/src/doc/images/ArbitrationFW.pu
new file mode 100644
index 0000000..0d1dee3
--- /dev/null
+++ b/src/doc/images/ArbitrationFW.pu
@@ -0,0 +1,80 @@
+@startuml
+'Define each component'
+package "Arbitration FW" as pac_ARBFW {
+ [Create arbitration results] as CRERES
+ [Creating differential information \nfor arbitration results] as CRERESDIFINFO
+
+ package "Arbitration function" as pac_ARBFUNC {
+ [Arbitration(Core)] as ARBCORE
+ [Re-arbitration, re-arbitration\n of affected area] as REARBAFF
+ [Arbitration policy] as ARBPOLI
+ [Constraint expression] as CONSTEXP
+ () "Content state" as CON_STA
+ () Evaluation
+ () Reassessment
+ () "Policy acquisition" as POL_ACQ
+ }
+
+ package "Cancel or wait function\n when arbitration is lost" as pac_CANWAITFUNC {
+ [Lost action(loser Type)] as LOSTYPE
+ () "Losing action \nevaluation" as LOS_ACT
+ }
+
+ package "Arbitration function \nbetween ECU" as pac_ARBFUNCECU {
+ [Control execution expression] as CONTEXEEXP
+ () Run
+ }
+
+ [Rule definition file\n replacement function] as RULEDEFFILE
+ [Generating rule models] as GENRULEMOD
+ [Rule model definition] as RULEMODDEF
+ [Log output function] as LOGOUTFUNC
+ [OS, PF Non-dependent] as OSPFNON
+ () "Arbitration result" as ARB_RES
+ () "Set content" as SET_CNT
+ () Create
+ () "JSON Reading" as JSON_READ
+ () "Get definition" as GET_DEF
+}
+
+'Adjust location'
+RULEMODDEF -[hidden]u- pac_ARBFUNCECU
+CONTEXEEXP -[hidden]r- ARBCORE
+ARBPOLI -[hidden]r- REARBAFF
+
+'Connect components with lines'
+CRERES -d- ARB_RES
+ CRERESDIFINFO -u-( ARB_RES
+RULEDEFFILE -u- JSON_READ
+ GENRULEMOD --( JSON_READ
+GENRULEMOD -- SET_CNT
+ RULEMODDEF --( SET_CNT
+
+CRERES --( Create
+ ARBCORE -u- Create
+CRERESDIFINFO --( Create
+
+REARBAFF -d- CON_STA
+ ARBPOLI -u-( CON_STA
+
+ARBCORE -d- Reassessment
+ REARBAFF -u-( Reassessment
+ARBCORE -d- POL_ACQ
+ ARBPOLI -u-( POL_ACQ
+ARBCORE -- LOS_ACT
+ LOSTYPE -u-( LOS_ACT
+ARBCORE -u-( Run
+ CONTEXEEXP -- Run
+
+REARBAFF -- Evaluation
+ CONSTEXP -u-( Evaluation
+ ARBCORE -- Evaluation
+ CONTEXEEXP -- Evaluation
+
+RULEMODDEF -d- GET_DEF #0000FF
+ pac_CANWAITFUNC -u-( GET_DEF #0000FF
+ ARBPOLI -u-( GET_DEF #0000FF
+ CONTEXEEXP -u-( GET_DEF #0000FF
+ pac_ARBFUNC -u-( GET_DEF #0000FF
+
+@enduml
diff --git a/src/doc/images/JSON_configuration1.png b/src/doc/images/JSON_configuration1.png
new file mode 100644
index 0000000..37ac277
--- /dev/null
+++ b/src/doc/images/JSON_configuration1.png
Binary files differ
diff --git a/src/doc/images/JSON_configuration2.png b/src/doc/images/JSON_configuration2.png
new file mode 100644
index 0000000..b2ff516
--- /dev/null
+++ b/src/doc/images/JSON_configuration2.png
Binary files differ
diff --git a/src/doc/images/JSON_configuration3.png b/src/doc/images/JSON_configuration3.png
new file mode 100644
index 0000000..d9a4e6f
--- /dev/null
+++ b/src/doc/images/JSON_configuration3.png
Binary files differ
diff --git a/src/doc/images/JSON_configuration4.png b/src/doc/images/JSON_configuration4.png
new file mode 100644
index 0000000..e4e66eb
--- /dev/null
+++ b/src/doc/images/JSON_configuration4.png
Binary files differ
diff --git a/src/doc/images/JSON_configuration5.png b/src/doc/images/JSON_configuration5.png
new file mode 100644
index 0000000..dd9c5b1
--- /dev/null
+++ b/src/doc/images/JSON_configuration5.png
Binary files differ
diff --git a/src/doc/images/JSON_configuration6.png b/src/doc/images/JSON_configuration6.png
new file mode 100644
index 0000000..0d7467b
--- /dev/null
+++ b/src/doc/images/JSON_configuration6.png
Binary files differ
diff --git a/src/doc/mkdoc.sh b/src/doc/mkdoc.sh
new file mode 100755
index 0000000..c082eb4
--- /dev/null
+++ b/src/doc/mkdoc.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+WORKDIR=./work
+TARGETDIR=../include/rba
+DOXYGEN=Doxygen
+LOGO_FILE=denso_logo.png
+
+if [ -d $WORKDIR ]; then
+ /bin/rm -fr $WORKDIR
+fi
+mkdir $WORKDIR
+
+worksrc=$WORKDIR/src
+if [ -d $worksrc ]; then
+ /bin/rm -fr $worksrc
+fi
+mkdir $worksrc
+
+for hppfile in `ls $TARGETDIR | grep "\.hpp$"`; do
+ cat $TARGETDIR/$hppfile | python3 ../script/conv_release.py | python3 ../script/remove_comment.py > $worksrc/$hppfile
+done
+/bin/rm -f $worksrc/RBAAnimation*.hpp
+/bin/rm -f $worksrc/RBAPosition*.hpp
+/bin/rm -f $worksrc/RBAPost*.hpp
+/bin/rm -f $worksrc/RBAAbstractFactory*.hpp
+/bin/rm -f $worksrc/RBAConstraint*
+/bin/rm -f $worksrc/RBAAreaSet.hpp
+/bin/rm -f $worksrc/RBASoundContentSet.hpp
+/bin/rm -f $worksrc/RBAViewContentSet.hpp
+/bin/rm -f $worksrc/RBAZoneSet.hpp
+
+sed -e 's/^INPUT =.*$/INPUT = .\/src/' $DOXYGEN > $WORKDIR/$DOXYGEN
+
+cd $WORKDIR
+doxygen $DOXYGEN
+
diff --git a/src/factory/RBAAbstractMakerTable.cpp b/src/factory/RBAAbstractMakerTable.cpp
new file mode 100644
index 0000000..b8340a7
--- /dev/null
+++ b/src/factory/RBAAbstractMakerTable.cpp
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAbstractMakerTable.cpp
+/// @brief Maker table abstraction class definition
+
+#include "RBAAbstractMakerTable.hpp"
+
+namespace rba
+{
+
+const std::list<std::string>&
+RBAAbstractMakerTable::getTags() const
+{
+ return tags_;
+}
+
+void
+RBAAbstractMakerTable::addTag(const std::string& tag)
+{
+ tags_.push_back(tag);
+}
+
+}
+
diff --git a/src/factory/RBAAbstractMakerTable.hpp b/src/factory/RBAAbstractMakerTable.hpp
new file mode 100644
index 0000000..81b0c09
--- /dev/null
+++ b/src/factory/RBAAbstractMakerTable.hpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAbstractMakerTable.hpp
+/// @brief Maker table abstraction class header
+
+#ifndef RBAABSTRACTMAKERTABLE_HPP
+#define RBAABSTRACTMAKERTABLE_HPP
+
+#include <memory>
+#include "RBAModelElementMaker.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAAbstractMakerTable
+{
+public:
+ RBAAbstractMakerTable()=default;
+ RBAAbstractMakerTable(const RBAAbstractMakerTable&)=delete;
+ RBAAbstractMakerTable(const RBAAbstractMakerTable&&)=delete;
+ RBAAbstractMakerTable& operator=(const RBAAbstractMakerTable&)=delete;
+ RBAAbstractMakerTable& operator=(const RBAAbstractMakerTable&&)=delete;
+ virtual ~RBAAbstractMakerTable()=default;
+
+public:
+ virtual std::list<std::unique_ptr<RBAModelElementMaker>> getMakers() const=0;
+ virtual const std::list<std::string>& getTags() const;
+
+protected:
+ void addTag(const std::string& tag);
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<std::string> tags_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/factory/RBAJsonElement.cpp b/src/factory/RBAJsonElement.cpp
new file mode 100644
index 0000000..9b8f639
--- /dev/null
+++ b/src/factory/RBAJsonElement.cpp
@@ -0,0 +1,271 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAJsonElement.cpp
+/// @brief JSON element class defintion file
+
+#include "RBAJsonElement.hpp"
+
+#include "RBAArbitrationPolicy.hpp"
+#include "RBAContentLoserType.hpp"
+#ifdef RBA_USE_LOG
+#include "RBAExpressionType.hpp"
+#endif
+
+namespace rba
+{
+
+// RBAJsonElement clas
+
+std::string RBAJsonElement::emptyStr_;
+
+const std::string&
+RBAJsonElement::getString() const
+{
+ // This function is never called
+ // because the function of the derived class is called
+ return emptyStr_;
+}
+
+std::int32_t
+RBAJsonElement::getInt() const
+{
+ // This function is never called
+ // because the function of the derived class is called
+ return -99;
+}
+
+RBAArbitrationPolicy
+RBAJsonElement::getArbitrationPolicy() const
+{
+ // This function is never called
+ // because the function of the derived class is called
+ return RBAArbitrationPolicy::DEFAULT;
+}
+
+RBAContentLoserType
+RBAJsonElement::getLoserType() const
+{
+ // This function is never called
+ // because the function of the derived class is called
+ return RBAContentLoserType::NEVER_GIVEUP;
+}
+
+#ifdef RBA_USE_LOG
+RBAExpressionType
+RBAJsonElement::getExpressionType() const
+{
+ // This function is never called
+ // because the function of the derived class is called
+ return RBAExpressionType::VALUE;
+}
+#endif
+
+void
+RBAJsonElement::setName(const std::string& name)
+{
+ name_ = name;
+}
+
+const std::string&
+RBAJsonElement::getName() const
+{
+ return name_;
+}
+
+void
+RBAJsonElement::addChild(std::unique_ptr<RBAJsonElement> child)
+{
+ children_.push_back(move(child));
+}
+
+const std::vector<std::unique_ptr<RBAJsonElement>>&
+RBAJsonElement::getChildren() const
+{
+ return children_;
+}
+
+RBAJsonElement*
+RBAJsonElement::getChild() const
+{
+ return children_.front().get();
+}
+
+const RBAJsonElement*
+RBAJsonElement::findChildren(const std::string& name) const
+{
+ RBAJsonElement* res{nullptr};
+ for(const auto& elem : children_) {
+ if(elem->getName() == name) {
+ res = elem.get();
+ break;
+ }
+ }
+
+ return res;
+}
+
+const std::string&
+RBAJsonElement::getClassName() const
+{
+ const RBAJsonElement* const elem {findChildren("class")};
+ if(elem != nullptr) {
+ return elem->getString();
+ }
+
+ return emptyStr_;
+}
+
+// RBAJsonElementElement class
+
+RBAJsonElementElement::RBAJsonElementElement(const std::string& name)
+ : RBAJsonElement{}
+{
+ setName(name);
+}
+
+// RBAJsonElementString class
+
+RBAJsonElementString::RBAJsonElementString(const std::string& name)
+ : RBAJsonElement{}
+{
+ setName(name);
+}
+
+RBAArbitrationPolicy
+RBAJsonElementString::getArbitrationPolicy() const
+{
+ if(str_ == "FIRST_COME_FIRST") {
+ return RBAArbitrationPolicy::FIRST_COME_FIRST;
+ }
+ else if(str_ == "LAST_COME_FIRST") {
+ return RBAArbitrationPolicy::LAST_COME_FIRST;
+ }
+ else if(str_ == "PRIORITY_FIRST_COME_FIRST") {
+ return RBAArbitrationPolicy::PRIORITY_FIRST_COME_FIRST;
+ }
+ else if(str_ == "PRIORITY_LAST_COME_FIRST") {
+ return RBAArbitrationPolicy::PRIORITY_LAST_COME_FIRST;
+ }
+ else {
+ return RBAArbitrationPolicy::DEFAULT;
+ }
+}
+
+RBAContentLoserType
+RBAJsonElementString::getLoserType() const
+{
+ if(str_ == "GOOD_LOSER") {
+ return RBAContentLoserType::GOOD_LOSER;
+ }
+ else if(str_ == "DO_NOT_GIVEUP_UNTIL_WIN") {
+ return RBAContentLoserType::DO_NOT_GIVEUP_UNTIL_WIN;
+ }
+ else {
+ return RBAContentLoserType::NEVER_GIVEUP;
+ }
+}
+
+#ifdef RBA_USE_LOG
+RBAExpressionType
+RBAJsonElementString::getExpressionType() const
+{
+ if(str_ == "VALUE") {
+ return RBAExpressionType::VALUE;
+ }
+ else if(str_ == "BOOLEAN") {
+ return RBAExpressionType::BOOLEAN;
+ }
+ else if(str_ == "AREA") {
+ return RBAExpressionType::AREA;
+ }
+ else if(str_ == "CONTENT") {
+ return RBAExpressionType::CONTENT;
+ }
+ else if(str_ == "SOUND") {
+ return RBAExpressionType::SOUND;
+ }
+ else if(str_ == "SET_OF_SOUND") {
+ return RBAExpressionType::SET_OF_SOUND;
+ }
+ else if(str_ == "SET_OF_AREA") {
+ return RBAExpressionType::SET_OF_AREA;
+ }
+ else if(str_ == "SET_OF_CONTENT") {
+ return RBAExpressionType::SET_OF_CONTENT;
+ }
+ else if(str_ == "SET_OF_ZONE") {
+ return RBAExpressionType::SET_OF_ZONE;
+ }
+ else if(str_ == "SCENE") {
+ return RBAExpressionType::SCENE;
+ }
+ else if(str_ == "ZONE") {
+ return RBAExpressionType::ZONE;
+ }
+ else if(str_ == "ACTION") {
+ return RBAExpressionType::ACTION;
+ }
+ else if(str_ == "SET_OF_ACTION") {
+ return RBAExpressionType::SET_OF_ACTION;
+ }
+ else {
+ return RBAExpressionType::EXTENSION;
+ }
+}
+#endif
+
+const std::string&
+RBAJsonElementString::getString() const
+{
+ return str_;
+}
+
+void
+RBAJsonElementString::setString(const std::string& str)
+{
+ str_ = str;
+}
+
+// RBAJsonElementInt class
+
+RBAJsonElementInt::RBAJsonElementInt(const std::string& name)
+ : RBAJsonElement{}
+{
+ setName(name);
+}
+
+std::int32_t
+RBAJsonElementInt::getInt() const
+{
+ return val_;
+}
+
+void
+RBAJsonElementInt::setInt(const std::int32_t val)
+{
+ val_ = val;
+}
+
+// RBAJsonElementArray class
+
+RBAJsonElementArray::RBAJsonElementArray(const std::string& name)
+ : RBAJsonElement{}
+{
+ setName(name);
+}
+
+}
diff --git a/src/factory/RBAJsonElement.hpp b/src/factory/RBAJsonElement.hpp
new file mode 100644
index 0000000..a5fcc8e
--- /dev/null
+++ b/src/factory/RBAJsonElement.hpp
@@ -0,0 +1,148 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAJsonElement.hpp
+/// @brief JSON element class header file
+
+#ifndef RBAJSONELEMENT_HPP
+#define RBAJSONELEMENT_HPP
+
+#include <cstdint>
+#include <vector>
+#include <memory>
+#include <string>
+#include "RBADllExport.hpp"
+
+namespace rba
+{
+
+enum class RBAArbitrationPolicy : std::uint8_t;
+enum class RBAContentLoserType : std::uint8_t;
+#ifdef RBA_USE_LOG
+enum class RBAExpressionType : std::uint8_t;
+#endif
+
+/// @brief JSONエ Element class
+class DLL_EXPORT RBAJsonElement
+{
+public:
+ RBAJsonElement()=default;
+ RBAJsonElement(const RBAJsonElement&)=delete;
+ RBAJsonElement(const RBAJsonElement&&)=delete;
+ RBAJsonElement& operator=(const RBAJsonElement&)=delete;
+ RBAJsonElement& operator=(const RBAJsonElement&&)=delete;
+ virtual ~RBAJsonElement()=default;
+
+public:
+ virtual const std::string& getString() const;
+ virtual std::int32_t getInt() const;
+ virtual RBAArbitrationPolicy getArbitrationPolicy() const;
+ virtual RBAContentLoserType getLoserType() const;
+#ifdef RBA_USE_LOG
+ virtual RBAExpressionType getExpressionType() const;
+#endif
+
+ void setName(const std::string& name);
+ const std::string& getName() const;
+ void addChild(std::unique_ptr<RBAJsonElement> child);
+ const std::vector<std::unique_ptr<RBAJsonElement>>& getChildren() const;
+ RBAJsonElement* getChild() const;
+ const RBAJsonElement* findChildren(const std::string& name) const;
+ const std::string& getClassName() const;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::string name_ {""};
+ std::vector<std::unique_ptr<RBAJsonElement>> children_;
+ static std::string emptyStr_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+class RBAJsonElementElement : public RBAJsonElement
+{
+public:
+ explicit RBAJsonElementElement(const std::string& name);
+ RBAJsonElementElement(const RBAJsonElementElement&)=delete;
+ RBAJsonElementElement(const RBAJsonElementElement&&)=delete;
+ RBAJsonElementElement& operator=(const RBAJsonElementElement&)=delete;
+ RBAJsonElementElement& operator=(const RBAJsonElementElement&&)=delete;
+ virtual ~RBAJsonElementElement()=default;
+};
+
+class RBAJsonElementString : public RBAJsonElement
+{
+public:
+ explicit RBAJsonElementString(const std::string& name);
+ RBAJsonElementString(const RBAJsonElementString&)=delete;
+ RBAJsonElementString(const RBAJsonElementString&&)=delete;
+ RBAJsonElementString& operator=(const RBAJsonElementString&)=delete;
+ RBAJsonElementString& operator=(const RBAJsonElementString&&)=delete;
+ virtual ~RBAJsonElementString()=default;
+
+public:
+ RBAArbitrationPolicy getArbitrationPolicy() const override;
+ RBAContentLoserType getLoserType() const override;
+#ifdef RBA_USE_LOG
+ RBAExpressionType getExpressionType() const override;
+#endif
+
+ const std::string& getString() const override;
+ void setString(const std::string& str);
+
+private:
+ std::string str_ {""};
+
+};
+
+class RBAJsonElementInt : public RBAJsonElement
+{
+public:
+ explicit RBAJsonElementInt(const std::string& name);
+ RBAJsonElementInt(const RBAJsonElementInt&)=delete;
+ RBAJsonElementInt(const RBAJsonElementInt&&)=delete;
+ RBAJsonElementInt& operator=(const RBAJsonElementInt&)=delete;
+ RBAJsonElementInt& operator=(const RBAJsonElementInt&&)=delete;
+ virtual ~RBAJsonElementInt()=default;
+
+public:
+ std::int32_t getInt() const override;
+ void setInt(const std::int32_t val);
+
+private:
+ std::int32_t val_ {0};
+
+};
+
+class RBAJsonElementArray : public RBAJsonElement
+{
+public:
+ explicit RBAJsonElementArray(const std::string& name);
+ RBAJsonElementArray(const RBAJsonElementArray&)=delete;
+ RBAJsonElementArray(const RBAJsonElementArray&&)=delete;
+ RBAJsonElementArray& operator=(const RBAJsonElementArray&)=delete;
+ RBAJsonElementArray& operator=(const RBAJsonElementArray&&)=delete;
+ virtual ~RBAJsonElementArray()=default;
+};
+
+}
+
+#endif
diff --git a/src/factory/RBAJsonParser.cpp b/src/factory/RBAJsonParser.cpp
new file mode 100644
index 0000000..e0846a5
--- /dev/null
+++ b/src/factory/RBAJsonParser.cpp
@@ -0,0 +1,48 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAJsonParser.cpp
+/// @brief JSON Parser class deginition file
+
+#include "RBAJsonParser.hpp"
+#include "RBAJsonParserImpl.hpp"
+#include "RBAExpression.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAJsonParser::RBAJsonParser()
+ : impl_{std::make_unique<RBAJsonParser::Impl>()}
+{
+};
+
+RBAJsonParser::RBAJsonParser(RBAModelFactory* factory)
+ : impl_{std::make_unique<RBAJsonParser::Impl>(factory)}
+{
+};
+
+RBAJsonParser::~RBAJsonParser() noexcept
+{
+};
+
+RBAModel*
+RBAJsonParser::parse(const std::string& filename)
+{
+ return impl_->parse(filename);
+}
+
+}
diff --git a/src/factory/RBAJsonParserImpl.cpp b/src/factory/RBAJsonParserImpl.cpp
new file mode 100644
index 0000000..db65367
--- /dev/null
+++ b/src/factory/RBAJsonParserImpl.cpp
@@ -0,0 +1,315 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAJsonParserImpl.cpp
+/// @brief JSON Parser implment class defintion file
+
+#include <fstream>
+#include <sstream>
+#include <iostream>
+#include "RBAJsonParserImpl.hpp"
+
+#include "RBACommonMakerTable.hpp"
+#include "RBAConstraintMap.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBASoundMakerTable.hpp"
+#include "RBAViewMakerTable.hpp"
+
+namespace rba
+{
+
+RBAJsonParser::Impl::
+Impl(RBAModelFactory* const factory)
+ : orgFactory_{factory},
+ factory_{nullptr}
+{
+}
+
+RBAModel*
+RBAJsonParser::Impl::
+parse(const std::string& filename)
+{
+ const std::unique_ptr<RBAJsonElement> root {readJsonFile(filename)};
+ if(root == nullptr) {
+ return nullptr;
+ }
+
+ const std::lock_guard<std::mutex> lock{mutex_};
+
+ if(orgFactory_ != nullptr) {
+ factory_ = orgFactory_;
+ }
+ else {
+ uniqueFactory_ = std::make_unique<RBAModelFactory>();
+ factory_ = uniqueFactory_.get();
+ }
+ resetFactory();
+
+ // get registered tag element
+ for(const auto& tag : factory_->getTags()) {
+ const RBAJsonElement* const jsonElems {root->findChildren(tag)};
+ if(jsonElems != nullptr) {
+ for(const auto& elem : jsonElems->getChildren()) {
+ // Generate Model element
+ const RBAModelElement* const modelElem {factory_->createElement(tag, elem.get())};
+ if(modelElem == nullptr) {
+ factory_->deleteModel();
+ return nullptr;
+ }
+ }
+ }
+ }
+
+ // Error if there is an exception in Factory
+ if(factory_->isException()) {
+ factory_->deleteModel();
+ return nullptr;
+ }
+
+ // Create map between Area and Costraint
+ createConstraintMap(root->findChildren("area_constraint_map"),
+ RBAConstraintMap::CONTENT_ALLOCATE_CONSTRAINTS);
+ createConstraintMap(root->findChildren("area_hidden_true_check_constraint_map"),
+ RBAConstraintMap::HIDDEN_TRUE_CHECK_CONSTRAINTS);
+ createConstraintMap(root->findChildren("area_hidden_false_check_constraint_map"),
+ RBAConstraintMap::HIDDEN_FALSE_CHECK_CONSTRAINTS);
+
+ // Create map between Zone and Costraint
+ createConstraintMap(root->findChildren("zone_constraint_map"),
+ RBAConstraintMap::CONTENT_ALLOCATE_CONSTRAINTS);
+ createConstraintMap(root->findChildren("zone_mute_true_check_constraint_map"),
+ RBAConstraintMap::HIDDEN_TRUE_CHECK_CONSTRAINTS);
+ createConstraintMap(root->findChildren("zone_mute_false_check_constraint_map"),
+ RBAConstraintMap::HIDDEN_FALSE_CHECK_CONSTRAINTS);
+ createConstraintMap(root->findChildren("zone_attenuate_true_check_constraint_map"),
+ RBAConstraintMap::ATTENUATE_TRUE_CHECK_CONSTRAINTS);
+ createConstraintMap(root->findChildren("zone_attenuate_false_check_constraint_map"),
+ RBAConstraintMap::ATTENUATE_FALSE_CHECK_CONSTRAINTS);
+
+ // Create Allocatable Maps that affect
+// createAllocatablesMap(root->findChildren("content_allocatables_map"));
+// createAllocatablesMap(root->findChildren("scene_allocatables_map"));
+// createAllocatablesMap(root->findChildren("statemachine_allocatables_map"));
+
+ // Error if there is no contents
+ if((factory_->getModel()->getViewContents().size() == 0U) &&
+ (factory_->getModel()->getSoundContents().size() == 0U)) {
+ std::cerr << filename << ": ViewContent or SoundContent not found"
+ << &std::endl;
+ factory_->deleteModel();
+ return nullptr;
+ }
+
+ return factory_->getModel();
+}
+
+void
+RBAJsonParser::Impl::createConstraintMap(const RBAJsonElement* const constraints,
+ const RBAConstraintMap& kind)
+{
+ if (constraints != nullptr) {
+ for (const auto& constraint : constraints->getChildren()) {
+ const RBAJsonElement* const elem {constraint->getChildren().front().get()};
+ const std::string& allocatableName {elem->getName()};
+ for (auto& e : elem->getChildren()) {
+ factory_->setAllocatableConstraint(allocatableName, e->getName(), kind);
+ }
+ }
+ }
+}
+
+void
+RBAJsonParser::Impl::createAllocatablesMap(const RBAJsonElement* const allocMap)
+{
+ if (allocMap != nullptr) {
+ RBAModelImpl* const model {dynamic_cast<RBAModelImpl*>(factory_->getModel())};
+ for (auto& elem : allocMap->getChildren()) {
+ // Get the object which influence
+ const auto owner = elem->getChild();
+ const auto ownerObj = model->findModelElementImpl(owner->getName());
+
+ for (auto& alloc : owner->getChildren()) {
+ // Get the object which is affected
+ const auto allocObj = model->findAllocatable(alloc->getName());
+
+ // Add to map
+ model->addAffectedAllocsMap(ownerObj, const_cast<RBAAllocatable*>(allocObj));
+ }
+ }
+ }
+}
+
+std::unique_ptr<RBAJsonElement>
+RBAJsonParser::Impl::readJsonFile(const std::string& filename)
+{
+ std::ifstream ifs{filename};
+ if(ifs.fail()) {
+ std::cerr << filename << ": No such file or directory" << &std::endl;
+ return nullptr;
+ }
+
+ std::ostringstream oss;
+ std::string line;
+ while(!ifs.eof()) {
+ ifs >> line;
+ oss << line;
+ }
+
+ return readJsonString(oss.str());
+}
+
+std::unique_ptr<RBAJsonElement>
+RBAJsonParser::Impl::readJsonString(const std::string& jsonstring)
+{
+ std::vector<RBAJsonElement*> queue;
+ RBAJsonElement* current{nullptr};
+ std::unique_ptr<RBAJsonElement> topElement{nullptr};
+ Status status{Status::START};
+ const std::size_t jsonSize{jsonstring.size()};
+ std::size_t tokenPos{0U};
+ std::size_t tokenSize{0U};
+ std::size_t strPos{0U};
+ std::size_t strSize{0U};
+
+ while (tokenPos < jsonSize) {
+ auto firstChar = jsonstring[tokenPos];
+ if(firstChar == '\"') {
+ // String
+ tokenSize = jsonstring.find('\"', tokenPos + 1U) - tokenPos + 1U;
+ switch(status) {
+ case Status::START:
+ strPos = tokenPos + 1U;
+ strSize = tokenSize - 2U;
+ break;
+ case Status::VALUE:
+ auto elem = std::make_unique<RBAJsonElementString>(jsonstring.substr(strPos, strSize));
+ elem->setString(jsonstring.substr(tokenPos + 1U, tokenSize - 2U));
+ current->addChild(std::move(elem));
+ strSize = 0U;
+ status = Status::START;
+ break;
+ }
+ }
+ else if(firstChar == ':') {
+ // Value mode
+ tokenSize = 1U;
+ status = Status::VALUE;
+ }
+ else if(firstChar == ',') {
+ tokenSize = 1U;
+ if(strSize > 0U) {
+ current->addChild(std::make_unique<RBAJsonElementString>(jsonstring.substr(strPos, strSize)));
+ strSize = 0U;
+ status = Status::START;
+ }
+ }
+ else if(firstChar == '{') {
+ // Start Element
+ tokenSize = 1U;
+ if(status == Status::START) {
+ if(current != nullptr) {
+ auto elem = std::make_unique<RBAJsonElementElement>(jsonstring.substr(strPos, strSize));
+ auto elemPtr = elem.get();
+ current->addChild(std::move(elem));
+ current = elemPtr;
+ queue.push_back(current);
+ strSize = 0U;
+ }
+ } else {
+ // status is Status::VALUE
+ auto elem = std::make_unique<RBAJsonElementElement>(jsonstring.substr(strPos, strSize));
+ auto elemPtr = elem.get();
+ if(current != nullptr) {
+ current->addChild(std::move(elem));
+ } else {
+ topElement = std::move(elem);
+ }
+ current = elemPtr;
+ queue.push_back(current);
+ strSize = 0U;
+ status = Status::START;
+ }
+ }
+ else if(firstChar == '}') {
+ // End Element
+ tokenSize = 1U;
+ if (!queue.empty()) {
+ queue.pop_back();
+ }
+ current = queue.empty() ? nullptr : queue.back();
+ }
+ else if(firstChar == '[') {
+ // Satrt array
+ tokenSize = 1U;
+ auto elem = std::make_unique<RBAJsonElementArray>(jsonstring.substr(strPos, strSize));
+ auto elemPtr = elem.get();
+ current->addChild(std::move(elem));
+ current = elemPtr;
+ queue.push_back(current);
+ strSize = 0U;
+ status = Status::START;
+ }
+ else if(firstChar == ']') {
+ // End array
+ tokenSize = 1U;
+ if(strSize > 0U) {
+ current->addChild(std::make_unique<RBAJsonElementString>(jsonstring.substr(strPos, strSize)));
+ strSize = 0U;
+ status = Status::START;
+ }
+ queue.pop_back();
+ current = queue.empty() ? nullptr : queue.back();
+ }
+ else if((firstChar == '-') || isdigit(firstChar)) {
+ // Numerical value
+ tokenSize = jsonstring.find_first_of(",}]", tokenPos + 1U) - tokenPos;
+ auto elem = std::make_unique<RBAJsonElementInt>(jsonstring.substr(strPos, strSize));
+ elem->setInt(std::stoi(jsonstring.substr(tokenPos, tokenSize)));
+ current->addChild(std::move(elem));
+ strSize = 0U;
+ status = Status::START;
+ }
+ else if((static_cast<std::int32_t>(firstChar) <= 0x20)) {
+ // skip
+ tokenSize = 1U;
+ }
+ else {
+ tokenSize = 1U;
+ std::cerr << "[ERROR] '" << jsonstring.substr(tokenPos, tokenSize)
+ << "' :Unknown token" << &std::endl;
+ }
+ tokenPos += tokenSize;
+ }
+
+ return topElement;
+}
+
+void
+RBAJsonParser::Impl::resetFactory()
+{
+ // Set if Maker is not registered
+ if(!factory_->hasMaker()) {
+ // Models such as area and zone should be registered first.
+ factory_->addMakerTable(RBAViewMakerTable());
+ factory_->addMakerTable(RBASoundMakerTable());
+ factory_->addMakerTable(RBACommonMakerTable());
+ }
+
+ factory_->resetException();
+}
+
+}
diff --git a/src/factory/RBAJsonParserImpl.hpp b/src/factory/RBAJsonParserImpl.hpp
new file mode 100644
index 0000000..533f894
--- /dev/null
+++ b/src/factory/RBAJsonParserImpl.hpp
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAJsonParserImpl.hpp
+/// @brief JSON Parser implementation class header file
+
+#ifndef RBAJSONPARSERIMPL_HPP
+#define RBAJSONPARSERIMPL_HPP
+
+#include <mutex>
+#include "RBAJsonParser.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+class RBAJsonElement;
+enum class RBAConstraintMap : std::uint8_t;
+
+/// @brief JSON Parser implementation class
+class RBAJsonParser::Impl
+{
+public:
+ Impl(RBAModelFactory* const factory=nullptr);
+ Impl(const Impl&)=delete;
+ Impl(const Impl&&)=delete;
+ Impl& operator=(const Impl&)=delete;
+ Impl& operator=(const Impl&&)=delete;
+ virtual ~Impl()=default;
+
+public:
+ RBAModel* parse(const std::string& filename);
+
+private:
+ virtual void resetFactory();
+
+private:
+ void createConstraintMap(const RBAJsonElement* const constraints,
+ const RBAConstraintMap& kind);
+ void createAllocatablesMap(const RBAJsonElement* const allocMap);
+ std::unique_ptr<RBAJsonElement> readJsonFile(const std::string& filename);
+ std::unique_ptr<RBAJsonElement> readJsonString(const std::string& jsonstring);
+
+private:
+ enum class Status : std::uint8_t {
+ START,
+ VALUE,
+ };
+ RBAModelFactory* orgFactory_;
+ RBAModelFactory* factory_;
+ std::unique_ptr<RBAModelFactory> uniqueFactory_;
+ std::mutex mutex_;
+};
+
+}
+
+#endif
diff --git a/src/factory/RBAModelFactory.cpp b/src/factory/RBAModelFactory.cpp
new file mode 100644
index 0000000..28c42e0
--- /dev/null
+++ b/src/factory/RBAModelFactory.cpp
@@ -0,0 +1,201 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAModelFactory.cpp
+/// @brief Model Factory class definition file
+
+#include <algorithm>
+#include "RBAModelFactory.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAAbstractMakerTable.hpp"
+#include "RBAConstraintImpl.hpp"
+
+namespace rba
+{
+
+RBAModelFactory::RBAModelFactory(RBAModelImpl* const model)
+ : model_{nullptr},
+ exception_{false}
+{
+ if(model != nullptr) {
+ model_ = model;
+ }
+ else {
+ // @Deviation (A18-5-2)
+ // [Contents that deviate from the rules]
+ // Operators new and delete shall not be called explicitly.
+ // [Explain that it is okay to deviate from the rules]
+ // model_ is not owned by RBAModelFacotry.
+ // Therefore, it is not managed by the smart pointer.
+ // There is no problem because it is managed by
+ // the user side of RBAModelFactory.
+ model_ = new RBAModelImpl();
+ }
+}
+
+RBAModelFactory::~RBAModelFactory() noexcept
+{
+}
+
+RBAModel* const
+RBAModelFactory::getModel() const
+{
+ return model_;
+}
+
+void
+RBAModelFactory::deleteModel()
+{
+ // @Deviation (A18-5-2)
+ // [Contents that deviate from the rules]
+ // Operators new and delete shall not be called explicitly.
+ // [Explain that it is okay to deviate from the rules]
+ // Since it is managed by the user side of RBAModelFactory,
+ // there is no problem even if it is deleted from the outside.
+ delete model_;
+ model_ = nullptr;
+}
+
+void
+RBAModelFactory::addMakerTable(const RBAAbstractMakerTable& makerTable)
+{
+ for(auto& maker : makerTable.getMakers()) {
+ maker->setFactory(this);
+ const std::string label {maker->getLabel()};
+ nameToMaker_[label] = maker.get();
+ makers_.push_back(std::move(maker));
+ }
+ for(auto& tag : makerTable.getTags()) {
+ if (std::find(tags_.begin(), tags_.end(), tag) == tags_.end()) {
+ tags_.push_back(tag);
+ }
+ }
+}
+
+void
+RBAModelFactory::addMaker(const std::string label,
+ std::unique_ptr<RBAModelElementMaker> maker)
+{
+ maker->setFactory(this);
+ nameToMaker_[label] = maker.get();
+ makers_.push_back(std::move(maker));
+}
+
+bool
+RBAModelFactory::hasMaker() const
+{
+ return !nameToMaker_.empty();
+}
+
+const std::list<std::string>&
+RBAModelFactory::getTags() const
+{
+ return tags_;
+}
+
+RBAModelElement*
+RBAModelFactory::createElement(const std::string& className,
+ const RBAJsonElement* const jsonElement,
+ RBAModelElement* const owner)
+{
+ auto it = nameToMaker_.find(className);
+ if(it == nameToMaker_.end()) {
+ const RBAJsonElement* const classElement {jsonElement->findChildren("class")};
+ if(classElement != nullptr) {
+ it = nameToMaker_.find(classElement->getString());
+ if(it == nameToMaker_.end()) {
+ return nullptr;
+ }
+ }
+ else {
+ return nullptr;
+ }
+ }
+
+ return it->second->create(jsonElement, model_, owner);
+}
+
+void
+RBAModelFactory::setAllocatableConstraint(const std::string& allocatableName,
+ const std::string& constraintName,
+ const RBAConstraintMap& kind)
+{
+ // Get allocatable
+ RBAAllocatable* const allocatable
+ {const_cast<RBAAllocatable*>(model_->findAllocatable(allocatableName))};
+ // Get constraint
+ RBAConstraintImpl* const constraint {model_->findConstraintImpl(constraintName)};
+ if ((allocatable != nullptr) && (constraint != nullptr)) {
+ allocatable->addConstraint(constraint, kind);
+ }
+}
+
+// Variable can be defined with the same name in different scopes,
+// but here we are registering the Variable defined in the scope
+// that is being created
+void
+RBAModelFactory::pushVariable(const RBAVariable* const var)
+{
+ currentVariables_.push_back(var);
+}
+
+// Variables can be defined with the same name in different scopes,
+// but when you leave the scope with a definition, Variable is deleted.
+void
+RBAModelFactory::popVariable()
+{
+ if(!currentVariables_.empty()) {
+ currentVariables_.pop_back();
+ }
+}
+
+const RBAVariable*
+RBAModelFactory::getVariable(const std::string& varName)
+{
+ const auto itr =
+ std::find_if(currentVariables_.rbegin(), currentVariables_.rend(),
+ [&varName](const RBAVariable* element) -> bool {
+ return element->getElementName() == varName;
+ });
+
+ if (itr != currentVariables_.rend())
+ {
+ return *itr;
+ }
+
+ return nullptr;
+}
+
+void
+RBAModelFactory::resetException()
+{
+ exception_ = false;
+}
+
+void
+RBAModelFactory::setException()
+{
+ exception_ = true;
+}
+
+bool
+RBAModelFactory::isException() const
+{
+ return exception_;
+}
+
+}
diff --git a/src/factory/RBAModelFactory.hpp b/src/factory/RBAModelFactory.hpp
new file mode 100644
index 0000000..9250f92
--- /dev/null
+++ b/src/factory/RBAModelFactory.hpp
@@ -0,0 +1,101 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/// @file RBAModelFactory.hpp
+/// @brief Model Factory class header file
+
+#ifndef RBAMODELFACTORY_HPP
+#define RBAMODELFACTORY_HPP
+
+#include <string>
+#include <list>
+#include <memory>
+#include <unordered_map>
+#include "RBADllExport.hpp"
+
+namespace rba
+{
+
+class RBAModel;
+class RBAModelImpl;
+class RBAJsonElement;
+class RBAModelElement;
+class RBAVariable;
+class RBAAbstractMakerTable;
+class RBAModelElementMaker;
+enum class RBAConstraintMap : std::uint8_t;
+
+/// @brief Model Factory class
+class DLL_EXPORT RBAModelFactory
+{
+public:
+ RBAModelFactory(RBAModelImpl* const model=nullptr);
+ RBAModelFactory(const RBAModelFactory&)=delete;
+ RBAModelFactory(const RBAModelFactory&&)=delete;
+ RBAModelFactory& operator=(const RBAModelFactory&)=delete;
+ RBAModelFactory& operator=(const RBAModelFactory&&)=delete;
+ virtual ~RBAModelFactory() noexcept;
+
+ public:
+ RBAModel* const getModel() const;
+ void deleteModel();
+ void addMakerTable(const RBAAbstractMakerTable& makerTable);
+ void addMaker(const std::string label,
+ std::unique_ptr<RBAModelElementMaker> maker);
+ bool hasMaker() const;
+ const std::list<std::string>& getTags() const;
+
+ RBAModelElement* createElement(const std::string& className,
+ const RBAJsonElement* const jsonElement,
+ RBAModelElement* const owner=nullptr);
+
+ void setAllocatableConstraint(const std::string& allocatableName,
+ const std::string& constraintName,
+ const RBAConstraintMap& kind);
+
+ void pushVariable(const RBAVariable* const var);
+ void popVariable();
+ const RBAVariable* getVariable(const std::string& varName);
+
+ void resetException();
+ void setException();
+ bool isException() const;
+
+private:
+ RBAModelImpl* model_;
+ bool exception_;
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::unordered_map<std::string, RBAModelElementMaker*> nameToMaker_;
+ // unique_ptr list for storing
+ std::list<std::unique_ptr<RBAModelElementMaker>> makers_;
+ // current variable for working
+ std::list<const RBAVariable*> currentVariables_;
+ // JSON element tag list, set from the registered MakerTable
+ std::list<std::string> tags_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAArbitrationPolicy.hpp b/src/include/rba/RBAArbitrationPolicy.hpp
new file mode 100644
index 0000000..42d49f6
--- /dev/null
+++ b/src/include/rba/RBAArbitrationPolicy.hpp
@@ -0,0 +1,48 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Arbitration policy class
+ */
+
+#ifndef RBAARBITRATIONPOLICY_HPP
+#define RBAARBITRATIONPOLICY_HPP
+
+namespace rba
+{
+
+/**
+ * @enum RBAArbitrationPolicy
+ * Type of arbitration policy.
+ */
+enum class RBAArbitrationPolicy : std::uint8_t
+{
+ /**
+ * @brief Same PRIORITY_LAST_COME_FIRST.
+ */
+ DEFAULT,
+ /**
+ * @brief First Come First Arbitration.
+ * @details give priority to first come request.
+ */
+ FIRST_COME_FIRST,
+ /**
+ * @brief Last Come First Arbitration.
+ * @details give priority to last come request.
+ */
+ LAST_COME_FIRST,
+ /**
+ * @brief Priority and First Come First Arbitration.
+ * @details Follow the Priority of Contents.
+ * If same priority then give priority to first come request.
+ */
+ PRIORITY_FIRST_COME_FIRST,
+ /**
+ * @brief Priority and Last Come First Arbitration.
+ * @details Follow the Priority of Contents.
+ * If same priority then give priority to last come request.
+ */
+ PRIORITY_LAST_COME_FIRST
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAArbitrator.hpp b/src/include/rba/RBAArbitrator.hpp
new file mode 100644
index 0000000..c7c2761
--- /dev/null
+++ b/src/include/rba/RBAArbitrator.hpp
@@ -0,0 +1,600 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Arbitrator Logic class
+ */
+
+#ifndef RBAARBITORATOR_HPP
+#define RBAARBITORATOR_HPP
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+#include <string>
+#include <list>
+#include <memory>
+#include <mutex>
+#include <deque>
+#include "RBAModel.hpp"
+#include "RBAResult.hpp"
+#include "RBARequestQueMember.hpp"
+#include "RBAResultSet.hpp"
+#include "RBAResultImpl.hpp"
+
+/**
+ * @namespace rba
+ * @brief The namespace defined by Rule Based Arbitration Framework.
+ */
+namespace rba
+{
+
+// internal {
+#ifdef RBA_USE_LOG
+class RBALogManager;
+#endif
+
+class RBARuleObject;
+class RBAExpression;
+class RBAModelImpl;
+class RBAAffectInfo;
+class RBARollbacker;
+class RBAWindowRouter;
+class RBAConstraintImpl;
+// }
+
+/**
+ * @class RBAArbitrator
+ * An object that performs arbitration processing based on rules
+ * generated from a model.<br>
+ * Set the model generated using rba::RBAJsonParser in the constructor.
+ */
+class DLL_EXPORT RBAArbitrator
+{
+public:
+ /**
+ * @brief Arbitrator logic constractor.
+ * @param newModel Processing model.
+ * The model is generated by rba::RBAJsonParser.
+ */
+ RBAArbitrator()=default;
+ RBAArbitrator(RBAModel* newModel);
+
+ /**
+ * @brief Arbitrator logic destractor.
+ */
+ RBAArbitrator(const RBAArbitrator&)=delete;
+ RBAArbitrator(const RBAArbitrator&&)=delete;
+ RBAArbitrator& operator=(const RBAArbitrator&)=delete;
+ RBAArbitrator& operator=(const RBAArbitrator&&)=delete;
+ virtual ~RBAArbitrator() noexcept;
+
+public:
+
+ /**
+ * @brief Sets the model for arbitration
+ * The model is generated by rba::RBAJsonParser.
+ * @param newModel The model for arbitration
+ * @details Replace the model with newModel. An arbitrator has only one model at all times.
+ * Model can be generated by using rba::RBAJsonParser.
+ * nullptr can not be set.
+ */
+ void setModel(RBAModel* newModel);
+
+ /**
+ * @brief Returns the model for arbitration
+ * @return model The model for arbitration
+ * @details Because the arbitrator always has a model, this API never returns nullptr.
+ */
+ const RBAModel* getModel() const;
+
+ /**
+ * @brief Set initial requirements of contents and scenes
+ * @param contexts Context list of contents and scenes requests.
+ *
+ * Following is the structure of context name.\n
+ * *<CONTENT_NAME>* / *<STATE_NAME>* \n\n
+ * Example of context name: \n
+ * TEL/Calling\n
+ * TPMS/NORMAL\n
+ * AutoDriveScene\n\n
+ * You can omit "/ <STATE_NAME>" if content has only one state.
+ * @details After arbitrator creation or calling clearArbitration(),
+ * you can set initial state of contents and scenes for first arbitration.
+ * This API does not execute arbitration.
+ * The information of arbitration result will be empty.
+ * Don't call this API after starting arbitration until calling clearArbitration().
+ * @details
+ * **Example**
+ *
+ * ```
+ * RBAJsonParser parser;
+ * rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+ * rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+ *
+ * std::list<std::string> defaultContents = {
+ * "CONTENT_A/NORMAL",
+ * "CONTENT_B/NORMAL",
+ * "CONTENT_C/NORMAL",
+ * "CONTENT_D/NORMAL",
+ * };
+ * arb->initialize(defaultContents);
+ * std::unique_ptr<RBAResult> result = arb->execute();
+ * ```
+ */
+ void initialize(std::list<std::string>& contexts);
+
+ /**
+ * @brief Executes arbitration with one requirement\n
+ * @param contextName
+ * Context string of arbitration request.\n
+ * Display request or sound request : "<CONTENT_NAME>/<STATE_NAME>"\n
+ * If the content has only one state, the <STATE> can be omitted.\n
+ * \n
+ * Scene request : ”<SCENE_NAME>”
+ * @param require
+ * true : request displaying / outputting content or scene on (default)\n
+ * false : withdraw a request or scene off.
+ *
+ * @return The result of arbitration.
+ * @details
+ * Execute Arbitration with one requirement of a content or scene without properties. \n
+ * The arbitration result as the return value will be generated at every arbitration and
+ * will not be changed by another arbitration.
+ * \n
+ * Context indicates a content state or a scene.
+ * If the content or scene is not defined in the model, the arbitration will not executed
+ * and the state of the arbitration result will be UNKNWON_CONTENT_STATE.
+ * In this case, other property values are undefined.\n
+ * If the context is empty, this API just execute arbitration.
+ * \n
+ * **Exapmle**
+ *
+ * ```
+ * RBAJsonParser parser;
+ * rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+ * rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+ * std::unique_ptr<RBAResult> result = arb->execute("CONTENT_A/NORMAL", true);
+ *
+ * if(result->getStatusType() != rba::RBAResultStatusType::SUCCESS) {
+ * std::cout << "ERROR: Unknown context" << std::endl;
+ * }
+ * ```
+ *
+ */
+ std::unique_ptr<RBAResult> execute(const std::string& contextName="",
+ bool require=true);
+
+ /**
+ * @brief Executes arbitration with multiple requirements\n
+ * @param contexts List of contexts.
+ * @param require
+ * true : request displaying / outputting content or scene on (default)\n
+ * false : withdraw a request or scene off.
+ * @return The result of arbitration.
+ * @details
+ * \n
+ * Execute Arbitration with multiple requirements of contents or scenes. \n
+ * Contents and Scenes can be mixed in the list.
+ * Display / Outputting request and withdraw request, scene on and scene off request can not be mixed.
+ * The arbitration result as the return value will be generated at every arbitration and
+ * will not be changed by another arbitration.
+ * \n
+ * Context indicates a content state or a scene.
+ * If the content or scene is not defined in the model, the arbitration will not executed
+ * and the state of the arbitration result will be UNKNWON_CONTENT_STATE.\n
+ * In this case, other property values are undefined.\n
+ * If the context is empty, this API just execute arbitration.
+ * \n
+ * Request order is the with the list. Beginning of the list will be treated as the first coming request.
+ * \n
+ * **Exapmle**
+ *
+ * ```
+ * RBAJsonParser parser;
+ * rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+ * rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+ * std::list<std::string> contents = {
+ * "CONTENT_A/NORMAL",
+ * "CONTENT_B/NORMAL",
+ * "CONTENT_C/NORMAL",
+ * "CONTENT_D/NORMAL",
+ * };
+ * std::unique_ptr<RBAResult> result = arb->execute(contents, true);
+ *
+ * if(result->getStatusType() != rba::RBAResultStatusType::SUCCESS) {
+ * std::cout << "ERROR: Unknown context" << std::endl;
+ * }
+ * ```
+ *
+ */
+ std::unique_ptr<RBAResult> execute(std::list<std::string>& contexts,
+ bool require=true);
+
+ /**
+ * @brief Executes arbitration with a requirement of scene and scene properties.
+ * @param sceneName The Scene name of arbitration reauest.\n
+ * @param properties The list of pairs of property name and value.
+ * @return The result of arbitration.
+ * @details
+ * \n
+ * Sets the scene indicated by sceneName to the property specified
+ * by properties, and execute arbitration processing.\n
+ * If sceneName is empty, this API just execute arbitration.
+ * If the required scene is not defined in the model, the arbitration will not executed
+ * and the state of the arbitration result will be UNKNWON_CONTENT_STATE.\n
+ * Even If there is a property not defined in the model, the arbitration will be executed.
+ * \n
+ * @note
+ * You cannot set scene off and property at the same time, by this API.\n
+ * Use setScene() to set scene off and properties,
+ * and then call execute(const std::string&,bool) without specifying arguments.\n
+ * Or Use setScene() to set properties,
+ * and then call execute(scene name,false).\n
+ * \n
+ * @details
+ * **Example**
+ *
+ * ```
+ * RBAJsonParser parser;
+ * rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+ * rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+ * std::list<std::pair<std::string, std::int32_t>> properties;
+ * properties.push_back(std::make_pair("Prop1", 10));
+ * properties.push_back(std::make_pair("Prop2", 20));
+ * std::unique_ptr<RBAResult> result = arb->execute("Scene1", properties);
+ *
+ * if(result->getStatusType() != rba::RBAResultStatusType::SUCCESS) {
+ * std::cout << "ERROR: Unknown context" << std::endl;
+ * }
+ * ```
+ */
+ std::unique_ptr<RBAResult> execute(const std::string& sceneName,
+ std::list<std::pair<std::string,std::int32_t>>& properties);
+
+ /**
+ * @brief Replaces the result of arbitration
+ * @param allocatableName area or zone name
+ * @param contextName Context string of arbitration request.
+ * @return The result of arbitration.
+ * @details
+ * \n
+ * Replace allocated a content state to area or zone of the last arbitration result.\n
+ * If the allocatableName or contextName is undefined, return the errror
+ * code from the method getStatusType() of result.\n
+ * If the contextName is non-active, activate the content request.
+ * This API execute the "Request handling on lost" process and the
+ * "Execution expression" process, and doesn't execute the check of
+ * constraint expression process.
+ * Therefore, this API can lead the result that does not satisfy the constraints\n
+ * If the specified area or zone by allocatableName is hidden, mute or
+ * attenuated, these statuses will be kept.
+ * @deprecated Because there is a possibility that the result does not satisfy
+ * the constraints, please use execute()
+ * instead of this API.\n
+ * \n
+ * @details
+ * **Example**
+ *
+ * ```
+ * RBAJsonParser parser;
+ * rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+ * rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+ * std::unique_ptr<RBAResult> result = arb->execute("CONTENT_A/NORMAL", true);
+ * std::unique_ptr<RBAResult> result_replaced = arb->setResultContentState("AREA_A", "CONTENT_B/NORMAL");
+ *
+ * if(result_replaced->getStatusType() != rba::RBAResultStatusType::SUCCESS) {
+ * std::cout << "ERROR" << std::endl;
+ * }
+ * ```
+ */
+ std::unique_ptr<RBAResult>
+ setResultContentState(const std::string& allocatableName,
+ const std::string& contextName);
+
+ /**
+ * @brief Cancel last arbitration
+ * @return The result of arbitration.
+ * @details
+ * \n
+ * Cancel last arbitration and restore internal state immediately.\n
+ * This API returns the restored result but the ViewActions will be empty.\n
+ * Do not execute this function more than once continuously. In that case,
+ * an error occurs.\n
+ * Even when executed without performing arbitration processing,
+ * an error occurs.\n
+ * In case of error, the status of the arbitration result is set to
+ * CANCEL_ERROR.\n
+ * \n
+ * @details
+ * **Example**
+ *
+ * ```
+ * RBAJsonParser parser;
+ * rba::RBAModel* model = parser.parse(JSONFILE_PATH);
+ * rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+ * std::unique_ptr<RBAResult> result = arb->execute("CONTENT_A/NORMAL", true);
+ * std::unique_ptr<RBAResult> result_back = arb->cancelArbitration()
+ *
+ * if(result_replaced->getStatusType() != rba::RBAResultStatusType::SUCCESS) {
+ * std::cout << "ERROR" << std::endl;
+ * }
+ * ```
+ */
+ std::unique_ptr<RBAResult> cancelArbitration();
+
+ /**
+ * @brief Clear internal states of arbitration.
+ * @details
+ * \n
+ * Initialize internal states of arbitration (ex. Previous arbitration
+ * result, request of content states, etc...) and set to the initial state.\n
+ * \n
+ * @note
+ * This API is intended for setting up initial state of unit tests.\n
+ * \n
+ * @details
+ * **Example**
+ *
+ * ```
+ * std::unique_ptr<RBAResult> result1 = arb->execute("CONTENT_A/NORMAL", true);
+ * std::unique_ptr<RBAResult> result2 = arb->execute("CONTENT_B/NORMAL", true);
+ * // reset display requests
+ * arb->clearArbitration();
+ * std::unique_ptr<RBAResult> result2 = arb->execute("CONTENT_C/NORMAL", true);
+ * std::unique_ptr<RBAResult> result3 = arb->execute("CONTENT_D/NORMAL", true);
+
+ *
+ * ```
+ */
+ void clearArbitration();
+
+ /**
+ * @brief Sets scene ON/OFF requests and properties.
+ * @param sceneName The Scene name of arbitration reauest.\n
+ * @param require true : Valid request.\n
+ * false : Invalid request.
+ * @param properties The pair of property name and value.\n
+ * @return true: Success\n
+ * @return false: Unknown scene\n
+ * @details
+ * \n
+ * Sets the scene indicated by sceneName to the property specified
+ * by properties, and without execute arbitration processing.\n
+ * Returns true if the scene set succeeded. If an unknown scene name is
+ * specified, false is returned.\n
+ * \n
+ * @note
+ * This API is intended for setting up initial state of unit tests\n
+ * or setting global scene and scene properties.\n
+ * \n
+ * @details
+ * **Example**
+ *
+ * ```
+ * std::list<std::pair<std::string, std::int32_t>> props;
+ * props.push_back(std::make_pair("PropertyA", 10);
+ * props.push_back(std::make_pair("PropertyB", -3);
+ * res = arb->setScene("SCENE_A", true, props);
+ * if(res == false) {
+ * // Unknwon scene
+ * }
+ * ```
+ */
+ bool setScene(const std::string& sceneName, bool require,
+ std::list<std::pair<std::string, std::int32_t>>& properties);
+
+ /**
+ * @brief Sets content requests or scene ON/OFF request.
+ * @param contextName Context string of arbitration request.\n
+ * @param require
+ * true : request displaying / outputting content or scene on (default)\n
+ * false : withdraw a request or scene off.
+ * @return true: Success\n
+ * @return false: Unknown context\n
+ * @details
+ * \n
+ * Sets a display request for the context without arbitration.\n
+ * Returns true if the request setting is succeeded. If an unknown context
+ * name is specified, false is returned.\n
+ * \n
+ * @note
+ * This API is intended for setting up initial state of unit tests.\n
+ * While initialize() has only the function to turn on the request,
+ * this API can turn off the request. It is used for switch of each
+ * requests when initialization setting of unit test.\n
+ * \n
+ * @details
+ * **Example**
+ *
+ * ```
+ * res = arb->setContentState("ContentA/NORMAL", true);
+ * if(res == false) {
+ * // Unknwon context
+ * }
+ * ```
+ */
+ bool setContentState(const std::string& contextName, bool require);
+
+ /**
+ * @brief Allocates content state to area or zone.
+ * @param allocatableName Name of area or zone
+ * @param contextName Context string of content state.\n
+ * contextName : "<CONTENT_NAME>/<STATE_NAME>"\n
+ * If the content has only one state, the <STATE> can be omitted.\n
+ * \n
+ * @return true: Success\n
+ * @return false: Unknown area, zone or context\n
+ * @details
+ * \n
+ * Allocates the content state to the area or zone. Arbitration and
+ * post arbitration will not be executed.\n
+ * The display / outputting request of the specified content state will be active.
+ * The statuses of hidden, mute and attenuated will not be changed.\n
+ * Returns true if the request setting is succeeded. If an unknown context
+ * name is specified, false is returned.\n
+ *
+ * @note
+ * This API is intended for setting up initial state of unit tests.\n
+ * In setResultContentState(), in addition to content state assignment,
+ * evaluation of the action determination process at the time of arbitration
+ * losing and control execution expression is performed, whereas in this
+ * API only content state assignment is performed.\n
+ * \n
+ * @deprecated
+ * Since there is a possibility of contradiction with the
+ * constraint, it is recommended not to use it except unit test.
+ * \n
+ * @details
+ * **Example**
+ *
+ * ```
+ * res = arb->setAllocatableResult("AreaA", "ContentA/NORMAL");
+ * if(res == false) {
+ * // Unknwon area, zone or context
+ * }
+ * ```
+ */
+ bool setAllocatableResult(const std::string& allocatableName,
+ const std::string& contextName);
+ // internal {
+#ifdef RBA_USE_LOG
+ RBAArbitrator(RBAModel* newModel, RBALogManager* logManager);
+#endif
+ bool evaluate(RBAExpression* expression);
+ const RBARuleObject* evaluateObject(RBAExpression* expression);
+ int32_t evaluateValue(RBAExpression* expression);
+
+ // }
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+private:
+ bool isValidContext(const std::string& context);
+ bool isValidContext(std::list<std::string>& contexts);
+ bool setRequestData(
+ const std::string& context, bool require,
+ std::list<std::pair<std::string, std::int32_t>>* const properties = nullptr,
+ std::uint32_t syncIndex = 0xFFFFU);
+ void setRequestData(const RBAContentState* state, bool require);
+ void setRequestData(const RBAContent* const content, bool require);
+ void setActive(const RBASceneImpl* const scene, const bool require);
+ void setSceneProperty(const RBAAbstractProperty* const prop, const std::int32_t value);
+ void setRequestData(std::list<std::string>& contexts, const bool require);
+
+#ifdef RBA_USE_LOG
+ void checkAllConstraints();
+#endif
+ void updateResult();
+ void checkCancelContent() const;
+ void createResultData();
+
+public:
+ bool satisfiesConstraints() const;
+
+private:
+ std::unique_ptr<RBAResult> arbitrateMain();
+ void arbitrate(std::list<RBAAllocatable*>& allocatables);
+ void arbitrateAllocatable(RBAAllocatable* allocatable,
+ std::set<const RBAAllocatable*>& revisited,
+ const std::int32_t nest, RBAAffectInfo* const affectInfo,
+ RBARollbacker* const parentRollbacker);
+
+ bool sortContentStates(const RBAAllocatable* const allocatable,
+ std::list<const RBAContentState*>& states) const;
+ void postArbitrate();
+ void changeContentStateCancelWithPolicy(const RBAContentState* const state);
+ void collectRevisitAllocatable(
+ std::list<const RBAAllocatable*>* const totalRevisitAllocatables,
+ RBAAllocatable*& allocatable,
+ std::list<RBAConstraintImpl*>& falseConstraints,
+ std::set<const RBAAllocatable*>& revisited);
+
+ static std::int32_t getViewActionPriority(const RBAViewActionType viewActionType);
+ static bool compareViewAction(const std::unique_ptr<RBAViewAction>& lhs,
+ const std::unique_ptr<RBAViewAction>& rhs);
+
+public:
+ RBAResultImpl* getResult() const; /// Used by rba_tool
+ bool isCancel(const RBAContentState* const state) const;
+
+private:
+ void differenceArbitrate();
+ bool checkConstraints(std::list<RBAConstraintImpl*>& constraints,
+ std::list<RBAConstraintImpl*>& falseConstraints,
+ const RBAAllocatable* const allocatable);
+ bool checkConstraintAndReArbitrate(RBAAllocatable* allocatable,
+ std::set<const RBAAllocatable*>& revisited,
+ const std::int32_t nest,
+ RBAAffectInfo* const affectInfo,
+ RBARollbacker* const parentRollbacker,
+ std::list<RBAConstraintImpl*>& constraints,
+ bool * const isSkipped, const bool isFinal);
+ void setCancel(const RBAContentState* const state, const bool checked);
+ void getSortedContentStates(
+ const RBAAllocatable* const allocatable,
+ std::list<const RBAContentState*>& contentStates) const;
+
+#ifdef RBA_USE_LOG
+ void logRequestArbitration();
+ void logPreResultArbitration();
+ void logRequestForCoverage();
+ void logResultArbitration();
+ void logResultForCoverage();
+ void setLogToResult();
+#endif
+
+public:
+ std::set<const RBAContentState*>& getCancelChecked();
+ std::unique_ptr<RBAResultImpl>& getResultRef() const;
+ void setResult(std::unique_ptr<RBAResultImpl> result);
+ std::unique_ptr<RBAResultSet>& getNextResultSet();
+ void setNextResultSet(std::unique_ptr<RBAResultSet> nextResultSet);
+ std::unique_ptr<RBAResultSet>& getBackupResultSet();
+ void setBackupResultSet(std::unique_ptr<RBAResultSet> backupResultSet);
+ std::unique_ptr<RBAResultSet>& getReservedResultSet();
+ void setReservedResultSet(std::unique_ptr<RBAResultSet> reservedResultSet);
+ std::recursive_mutex& getMutex() const;
+#ifdef RBA_USE_LOG
+ void setSimulationMode(bool simulationMode);
+#endif
+ std::deque<std::unique_ptr<RBARequestQueMember>>& getRequestQue();
+
+private:
+ RBAModelImpl* model_ {nullptr};
+ std::set<const RBAContentState*> cancelChecked_;
+
+ mutable std::unique_ptr<RBAResultImpl> result_;
+ // ResultSet to use as CurrentResultSet in next arbitration
+ std::unique_ptr<RBAResultSet> nextResultSet_;
+ // ResultSet to use as PreviousResultSet in next arbitration
+ std::unique_ptr<RBAResultSet> backupResultSet_;
+ // ResultSet to be used as CurrentResultSet in cancelArbitration()
+ std::unique_ptr<RBAResultSet> reservedResultSet_;
+ // ResultSet to use as CurrentResultSet in satisfiesConstraints()
+ std::unique_ptr<RBAResultSet> resultSetForSatisfiesConstraints_;
+ mutable std::recursive_mutex mutex_;
+#ifdef RBA_USE_LOG
+ bool simulationMode_ = false;
+#endif
+ std::deque<std::unique_ptr<RBARequestQueMember>> requestQue_;
+
+public:
+ void setModel(RBAModelImpl* const newModel);
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAArea.hpp b/src/include/rba/RBAArea.hpp
new file mode 100644
index 0000000..c5afc7e
--- /dev/null
+++ b/src/include/rba/RBAArea.hpp
@@ -0,0 +1,92 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Area class
+ */
+
+#ifndef RBAAREA_HPP
+#define RBAAREA_HPP
+
+#include <list>
+#include <string>
+#include "RBAArbitrationPolicy.hpp"
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+namespace rba
+{
+
+class RBASize;
+class RBAViewContent;
+
+/**
+ * @class RBAArea
+ * Defines a Frame for displaying the view content.<br>
+ * At run time, at most one view content is allocated to one area.
+ */
+class DLL_EXPORT RBAArea
+{
+protected:
+ RBAArea()=default;
+ RBAArea(const RBAArea&)=delete;
+ RBAArea(RBAArea&&)=delete;
+ RBAArea& operator=(const RBAArea&)=delete;
+ RBAArea& operator=(RBAArea&&)=delete;
+ ~RBAArea()=default;
+
+public:
+ /**
+ * @brief Returns the name of the area.
+ * @return Area name
+ */
+ virtual std::string getName() const=0;
+
+ /**
+ * @brief Returns the x-axis value of the base point of the area
+ * @return X-axis Value of the base point
+ */
+ virtual std::int32_t getX() const=0;
+
+ /**
+ * @brief Returns the y-axis value of the base point of the area
+ * @return Y-axis Value of the base point
+ */
+ virtual std::int32_t getY() const=0;
+
+ /**
+ * @brief Returns the z-order value.
+ * An area with a large z-order value is displayed on the front of an area with small z-order value.
+ * @return Z-order value
+ */
+ virtual std::int32_t getZorder() const=0;
+
+ /**
+ * @brief Returns the list of content which can be displayed on this area.
+ * @return list of content
+ */
+ virtual const std::list<const RBAViewContent*>& getContents() const=0;
+
+ /**
+ * @brief Returns the list of size defined to this area .
+ * Since multiple size can be defined, returns a list of size.
+ * @return list of size
+ */
+ virtual const std::list<const RBASize*>& getSizes() const=0;
+
+ /**
+ * @brief Returns the arbitration policy value defined to this area.
+ * @return arbitration policy value
+ */
+ virtual RBAArbitrationPolicy getArbitrationPolicy() const=0;
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBABasePoint.hpp b/src/include/rba/RBABasePoint.hpp
new file mode 100644
index 0000000..dd971e0
--- /dev/null
+++ b/src/include/rba/RBABasePoint.hpp
@@ -0,0 +1,75 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Base point class
+ */
+
+#ifndef RBABASEPOINT_HPP
+#define RBABASEPOINT_HPP
+
+namespace rba
+{
+
+/**
+ * @enum RBABasePoint
+ * Base point for object having size. For example Area.
+ */
+enum class RBABasePoint : std::uint8_t
+{
+ /**
+ * @brief Defines Left-Top coordinate as the base point of (x, y)
+ * The rectangle is represented by (x, y)-(x+width, y+height)
+ */
+ LEFT_TOP,
+
+ /**
+ * @brief Defines Left-Middle coordinate as the base point of (x, y)
+ * The rectangle is represented by (x, y-height/2)-(x+width, y+height/2)
+ */
+ LEFT_MIDDLE,
+
+ /**
+ * @brief Defines Left-Bottom coordinate as the base point of (x, y)
+ * The rectangle is represented by (x, y-height)-(x+width, y)
+ */
+ LEFT_BOTTOM,
+
+ /**
+ * @brief Defines Right-Top coordinate as the base point of (x, y)
+ * The rectangle is represented by (x-width, y)-(x, y+height)
+ */
+ RIGHT_TOP,
+
+ /**
+ * @brief Defines Right-Middle coordinate as the base point of (x, y)
+ * The rectangle is represented by (x-width, y-height/2)-(x, y+height/2)
+ */
+ RIGHT_MIDDLE,
+
+ /**
+ * @brief Defines Right-Bottom coordinate as the base point of (x, y)
+ * The rectangle is represented by (x-width, y-height)-(x, y)
+ */
+ RIGHT_BOTTOM,
+
+ /**
+ * @brief Defines Center-Top coordinate as the base point of (x, y)
+ * The rectangle is represented by (x-width/2, y)-(x+width/2, y+height)
+ */
+ CENTER_TOP,
+
+ /**
+ * @brief Defines Center-Middle coordinate as the base point of (x, y)
+ * The rectangle is represented by (x-width/2, y-height/2)-(x+width/2, y+height/2)
+ */
+ CENTER_MIDDLE,
+
+ /**
+ * @brief Defines Center-Bottom coordinate as the base point of (x, y)
+ * The rectangle is represented by (x-width/2, y-height)-(x+width/2, y)
+ */
+ CENTER_BOTTOM
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAContentLoserType.hpp b/src/include/rba/RBAContentLoserType.hpp
new file mode 100644
index 0000000..0ddb76e
--- /dev/null
+++ b/src/include/rba/RBAContentLoserType.hpp
@@ -0,0 +1,36 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Good loser type class
+ */
+
+#ifndef RBACONTENTLOSERTYPE_HPP
+#define RBACONTENTLOSERTYPE_HPP
+
+namespace rba
+{
+
+/**
+ * @enum RBAContentLoserType
+ * Type of behavior when content loses the arbitration
+ */
+enum class RBAContentLoserType : std::uint8_t
+{
+ /**
+ * @brief Always cancels its request when losing arbitration.
+ */
+ GOOD_LOSER=0,
+
+ /**
+ * @brief Cancels its request only if it lost the arbitration in the displaying state.
+ */
+ DO_NOT_GIVEUP_UNTIL_WIN,
+
+ /**
+ * @brief Never cancels its request.
+ */
+ NEVER_GIVEUP
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBADisplay.hpp b/src/include/rba/RBADisplay.hpp
new file mode 100644
index 0000000..1c2be8e
--- /dev/null
+++ b/src/include/rba/RBADisplay.hpp
@@ -0,0 +1,56 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Display class
+ */
+
+#ifndef RBADISPLAY_HPP
+#define RBADISPLAY_HPP
+
+#include <list>
+#include <string>
+
+namespace rba {
+
+class RBAArea;
+class RBASize;
+
+/**
+ * @class RBADisplay
+ * Defines a screen layout of the display.<br>
+ * You can define multiple displays for Multi-Display products.
+ * Display defines a set of areas which are laid out on it.
+ */
+class RBADisplay
+{
+protected:
+ RBADisplay()=default;
+ RBADisplay(const RBADisplay&)=delete;
+ RBADisplay(RBADisplay&&)=delete;
+ RBADisplay& operator=(const RBADisplay&)=delete;
+ RBADisplay& operator=(RBADisplay&&)=delete;
+ ~RBADisplay()=default;
+
+public:
+ /**
+ * @brief Returns the name of display
+ * @return Display name
+ */
+ virtual std::string getName() const=0;
+
+ /**
+ * @brief Returns the size of display
+ * @return Size
+ */
+ virtual const RBASize* getSize() const=0;
+
+ /**
+ * @brief Returns areas which are allocated to the display
+ * @return List of area
+ */
+ virtual const std::list<const RBAArea*>& getAreas() const=0;
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAJsonParser.hpp b/src/include/rba/RBAJsonParser.hpp
new file mode 100644
index 0000000..7cc992d
--- /dev/null
+++ b/src/include/rba/RBAJsonParser.hpp
@@ -0,0 +1,85 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * JSON parser class
+ */
+
+#ifndef RBAJSONPARSER_HPP
+#define RBAJSONPARSER_HPP
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+#include <memory>
+#include "RBAModel.hpp"
+
+namespace rba
+{
+
+class RBAModel;
+// internal {
+class RBAExpression;
+class RBAModelFactory;
+// }
+
+/**
+ * @class RBAJsonParser
+ * Provides the facility that loads a model file in JSON format and generate a Model object.
+ */
+class DLL_EXPORT RBAJsonParser
+{
+public:
+ RBAJsonParser();
+ RBAJsonParser(const RBAJsonParser&)=delete;
+ RBAJsonParser(const RBAJsonParser&&)=delete;
+ RBAJsonParser& operator=(const RBAJsonParser&)=delete;
+ RBAJsonParser& operator=(const RBAJsonParser&&)=delete;
+ virtual ~RBAJsonParser() noexcept;
+
+public:
+ /**
+ * @brief Loads a JSON file and generates a model object.
+ * @param filename Path of JSON file
+ * @return Model
+ * If the file is not found, returns nullptr.
+ *
+ * **Example**
+ *
+ * ```
+ * rba::RBAJsonParser parser;
+ * rba::RBAModel* model = parser.parse("RBAModel.json");
+ * if(model == nullptr) {
+ * std::cout << "ERRROR: Could not read JSON file" << std::endl;
+ * return 1;
+ * }
+ * rba::RBAArbitrator* arb = new rba::RBAArbitrator(model);
+ * ```
+ */
+ RBAModel* parse(const std::string& filename);
+
+ // internal {
+ RBAJsonParser(RBAModelFactory* factory);
+ // }
+
+private:
+ class Impl;
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::unique_ptr<Impl> impl_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAModel.hpp b/src/include/rba/RBAModel.hpp
new file mode 100644
index 0000000..ad3f97b
--- /dev/null
+++ b/src/include/rba/RBAModel.hpp
@@ -0,0 +1,241 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Model class
+ */
+
+#ifndef RBAMODEL_HPP
+#define RBAMODEL_HPP
+
+#include <string>
+#include "RBAArea.hpp"
+#include "RBAViewContent.hpp"
+#include "RBAViewContentState.hpp"
+#include "RBASize.hpp"
+#include "RBAZone.hpp"
+#include "RBASoundContent.hpp"
+#include "RBASoundContentState.hpp"
+#include "RBAScene.hpp"
+#include "RBADisplay.hpp"
+#include "RBAPositionContainer.hpp"
+#include "RBAJsonParser.hpp"
+// internal {
+#include "RBAAreaSet.hpp"
+#include "RBAViewContentSet.hpp"
+#include "RBAZoneSet.hpp"
+#include "RBASoundContentSet.hpp"
+#include "RBAConstraint.hpp"
+// }
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+namespace rba
+{
+
+/**
+ * @class RBAModel
+ * Defines the arbitration rule model which is used by Arbitrator.<br>
+ * The model consists of model elements such as areas, zones, contens, scenes,
+ * constraint expressions, and so on.
+ * Elements can be searched by name, and the list of elements for each type can be retrieved.
+ */
+class DLL_EXPORT RBAModel
+{
+public:
+ RBAModel()=default;
+ RBAModel(const RBAModel&)=delete;
+ RBAModel(RBAModel&&)=delete;
+ RBAModel& operator=(const RBAModel&)=delete;
+ RBAModel& operator=(RBAModel&&)=delete;
+ virtual ~RBAModel()=default;
+
+public:
+ /**
+ * @brief Search for area with a name
+ * @param areaName Area name
+ * @return Area
+ *
+ * If the area name does not exist, returns nullptr.
+ */
+ virtual const RBAArea* findArea(const std::string& areaName) const=0;
+
+ /**
+ * @brief Search for view content with a name.
+ * @param contName Content name
+ * @return Content
+ *
+ * If the content name does not exist, returns nullptr.
+ */
+ virtual const RBAViewContent* findViewContent(const std::string& contName) const=0;
+
+ /**
+ * @brief Search for view content state with a name.
+ * @param stateName Content state name
+ * @return State of view content
+ *
+ * If the content state name does not exist, returns nullptr.
+ */
+ virtual const RBAViewContentState* findViewContentState(const std::string& stateName) const=0;
+
+ /**
+ * @brief Search for size with a name.
+ * @param sizeName Name of the search size
+ * @return Size
+ *
+ * Specify the name of the search size as follows.\n
+ * In the case of the size linked to the area:
+ * <area_name>/<size_name>
+ * In the case of the size linked to the content:
+ * <content_name>/<size_name>
+ * \n
+ * If the name of the search size does not exist, returns nullptr.
+ */
+ virtual const RBASize* findSize(const std::string& sizeName) const=0;
+
+ /**
+ * @brief Search for zone with a name.
+ * @param zoneName Zone name
+ * @return Zone
+ *
+ * If the zone name does not exist, returns nullptr.
+ */
+ virtual const RBAZone* findZone(const std::string& zoneName) const=0;
+
+ /**
+ * @brief Search for sound content with a name.
+ * @param contName Content name
+ * @return Sound content
+ *
+ * If the content name does not exist, returns nullptr.
+ */
+ virtual const RBASoundContent* findSoundContent(const std::string& contName) const=0;
+
+ /**
+ * @brief Search for sound content state with a name.
+ * @param stateName Content state name
+ * @return Sound content state
+ *
+ * If the content state name does not exist, returns nullptr.
+ */
+ virtual const RBASoundContentState* findSoundContentState(const std::string& stateName) const=0;
+
+ /**
+ * @brief Search for scene with a name.
+ * @param sceneName Scene name
+ * @return Scene
+ *
+ * If the scene name does not exist, returns nullptr.
+ */
+ virtual const RBAScene* findScene(const std::string& sceneName) const=0;
+
+ /**
+ * @brief Search for display with a name.
+ * @param displayName Display name.
+ * @return Display
+ *
+ * If the display name does not exist, returns nullptr.
+ */
+ virtual const RBADisplay* findDisplay(const std::string& displayName) const=0;
+
+ /**
+ * @brief Returns all the areas.
+ * @return List of areas
+ */
+ virtual const std::list<const RBAArea*>& getAreas() const=0;
+
+ /**
+ * @brief Returns all the view contents.
+ * @return List of contents
+ */
+ virtual const std::list<const RBAViewContent*>& getViewContents() const=0;
+
+ /**
+ * @brief Returns all the view content states.
+ * @return List of view content states
+ */
+ virtual const std::list<const RBAViewContentState*>& getViewContentStates() const=0;
+
+ /**
+ * @brief Returns all the sizes.
+ * @return List of sizes
+ */
+ virtual const std::list<const RBASize*>& getSizes() const=0;
+
+ /**
+ * @brief Returns all the zones.
+ * @return List of zones
+ */
+ virtual const std::list<const RBAZone*>& getZones() const=0;
+
+ /**
+ * @brief Returns all the sound contents.
+ * @return List of sound contents
+ */
+ virtual const std::list<const RBASoundContent*>& getSoundContents() const=0;
+
+ /**
+ * @brief Returns all the sound content states.
+ * @return List of sound content states
+ */
+ virtual const std::list<const RBASoundContentState*>& getSoundContentStates() const=0;
+
+ /**
+ * @brief Returns all the scenes.
+ * @return List of scenes
+ */
+ virtual const std::list<const RBAScene*>& getScenes() const=0;
+
+ /**
+ * @brief Returns all the displays.
+ * @return List of displays
+ */
+ virtual const std::list<const RBADisplay*>& getDisplays() const=0;
+
+ // internal {
+ /**
+ * @brief Search for Model element with a name.
+ * @param elementName Model element name.
+ * @return Model element
+ *
+ * If the Model element name does not exist, returns nullptr.
+ */
+ virtual const RBAModelElement* findModelElement(const std::string& elementName) const=0;
+
+ /**
+ * @brief Returns all the sets of areas.
+ * @return List of sets of areas
+ */
+ virtual const std::list<const RBAAreaSet*>& getAreaSets() const=0;
+
+ /**
+ * @brief Returns all the sets of view contents.
+ * @return List of sets of view contents
+ */
+ virtual const std::list<const RBAViewContentSet*>& getViewContentSets() const=0;
+
+ /**
+ * @brief Returns all the position containers.
+ * @return List of sets of position containers
+ */
+ virtual const std::list<const RBAPositionContainer*>& getPositionContainers() const=0;
+
+ /**
+ * @brief Returns all the constraints.
+ * @return List of constraints
+ */
+ virtual std::list<RBAConstraint*>& getConstraints()=0;
+
+ // }
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAPositionContainer.hpp b/src/include/rba/RBAPositionContainer.hpp
new file mode 100644
index 0000000..2340840
--- /dev/null
+++ b/src/include/rba/RBAPositionContainer.hpp
@@ -0,0 +1,72 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Position container class
+ */
+
+#ifndef RBAPOSITIONCONTAINER_HPP
+#define RBAPOSITIONCONTAINER_HPP
+
+#include <cstdint>
+#include "RBABasePoint.hpp"
+
+namespace rba
+{
+
+class RBAArea;
+
+class RBAPositionContainer
+{
+protected:
+ RBAPositionContainer()=default;
+ RBAPositionContainer(const RBAPositionContainer&)=delete;
+ RBAPositionContainer(RBAPositionContainer&&)=delete;
+ RBAPositionContainer& operator=(const RBAPositionContainer&)=delete;
+ RBAPositionContainer& operator=(RBAPositionContainer&&)=delete;
+ ~RBAPositionContainer()=default;
+
+public:
+ /**
+ * @brief Get X coordinate
+ * @return X coordinate
+ */
+ virtual std::int32_t getX() const=0;
+
+ /**
+ * @brief Get Y coordinate
+ * @return Y coordinate
+ */
+ virtual std::int32_t getY() const=0;
+
+ /**
+ * @brief Get base point
+ * @return Base point
+ */
+ virtual RBABasePoint getBasePoint() const=0;
+
+ /**
+ * @brief Get assigned area
+ * @return assigned area
+ */
+ virtual const RBAArea* getArea() const=0;
+
+public:
+ /**
+ * @brief default X coordinate
+ */
+ const static std::int32_t X_EDEFAULT=0;
+
+ /**
+ * @brief default Y coordinate
+ */
+ const static std::int32_t Y_EDEFAULT=0;
+
+ /**
+ * @brief default base point
+ */
+ const static RBABasePoint BASE_POINT_EDEFAULT=RBABasePoint::LEFT_TOP;
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAResult.hpp b/src/include/rba/RBAResult.hpp
new file mode 100644
index 0000000..4a6766b
--- /dev/null
+++ b/src/include/rba/RBAResult.hpp
@@ -0,0 +1,861 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Arbitration result class
+ */
+
+#ifndef RBARESULT_HPP
+#define RBARESULT_HPP
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+#include <memory>
+#include <list>
+#include "RBAResultStatusType.hpp"
+#include "RBAViewAction.hpp"
+#include "RBAScene.hpp"
+
+namespace rba
+{
+
+class RBAArea;
+class RBAViewContent;
+class RBAViewContentState;
+class RBAScene;
+class RBASize;
+class RBAZone;
+class RBASoundContent;
+class RBASoundContentState;
+// internal {
+class RBADisplay;
+// }
+
+/**
+ * @class RBAResult
+ * Stores an arbitration result.<br>
+ * The Arbitrator allocates Contents to Areas. Related
+ * information of those can be acquired from RBAResult.\n
+ * The arbitration result indicates which content is allocated to each
+ * area / zone.
+ * Also, snapshot information and view action information (only display
+ * results) indicating the difference from the last arbitration are included.
+ */
+class DLL_EXPORT RBAResult
+{
+public:
+ RBAResult()=default;
+ RBAResult(const RBAResult&)=delete;
+ RBAResult(RBAResult&&)=delete;
+ RBAResult& operator=(const RBAResult&)=delete;
+ RBAResult& operator=(RBAResult&&)=delete;
+ virtual ~RBAResult()=default;
+
+public:
+
+ // [VisibleArea/SoundingZone]
+
+ /**
+ * @brief Returns the displaying areas determined by the last arbitration.
+ * @return List of visible areas.
+ */
+ virtual const std::list<const RBAArea*>& getVisibleAreas() const=0;
+
+ /**
+ * @brief Returns the outputting zones determined by the last arbitration.
+ * @return List of sounding zones.
+ */
+ virtual const std::list<const RBAZone*>& getSoundingZones() const=0;
+
+ // [Visible/Sounding ContentStates]
+
+ /**
+ * @brief Returns the view content states to be displayed determined by the last arbitration.
+ * @return List of visible view content states.
+ */
+ virtual const std::list<const RBAViewContentState*>& getVisibleContentStates() const=0;
+
+ /**
+ * @brief Returns the sound content states to be output determined by the last arbitration.
+ * @return List of sound content states to be output.
+ * @details The list contains sound contents to be attenuated.
+ */
+ virtual const std::list<const RBASoundContentState*>& getSoundingContentStates() const=0;
+
+ // [Active View/Sound ContentStates]
+
+ /**
+ * @brief Returns the active view content states at the last arbitration
+ * result.
+ * @return List of active view content states.
+ * @details
+ * The active view content states are those that have been requested to
+ * display so far. They do not include the view content state whose request
+ * has been withdrawn or canceled.
+ */
+ virtual const std::list<const RBAViewContentState*>& getActiveViewContentStates() const=0;
+
+ /**
+ * @brief Returns the active sound content states at the last arbitration
+ * result.
+ * @return List of active sound content states.
+ * @details
+ * The active sound content states are those that have been requested to
+ * output so far. They do not include the sound content state whose request
+ * has been withdrawn or canceled.
+ */
+ virtual const std::list<const RBASoundContentState*>& getActiveSoundContentStates() const=0;
+
+ // [Active Scenes]
+
+ /**
+ * @brief Returns the active scenes at the last arbitration.
+ * @return List of active scenes.
+ * @details
+ * The active scenes are those that have been requested for ON so far.
+ * They do not include scenes requested for OFF afterwards.
+ */
+ virtual const std::list<const RBAScene*>& getActiveScenes() const=0;
+
+ // [InvisibleAreas/UnsoundingZone]
+
+ /**
+ * @brief Returns the invisible areas determined by the last arbitration.
+ * @return List of invisible areas.
+ * @details
+ * Returns the areas which are not displayed out of all areas.\n
+ * The list contains areas to be hidden.
+ */
+ virtual const std::list<const RBAArea*>& getInvisibleAreas() const=0;
+
+ /*
+ * @brief Returns the unsounding zones determined by the last arbitration.
+ * @return List of unsounding zones.
+ * @details
+ * Returns the zones which are not output out of all zones.
+ * The list contains zones to be muted.
+ */
+ virtual const std::list<const RBAZone*>& getUnsoundingZones() const=0;
+
+ // [HiddenAreas/MuteZones]
+
+ /**
+ * @brief Returns the area that is hidden state and content has been
+ * allocated.\n
+ * The hidden state is a state in which the area must be hidden by a
+ * constraint expression.
+ * @return List of areas.
+ * Returns the area which become to be invisible.
+ * The area invisible in the previous time is not included.
+ */
+ virtual const std::list<const RBAArea*>& getHiddenAreas() const=0;
+
+ /**
+ * @brief Returns the zone that is muted state and content has been
+ * allocated.\n
+ * The muted state is a state in which the zone must be muted by a
+ * constraint expression.
+ * @return List of muted zones.
+ *
+ * Retuens the zones that is defeted and canceled sound contents.
+ */
+ virtual const std::list<const RBAZone*>& getMuteZones() const=0;
+
+ // [get Attenuated]
+
+ /**
+ * @brief Returns the attenuated zones determined by the last arbitration.
+ * @return List of attenuated zones.
+ */
+ virtual const std::list<const RBAZone*>& getAttenuatedZones() const=0;
+
+ // [Canceled Contents]
+
+ /**
+ * @brief Returns the canceled view contents determined by the last arbitration.
+ * @return List of canceled view contents.
+ * @details
+ * Reterns list of view contents which are canceled by Request handling on lost definition\n
+ * such as Loser Type and Post Constraints.\n
+ * The list does not contain contents which are withdrawn.
+ */
+ virtual const std::list<const RBAViewContent*>& getCanceledViewContents() const=0;
+
+ /**
+ * @brief Returns the canceled sound contents determined by the last arbitration.
+ * @return List of canceled sound contents.
+ * @details
+ * Reterns list of sound contents which are canceled by Request handling on lost definition\n
+ * such as Loser Type and Post Constraints.\n
+ * The list does not contain contents which are withdrawn.
+ */
+ virtual const std::list<const RBASoundContent*>& getCanceledSoundContents() const=0;
+
+ // [Standby Contents]
+
+ /**
+ * @brief Returns the stand by view contents due to defeated at the last
+ * arbitration.
+ * @return List of stand by view contents.
+ * @details
+ * Returns list of view contents which are active but not allocated to any area.
+ * The list does not contains which are canceled contents or are allocated to hidden area.
+ */
+ virtual const std::list<const RBAViewContent*>& getStandbyViewContents() const=0;
+
+ /**
+ * @brief Returns the stand by sound contents due to defeated at the last
+ * arbitration.
+ * @return List of stand by sound contents.
+ * @details
+ * Returns list of sound contents which are active but not allocated to any area.
+ * The list does not contains which are canceled contents or are allocated to muted area.
+ */
+ virtual const std::list<const RBASoundContent*>& getStandbySoundContents() const=0;
+
+ // [ContentStates]
+
+ /**
+ * @brief Returns the view content state assigned to the area of the last
+ * arbitration.
+ * @param area Area
+ * @return The view content state assign to the area.
+ * @details
+ * If no view content state is allocated to the area, nullptr is returnd.\n
+ * If area is not defined in the Model or nullptr, nullptr is returnd.
+ */
+ virtual const RBAViewContentState* getContentState(const RBAArea* area) const=0;
+
+ /**
+ * @brief Returns the sound content state assigned to the zone of the last
+ * arbitration.
+ * @param zone Zone
+ * @return The sound content state assign to the zone.
+ * @details
+ * If no sound content state is allocated to the zone, nullptr is returned.\n
+ * If zone is not defined in the Model or nullptr, nullptr is returnd.
+ */
+ virtual const RBASoundContentState* getContentState(const RBAZone* zone) const=0;
+
+ // [Areas/Zones by ConentState]
+
+ /**
+ * @brief Returns the area to which the view content state is allocated at the
+ * last arbitration.
+ * @param state View content state
+ * @return The areas to which the view content state.
+ * @details
+ * If the view content state is not assigned to any area, empty list is returned.\n
+ * If state is not defined in the Model or nullptr, empty list is returned.
+ */
+ virtual const std::list<const RBAArea*> getArea(const RBAViewContentState* state) const=0;
+
+ /**
+ * @brief Get the zone to which the sound content state is allocated of the
+ * last arbitration.
+ * @param state Sound content state
+ * @return The zones to which the sound content state is allocated.
+ * @details
+ * If the sound content state is not assigned to any zone,
+ * empty list is retuened.\n
+ * If state is not defined in the Model or nullptr, empty list is returned.
+ */
+ virtual const std::list<const RBAZone*> getZone(const RBASoundContentState* state) const=0;
+
+ // [Areas/Zones by Content]
+
+ /**
+ * @brief Returns the area to which the view content is allocated of the
+ * last arbitration.
+ * @param content View content
+ * @return The areas to which the view content is allocated.
+ * @details
+ * If the view content is not assigned to any area, empty list is returned.\n
+ * If content is not defined in the Model or nullptr, empty list is returned.\n
+ * This API is the same as getArea(RBAViewContentState*) \n
+ * except for the type of argument.
+ */
+ virtual const std::list<const RBAArea*> getArea(const RBAViewContent* content)const=0;
+
+ /**
+ * @brief Returns the zone to which the sound content state is allocated of the
+ * last arbitration.
+ * @param content Sound content
+ * @return The zones to which the sound content is allocated.
+ * @details
+ * If the sound content is not assigned to any area, nullptr is returned.\n
+ * If content is not defined in the Model or nullptr, empty list is returned.\n
+ * This API is the same as getZone(RBASoundContentState*) \n
+ * except for the type of argument.
+ */
+ virtual const std::list<const RBAZone*> getZone(const RBASoundContent* content) const=0;
+
+ // [Size]
+
+ /**
+ * @brief Returns the size of the area determined in the last arbitration.
+ * @param area Area
+ * @return The size of the area.
+ * @details
+ * Area may have multiple sizes and its size will vary by the allocated content.\n
+ * This API returns the size which are matched with allocated content.\n
+ * If no content is allocated to the area, returns nullptr.\n
+ * If area is not defined in the Model or nullptr, returns nullptr.
+ */
+ virtual const RBASize* getSize(const RBAArea* area) const=0;
+
+ // [Active check Scene]
+
+ /**
+ * @brief Returns true if the scene is ON at the last arbitration.
+ * @param scene Reference scene to be checked.
+ * @return true: the scene is ON
+ * @return false: the scene is OFF
+ * @details
+ * If scene is not defined in the Model or nullptr, returns false.
+ */
+ virtual bool isActive(const RBAScene* scene) const=0;
+
+ // [Active check ContentState]
+
+ /**
+ * @brief Returns true if the view content is active.
+ * @param state Reference view content to be checked.
+ * @return true: Active
+ * @return false: Not active
+ * @details
+ * If content is not defined in the Model or nullptr, returns false.
+ */
+ virtual bool isActive(const RBAViewContent* content) const=0;
+
+ /**
+ * @brief Returns true if the sound content is active.
+ * @param state Reference sound content to be checked.
+ * @return true: Active
+ * @return false: Not active
+ * @details
+ * If content is not defined in the Model or nullptr, returns false.
+ */
+ virtual bool isActive(const RBASoundContent* content) const=0;
+
+ // [Visible/Sounding Area/Zonecheck]
+
+ /**
+ * @brief Returns true if the area is visible of the last arbitration.
+ * @param area Reference area to be checked.
+ * @return true: Visible
+ * @return false: Not visible
+ * @details
+ * Returns false if the area is hidden.\n
+ * If area is not defined in the Model or nullptr, returns false.
+ */
+ virtual bool isVisible(const RBAArea* area) const=0;
+
+ /**
+ * @brief Returns true if the zone is sounding of the last arbitration.
+ * @param zone Reference zone to be checked.
+ * @return true: Sounding
+ * @return false: Not sounding
+ * @details
+ * Returns false if the zone is muted.\n
+ * If zone is not defined in the Model or nullptr, returns false.
+ */
+ virtual bool isSounding(const RBAZone* zone) const=0;
+
+ // [Visible/Sounding ContentState check]
+
+ /**
+ * @brief Returns true if the view content state is visible
+ * of the last arbitration.
+ * @param state Reference view content state to be checked.
+ * @return true: state is allocated to visible area.
+ * @return false: state is not allocated to visible area.
+ * @details
+ * If all of the areas to which the content is allocated are hidden, returns false\n
+ * If state is not defined in the Model or nullptr, returns false.
+ */
+ virtual bool isVisible(const RBAViewContentState* state) const=0;
+
+ /**
+ * @brief Returns true if the sound content state is sounding
+ * of the last arbitration.
+ * @param state Reference sound content state to be check.
+ * @return true: state is allocated to outputting zone.
+ * @return false: state is not allocated to outputting zone.
+ * @details
+ * If all of the zones to which the content is allocated are muted, returns false\n
+ * If state is not defined in the Model or nullptr, returns false.
+ */
+ virtual bool isSounding(const RBASoundContentState* state) const=0;
+
+ // [View/Sound ContentState]
+
+ /**
+ * @brief Returns the view content state allocated to the area
+ * of the last arbitration.
+ * @param area Area
+ * @return The view content state allocated to the area.
+ * @details
+ * Even if the area is hidden, Returns the allocated content state.\n
+ * If no visible view content state is allocated the area, nullptr is returnd.\n
+ * If area is not defined in the Model or nullptr, returns nullptr.
+ */
+ virtual const RBAViewContentState* getViewContentState(const RBAArea* area) const=0;
+
+ /**
+ * @brief Returns the sounding sound content state assigned to the zone
+ * of the last arbitration.
+ * @param zone Zone
+ * @return The sounding sound content state assign to the zone.
+ * @details
+ * Even if the zone is muted, Returns the allocated content state.\n
+ * If no sounding sound content state is allocated the area,
+ * nullptr is returnd.\n
+ * If zone is not defined in the Model or nullptr, returns nullptr.
+ */
+ virtual const RBASoundContentState* getSoundContentState(const RBAZone* zone) const=0;
+
+ // [Hidden/Mute check]
+
+ /**
+ * @brief Returns true if the area is hidden state of the last arbitration.\n
+ * The hidden state is a state in which the area must be hidden by a
+ * constraint expression.\n
+ * In the hidden state, it returns true even if the content is not assigned.
+ * @param area Reference area to be checked.
+ * @return true: Hidden
+ * @return false: Not hidden
+ * @details
+ * If area is not defined in the Model or nullptr, returns nullptr.
+ */
+ virtual bool isHidden(const RBAArea* area) const=0;
+
+ /**
+ * @brief Returns true if the zone is muted state of the last arbitration.\n
+ * The muted state is a state in which the zone must be muted by a
+ * constraint expression.\n
+ * In the muted state, it returns true even if the content is not assigned.
+ * @param zone Reference zone to be checked.
+ * @return true: Muted
+ * @return false: Not muted
+ * @details
+ * If zone is not defined in the Model or nullptr, returns nullptr.
+ */
+ virtual bool isMute(const RBAZone* zone) const=0;
+
+ // [Check Attenuated]
+
+ /**
+ * @brief Returns true if the zone is attenuated
+ * of the last arbitration.
+ * @param zone Reference zone to be check.
+ * @return true: Attenuated
+ * @return false: Not attenuated
+ * @details
+ * If zone is not defined in the Model or nullptr, returns nullptr.
+ */
+ virtual bool isAttenuated(const RBAZone* zone) const=0;
+
+ // [Cancel check]
+
+ /**
+ * @brief Returns true if the view content state is canceled
+ * at the last arbitration.
+ * @param state Reference view content state to be checked.
+ * @return true: Canceled
+ * @return false: Not canceled or Not request view content state
+ * @details
+ * If state is not active, returns false.\n
+ * If state is not defined in the Model or nullptr, returns false.
+ */
+ virtual bool isCancel(const RBAViewContentState* state) const=0;
+
+ /**
+ * @brief Returns true if the sound content state is canceled
+ * at the last arbitration.
+ * @param state Reference view content state to be checked.
+ * @return true: Canceled
+ * @return false: Not canceled
+ * @details
+ * If state is not active, returns false.\n
+ * If state is not defined in the Model or nullptr, returns false.
+ */
+ virtual bool isCancel(const RBASoundContentState* state) const=0;
+
+ // common
+
+ /**
+ * @brief Returns information of view status changes
+ * (the view actions) of the last arbitration.
+ * @return List of view actions.
+ * @details
+ * ViewAction is an information of differences \n
+ * between the last arbitration result and its previous result.\
+ * There is no difference between hidden and not displayed for visible status.\n
+ */
+ virtual const std::list<const RBAViewAction*>& getViewActions() const=0;
+
+ /**
+ * @brief Returns the result status type of the last arbitration.
+ * @return SUCCESS: Success
+ * @return UNKNOWN_CONTENT_STATE: Failed (The reuqest is unknown)
+ * @return CANCEL_ERROR: Cancel arbitrration error
+ * @endcond
+ virtual RBAResultStatusType getStatusType() const=0;
+
+ /**
+ * @brief Returns satisfied status of all online constraints.
+ * @return true:All online constraints check result is OK, and arbitration finished.
+ * @return false:All online constraints check result is NG, and arbitration finished.
+ */
+ virtual bool satisfiesConstraints() const=0;
+
+ /**
+ * @brief Returns the property value of scene.
+ * @return Property value
+ * @details
+ * If the scene or propertyName is not defined in the Model, returns -99.\n
+ * @endcond
+ virtual std::int32_t getSceneProperty(const RBAScene* scene, const std::string& propertyName) const=0;
+
+ // internal {
+ /**
+ * @brief Returns the displaying areas of the previous arbitration.
+ * @return List of visible areas.
+ */
+ virtual const std::list<const RBAArea*>& getPreVisibleAreas() const=0;
+
+ /**
+ * @brief Returns the outputting sounding zones of the previous arbitration.
+ * @return List of sounding zones.
+ */
+ virtual const std::list<const RBAZone*>& getPreSoundingZones() const=0;
+
+ /**
+ * @brief Returns the view content states to be displayed of the previous arbitration.
+ * @return List of visible view content states.
+ */
+ virtual const std::list<const RBAViewContentState*>& getPreVisibleContentStates() const=0;
+
+ /**
+ * @brief Returns the sound content states to be outputted of the previous arbitration.
+ * @return List of sounding sound content states.
+ * @details The list contains attenuated content states.
+ */
+ virtual const std::list<const RBASoundContentState*>& getPreSoundingContentStates() const=0;
+
+ /**
+ * @brief Returns the active view content states of the previous arbitration
+ * result.
+ * @return List of active view content states.
+ * @details
+ * The active view content states are those that have been requested to
+ * display so far. They do not include the view content state whose request
+ * has been withdrawn or canceled.
+ */
+ virtual const std::list<const RBAViewContentState*>& getPreActiveViewContentStates() const=0;
+
+ /**
+ * @brief Returns the active sound content states of the previous arbitration
+ * result.
+ * @return List of active sound content states.
+ * @details
+ * The active sound content states are those that have been requested to
+ * output so far. They do not include the sound content state whose request
+ * has been withdrawn or canceled.
+ */
+ virtual const std::list<const RBASoundContentState*>& getPreActiveSoundContentStates() const=0;
+
+ /**
+ * @brief Returns the active scenes of the previous arbitration.
+ * @return List of active scenes.
+ * @details
+ * The active scenes are those that have been requested for ON so far.
+ * They do not include scenes requested for OFF afterwards.
+ */
+ virtual const std::list<const RBAScene*>& getPreActiveScenes() const=0;
+
+ /**
+ * @brief Returns the invisible areas of the previous arbitration.
+ * @return List of invisible areas.
+ * @details
+ * Returns the areas which are not displayed out of all areas.
+ */
+ virtual const std::list<const RBAArea*>& getPreInvisibleAreas() const=0;
+
+ /*
+ * @brief Returns the unsounding zones of the previous arbitration.
+ * @return List of unsounding zones.
+ * @details
+ * Returns the zones which are not outputted out of all zones.
+ */
+ virtual const std::list<const RBAZone*>& getPreUnsoundingZones() const=0;
+
+ /**
+ * @brief Returns the areas which have become invisible at the previous arbitration.
+ * @return List of areas.
+ *
+ * Returns the area which become to be invisible.
+ */
+ virtual const std::list<const RBAArea*>& getPreHiddenAreas() const=0;
+
+ /**
+ * @brief Get the muted zones of the previous arbitration.
+ * @return List of muted zones.
+ *
+ * Retuens the zones that is defeted and canceled sound contents.
+ */
+ virtual const std::list<const RBAZone*>& getPreMuteZones() const=0;
+
+ /**
+ * @brief Returns the attenuated zones of the previous arbitration.
+ * @return List of attenuated zones.
+ */
+ virtual const std::list<const RBAZone*>& getPreAttenuatedZones() const=0;
+
+ /**
+ * @brief Returns the canceled view contents of the previous arbitration.
+ * @return List of canceled view contents.
+ */
+ virtual const std::list<const RBAViewContent*>& getPreCanceledViewContents() const=0;
+
+ /**
+ * @brief Returns the canceled sound contents of the previous arbitration.
+ * @return List of canceled sound contents.
+ */
+ virtual const std::list<const RBASoundContent*>& getPreCanceledSoundContents() const=0;
+
+ /**
+ * @brief Returns the stand by view contents due to defeated at the previous
+ * arbitration.
+ * @return List of stand by view contents.
+ */
+ virtual const std::list<const RBAViewContent*>& getPreStandbyViewContents() const=0;
+
+ /**
+ * @brief Returns the stand by sound contents due to defeated at previous
+ * arbitration.
+ * @return List of stand by sound contents.
+ */
+ virtual const std::list<const RBASoundContent*>& getPreStandbySoundContents() const=0;
+
+ /**
+ * @brief Returns the view content state assigned to the area of the previous
+ * arbitration.
+ * @param area Area
+ * @return The view content state assign to the area.
+ *
+ * If no view content state is allocated to the area, nullptr is returnd.
+ */
+ virtual const RBAViewContentState* getPreContentState(const RBAArea* area) const=0;
+
+ /**
+ * @brief Returns the sound content state assigned to the zone of the previous
+ * arbitration.
+ * @param zone Zone
+ * @return The sound content state assign to the zone.
+ *
+ * If no sound content state is allocated to the zone, nullptr is returned.
+ */
+ virtual const RBASoundContentState* getPreContentState(const RBAZone* zone) const=0;
+
+ /**
+ * @brief Returns the area to which the view content state is allocated of the
+ * previous arbitration.
+ * @param state View content state
+ * @return The areas to which the view content state.
+ *
+ * If the view content state is not assigned to any area, nullptr is returned.
+ */
+ virtual const std::list<const RBAArea*> getPreArea(const RBAViewContentState* state) const=0;
+
+ /**
+ * @brief Get the zone to which the sound content state is allocated of the
+ * previous arbitration.
+ * @param state Sound content state
+ * @return The zones to which the sound content state is allocated.
+ *
+ * If the sound content state is not assigned to any zone,
+ * null ptr is retuened.
+ */
+ virtual const std::list<const RBAZone*> getPreZone(const RBASoundContentState* state) const=0;
+
+ /**
+ * @brief Returns the area to which the view content is allocated of the
+ * previous arbitration.
+ * @param content View content
+ * @return The areas to which the view content is allocated.
+ *
+ * If the view content is not assigned to any area, nullptr is returned.
+ */
+ virtual const std::list<const RBAArea*> getPreArea(const RBAViewContent* content) const=0;
+
+ /**
+ * @brief Returns the zone to which the sound content state is allocated of the
+ * previous arbitration.
+ * @param content Sound content
+ * @return The zones to which the sound content is allocated.
+ *
+ * If the sound content is not assigned to any area, nullptr is returned.
+ */
+ virtual const std::list<const RBAZone*> getPreZone(const RBASoundContent* content) const=0;
+
+ /**
+ * @brief Returns the size of the area
+ * determined in the previous arbitration.
+ * @param area Area
+ * @return The size of the area.
+ */
+ virtual const RBASize* getPreSize(const RBAArea* area) const=0;
+
+ /**
+ * @brief Returns true if the scene is active
+ * of the previous arbitration.
+ * @param scene Reference scene to be checked.
+ * @return true: Active
+ * @return false: Not active
+ *
+ * The active scene is the scene requested to ON.
+ */
+ virtual bool isPreActive(const RBAScene* scene) const=0;
+
+ /**
+ * @brief Returns true if the view content is active
+ * of the previous arbitration.
+ * @param state Reference view content to be checked.
+ * @return true: Active
+ * @return false: Not active
+ *
+ * The active view content is the content requested to be displayed.
+ */
+ virtual bool isPreActive(const RBAViewContent* content) const=0;
+
+ /**
+ * @brief Returns true if the sound content is active
+ * of the previous arbitration.
+ * @param state Reference sound content to be checked.
+ * @return true: Active
+ * @return false: Not active
+ *
+ * The active sound content is the content requested to be outputted.
+ */
+ virtual bool isPreActive(const RBASoundContent* content) const=0;
+
+ /**
+ * @brief Returns true if the area is visible
+ * of the previous arbitration.
+ * @param area Reference area to be checked.
+ * @return true: Visible
+ * @return false: Not visible
+ */
+ virtual bool isPreVisible(const RBAArea* area) const=0;
+
+ /**
+ * @brief Returns true if the zone is sounding
+ * of the previous arbitration.
+ * @param zone Reference zone to be checked.
+ * @return true: Sounding
+ * @return false: Not sounding
+ */
+ virtual bool isPreSounding(const RBAZone* zone) const=0;
+
+ /**
+ * @brief Returns true if the view content state is visible
+ * of the previous arbitration.
+ * @param state Reference view content state to be checked.
+ * @return true: state is allocated to visible area.
+ * @return false: state is not allocated to visible area.
+ */
+ virtual bool isPreVisible(const RBAViewContentState* state) const=0;
+
+ /**
+ * @brief Returns true if the sound content state is sounding
+ * of the previous arbitration.
+ * @param state Reference sound content state to check.
+ * @return true: state is allocated to outputting zone.
+ * @return false: state is not allocated to outputting zone.
+ */
+ virtual bool isPreSounding(const RBASoundContentState* state) const=0;
+
+ /**
+ * @brief Returns the sounding sound content state assigned to the zone
+ * of the previous arbitration.
+ * @param zone Zone
+ * @return The sounding sound content state assign to the zone.
+ *
+ * When a zone is muted, Returns the content state.
+ * If no sounding sound content state is allocated the area,
+ * nullptr is returnd.
+ */
+ virtual const RBASoundContentState* getPreSoundContentState(const RBAZone* zone) const=0;
+
+ /**
+ * @brief Returns true if the area is hidden
+ * of the previous arbitration.
+ * @param area Reference area to be checked.
+ * @return true: Hidden
+ * @return false: Not hidden
+ */
+ virtual bool isPreHidden(const RBAArea* area) const=0;
+
+ /**
+ * @brief Returns true if the zone is muted of the previous arbitration.
+ * @param zone Reference zone to be checked.
+ * @return true: Muted
+ * @return false: Not muted
+ */
+ virtual bool isPreMute(const RBAZone* zone) const=0;
+
+ /**
+ * @brief Returns true if the zone is attenuated
+ * of the previous arbitration.
+ * @param zone Reference zone to be checked.
+ * @return true: Attenuated
+ * @return false: Not attenuated
+ */
+ virtual bool isPreAttenuated(const RBAZone* zone) const=0;
+
+ /**
+ * @brief Returns true if the view content state is canceled
+ * of the previous arbitration.
+ * @param state Reference view content state to be checked.
+ * @return true: Canceled
+ * @return false: Not canceled or Not request view content state
+ */
+ virtual bool isPreCancel(const RBAViewContentState* state) const=0;
+
+ /**
+ * @brief Returns true if the sound content state is canceled
+ * of the previous arbitration.
+ * @param state Reference view content state to be checked.
+ * @return true: Canceled
+ * @return false: Not canceled
+ */
+ virtual bool isPreCancel(const RBASoundContentState* state) const=0;
+
+ /**
+ * @brief Returns the log of the last arbitration.
+ * @return Log string
+ */
+ virtual std::string getLog() const=0;
+
+ /**
+ * @brief Returns displaying status
+ * @param display to be checked display
+ * @return true: something is displayed
+ * @return false: nothing is displayed
+ */
+ virtual bool hasDisplayingArea(const RBADisplay* display) const=0;
+ // }
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAResultStatusType.hpp b/src/include/rba/RBAResultStatusType.hpp
new file mode 100644
index 0000000..09c30d9
--- /dev/null
+++ b/src/include/rba/RBAResultStatusType.hpp
@@ -0,0 +1,42 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Result status type cluss
+ */
+
+#ifndef RBARESULTSTATUSTYPE_HPP
+#define RBARESULTSTATUSTYPE_HPP
+
+namespace rba
+{
+
+/**
+ * @enum RBAResultStatusType
+ * Status of the arbitration result.
+ */
+enum class RBAResultStatusType : std::uint8_t
+{
+ /**
+ * @brief Success
+ */
+ SUCCESS,
+
+ /**
+ * @brief Failed
+ */
+ FAILED,
+
+ /**
+ * @brief Unknown context or content state
+ */
+ UNKNOWN_CONTENT_STATE,
+
+ /**
+ * @brief Cancel arbitration error
+ */
+ CANCEL_ERROR
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAScene.hpp b/src/include/rba/RBAScene.hpp
new file mode 100644
index 0000000..5bb1e66
--- /dev/null
+++ b/src/include/rba/RBAScene.hpp
@@ -0,0 +1,74 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Scene class
+ */
+
+#ifndef RBASCENE_HPP
+#define RBASCENE_HPP
+
+#include <cstdint>
+#include <list>
+#include <string>
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+namespace rba
+{
+
+/**
+ * @class RBAScene
+ * Express the state(Including system state) at that time comprehensively.<br>
+ * Used scene for switch area/zone and view/sound content state.
+ * And plural RBA model(project) can share arbitration result by definitions global scene.
+ */
+class RBAScene
+{
+protected:
+ RBAScene()=default;
+ RBAScene(const RBAScene&)=delete;
+ RBAScene(RBAScene&&)=delete;
+ RBAScene& operator=(const RBAScene&)=delete;
+ RBAScene& operator=(RBAScene&&)=delete;
+
+public:
+ virtual ~RBAScene()=default;
+
+public:
+ /**
+ * @brief Returns the scene name
+ * @return Scene name
+ */
+ virtual std::string getName() const=0;
+
+ /**
+ * @brief Returns the global scene status.
+ * @return global scene status.
+ */
+ virtual bool isGlobal() const=0;
+
+ /**
+ * @brief Returns List of the scene property name.
+ * @return List of the scene property name
+ */
+ virtual const std::list<std::string>& getPropertyNames() const=0;
+
+ /**
+ * @brief Returns Default value of the scene property.
+ * @param propertyName Scene property name
+ * @return Default value of the scene property
+ */
+ virtual std::int32_t getPropertyValue(const std::string& propertyName) const=0;
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBASize.hpp b/src/include/rba/RBASize.hpp
new file mode 100644
index 0000000..84c9ba7
--- /dev/null
+++ b/src/include/rba/RBASize.hpp
@@ -0,0 +1,74 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Size class
+ */
+
+#ifndef RBASIZE_HPP
+#define RBASIZE_HPP
+
+#include <string>
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+namespace rba
+{
+
+/**
+ * @class RBASize
+ * Size definitions for object such as areas or view contents.<br>
+ * Each object can define plural size.
+ * Can refer to size from object.
+ */
+class DLL_EXPORT RBASize
+{
+protected:
+ RBASize()=default;
+ RBASize(const RBASize&)=delete;
+ RBASize(RBASize&&)=delete;
+ RBASize& operator=(const RBASize&)=delete;
+ RBASize& operator=(RBASize&&)=delete;
+ ~RBASize()=default;
+
+public:
+ /**
+ * @brief Returns the name of the size.
+ * @return Size name
+ */
+ virtual std::string getName() const=0;
+
+ /**
+ * @brief Returns the width of the size.
+ * @return Width of the size
+ */
+ virtual std::int32_t getWidth() const=0;
+
+ /**
+ * @brief Returns the height of the size.
+ * @return Height of the size
+ */
+ virtual std::int32_t getHeight() const=0;
+
+public:
+ /**
+ * @brief Default width of size
+ */
+ const static std::int32_t WIDTH_EDEFAULT = 0;
+
+ /**
+ * @brief Default height of size
+ */
+ const static std::int32_t HEIGHT_EDEFAULT = 0;
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBASoundContent.hpp b/src/include/rba/RBASoundContent.hpp
new file mode 100644
index 0000000..336b462
--- /dev/null
+++ b/src/include/rba/RBASoundContent.hpp
@@ -0,0 +1,83 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Sound content class
+ */
+
+#ifndef RBASOUNDCONTENT_HPP
+#define RBASOUNDCONTENT_HPP
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+#include <list>
+#include <string>
+#include "RBAContentLoserType.hpp"
+
+namespace rba
+{
+
+class RBASoundContentState;
+class RBAZone;
+
+/**
+ * @class RBASoundContent
+ * Define the object of sound content.<br>
+ * Sound content has plural status.
+ * When sound contents connected to a zone, active status is output.
+ * Object has zone definitions, that can output itself.
+ * Each object can define plural zone which can output sound contents.
+ */
+class DLL_EXPORT RBASoundContent
+{
+protected:
+ RBASoundContent()=default;
+ RBASoundContent(const RBASoundContent&)=delete;
+ RBASoundContent(RBASoundContent&&)=delete;
+ RBASoundContent& operator=(const RBASoundContent&)=delete;
+ RBASoundContent& operator=(RBASoundContent&&)=delete;
+ ~RBASoundContent()=default;
+
+public:
+ /**
+ * @brief Returns the name of the sound content.
+ * @return Sound content name
+ */
+ virtual std::string getName() const=0;
+
+ /**
+ * @brief Returns the state of the sound content.
+ * @return List of the sound content state
+ */
+ virtual const std::list<const RBASoundContentState*>& getContentStates() const=0;
+
+ /**
+ * @brief Returns the zone of the sound content.
+ * @return List of the zone
+ */
+ virtual const std::list<const RBAZone*>& getZones() const=0;
+
+ /**
+ * @brief Returns the loser type.
+ * @return Loser type
+ */
+ virtual RBAContentLoserType getLoserType() const=0;
+
+public:
+ /**
+ * @brief Defines the default loser type.
+ */
+ const static RBAContentLoserType LOSER_TYPE_EDEFAULT =
+ RBAContentLoserType::NEVER_GIVEUP;
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBASoundContentState.hpp b/src/include/rba/RBASoundContentState.hpp
new file mode 100644
index 0000000..fdd22f5
--- /dev/null
+++ b/src/include/rba/RBASoundContentState.hpp
@@ -0,0 +1,119 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Sound content state class
+ */
+
+#ifndef RBASOUNDCONTENTSTATE_HPP
+#define RBASOUNDCONTENTSTATE_HPP
+
+#include <string>
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+namespace rba
+{
+
+class RBASoundContent;
+
+/**
+ * @class RBASoundContentState
+ * Define the state of sound contents.
+ */
+class DLL_EXPORT RBASoundContentState
+{
+protected:
+ RBASoundContentState()=default;
+ RBASoundContentState(const RBASoundContentState&)=delete;
+ RBASoundContentState(RBASoundContentState&&)=delete;
+ RBASoundContentState& operator=(const RBASoundContentState&)=delete;
+ RBASoundContentState& operator=(RBASoundContentState&&)=delete;
+ ~RBASoundContentState()=default;音声コンテントクラス
+
+public:
+ /**
+ * @brief Returns the name of the sound contents state.
+ * @return sound contents state name.
+ */
+ virtual std::string getName() const=0;
+
+ /**
+ * @brief Returns the priority.
+ * @return priority value
+ */
+ virtual std::int32_t getPriority() const=0;
+
+ /**
+ * @brief Returns the sound content.
+ * @return sound content
+ */
+ virtual const RBASoundContent* getOwner() const=0;
+
+ /**
+ * @brief Returns the order.
+ * @return order value
+ * @detail The order is a number of sequence of the entry sound content state
+ * by request. The order value is an integer value starting from 1 and
+ * incremented in order, and the order value of the sound content state
+ * without sound request is set to 0.\n
+ * The order of the sound content state does not include the output request
+ * of the view content state.
+ */
+ virtual std::int32_t getOrder() con音声コンテントクラスst=0;
+
+ /**
+ * @brief Returns the unique character string of the sound contents state.
+ * @return Unique character string of the sound contents state.
+ *
+ * Unique character string is
+ * sound content name + CONTEXT_SEPARATER + sound content state name.
+ * Use the unique character string as a context name.
+ */
+ virtual std::string getUniqueName() const=0;
+
+ /**
+ * @brief Returns the name of the sound content from context name.
+ * @param context the context name
+ * @return name of the sound content
+ */
+ static std::string getContentNameByContext(const std::string& context);
+
+ /**
+ * @brief Returns the state of the sound content from context name.
+ * @param context the context name
+ * @return state of the sound content
+ */
+ static std::string getContentStateNameByContext(const std::string& context);
+
+ /**
+ * @brief Check if argument is The unique character string(context name).
+ * @param context the context name
+ * @return true: unique character string(context name)
+ * @return false: Not unique character string(context name)
+ */
+ static bool isUniqueName(const std::string& context);
+
+public:
+ /**
+ * @brief Defines the default priority value.
+ */
+ const static std::int32_t PRIORITY_EDEFAULT = 0;
+
+ /**
+ * @brief Defines the separator for separating sound content name and sound content state name.
+ * And be the character to connect it.
+ */
+ const static char CONTEXT_SEPARATER = '/';
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAViewAction.hpp b/src/include/rba/RBAViewAction.hpp
new file mode 100644
index 0000000..5d09c39
--- /dev/null
+++ b/src/include/rba/RBAViewAction.hpp
@@ -0,0 +1,147 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * VIew action class
+ */
+
+#ifndef RBAVIEWACTION_HPP
+#define RBAVIEWACTION_HPP
+
+#include "RBAViewActionType.hpp"
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+namespace rba {
+
+class RBAArea;
+class RBAViewContent;
+class RBAViewContentState;
+
+/**
+ * @class RBAViewAction
+ * Define the change information of view contents.<br>
+ * Change information has 2 type.
+ * The contents transition, that view contents change for an area.
+ * The contents move, that the view content displayed area changes.
+ */
+class DLL_EXPORT RBAViewAction
+{
+public:
+ RBAViewAction()=default;
+ RBAViewAction(RBAViewAction&&)=delete;
+ RBAViewAction& operator=(const RBAViewAction&)=delete;
+ RBAViewAction& operator=(RBAViewAction&&)=delete;
+ virtual ~RBAViewAction()=default;
+
+protected:
+ // Copy constructor is defined in default because it is used in another class
+ RBAViewAction(const RBAViewAction&)=default;
+
+public:
+ /**
+ * @brief Returns the area of the contents transition.
+ * @return Area of the contents transition
+ */
+ virtual const RBAArea* getArea() const;
+
+ /**
+ * @brief Returns previously displayed the view content.
+ * Used when change information type is the contents transition(TRANSITION_REPLACE).
+ * @return Previously displayed the view content
+ *
+ * * If the change information type is not the contents transition(TRANSITION_REPLACE), returns nullptr.
+ */
+ virtual const RBAViewContent* getFromContent() const;
+
+ /**
+ * @brief Returns subsequently displayed the view content.
+ * Used when change information type is the contents transition(TRANSITION_REPLACE).
+ * @return Subsequently displayed the view content.
+ *
+ * * If the change information type is not the contents transition(TRANSITION_REPLACE), returns nullptr.
+ */
+ virtual const RBAViewContent* getToContent() const;
+
+ /**
+ * @brief Returns previously displayed the view content state.
+ * Used when change information type is the contents transition(TRANSITION_REPLACE).
+ * @return Previously displayed the view content state
+ *
+ * * If the change information type is not the contents transition(TRANSITION_REPLACE), returns nullptr.
+ */
+ virtual const RBAViewContentState* getFromContentState() const;
+
+ /**
+ * @brief Returns subsequently displayed the view content state.
+ * Used when change information type is the contents transition(TRANSITION_REPLACE).
+ * @return Subsequently displayed the view content state.
+ *
+ * * If the change information type is not the contents transition(TRANSITION_REPLACE), returns nullptr.
+ */
+ virtual const RBAViewContentState* getToContentState() const;
+
+ /**
+ * @brief Returns previously displayed the area.
+ * Used when change information type is the contents move(MOVE).
+ * @return Previously displayed the area
+ *
+ * * If the change information type is not the contents move(MOVE), returns nullptr.
+ */
+ virtual const RBAArea* getFromArea() const;
+
+ /**
+ * @brief Returns subsequently displayed the area.
+ * Used when change information type is the contents move(MOVE).
+ * @return Subsequently displayed the area
+ *
+ * * If the change information type is not the contents move(MOVE), returns nullptr.
+ */
+ virtual const RBAArea* getToArea() const;
+
+ /**
+ * @brief Returns view content of change information.
+ * @return View content of change information
+ *
+ * * If getViewActionType() == TRANSITION_ADD, returns display view content.
+ * * If getViewActionType() == TRANSITION_REMOVE, returns hide view content.
+ * * If getViewActionType() == TRANSITION_REPLACE, returns nullptr.
+ * * If getViewActionType() == MOVE, returns view content which changes the area.
+ */
+ virtual const RBAViewContent* getContent() const;
+
+ /**
+ * @brief Returns view content state of change information.
+ * @return View content state of change information
+ *
+ * * If getViewActionType() == TRANSITION_ADD, returns display view content state.
+ * * If getViewActionType() == TRANSITION_REMOVE, returns hide view content state.
+ * * If getViewActionType() == TRANSITION_REPLACE, returns nullptr.
+ * * If getViewActionType() == MOVE, returns view content state which changes the area.
+ */
+ virtual const RBAViewContentState* getContentState() const;
+
+ /**
+ * @brief Returns view action type.
+ * @return View action type
+ */
+ virtual RBAViewActionType getViewActionType() const=0;
+
+ /**
+ * @brief Equal operator
+ * @return true: equal
+ * @return false: not equal
+ */
+ virtual bool operator==(const RBAViewAction& viewAction)=0;
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAViewActionType.hpp b/src/include/rba/RBAViewActionType.hpp
new file mode 100644
index 0000000..6d1f56d
--- /dev/null
+++ b/src/include/rba/RBAViewActionType.hpp
@@ -0,0 +1,41 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * View action type class
+ */
+
+#ifndef RBAVIEWACTIONTYPE_HPP
+#define RBAVIEWACTIONTYPE_HPP
+
+namespace rba
+{
+
+/**
+ * @enum RBAViewActionType
+ * type of view action
+ */
+enum class RBAViewActionType : std::uint8_t
+{
+ /**
+ * @brief The content transition(ADD) : content is displayed in the area.
+ */
+ TRANSITION_ADD,
+
+ /**
+ * @brief The content transition(REMOVE) : content is deleted from the area.
+ */
+ TRANSITION_REMOVE,
+
+ /**
+ * @brief The content transition(REPLACE) : content is replaced on the area.
+ */
+ TRANSITION_REPLACE,
+
+ /**
+ * @brief The content move(MOVE) : The display of content changes to another area.
+ */
+ MOVE
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAViewContent.hpp b/src/include/rba/RBAViewContent.hpp
new file mode 100644
index 0000000..e5847e9
--- /dev/null
+++ b/src/include/rba/RBAViewContent.hpp
@@ -0,0 +1,89 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * View content class
+ */
+
+#ifndef RBAVIEWCONTENT_HPP
+#define RBAVIEWCONTENT_HPP
+
+#include <list>
+#include <string>
+#include "RBAContentLoserType.hpp"
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+namespace rba
+{
+
+class RBAViewContentState;
+class RBAArea;
+class RBASize;
+
+/**
+ * @class RBAViewContent
+ * Define the object of view content.<br>
+ * View content has plural status.
+ * When view contents connected to a area, active status is displayed.
+ * Each object can define plural area which can displayed view contents.
+ */
+class DLL_EXPORT RBAViewContent
+{
+protected:
+ RBAViewContent()=default;
+ RBAViewContent(const RBAViewContent&)=delete;
+ RBAViewContent(RBAViewContent&&)=delete;
+ RBAViewContent& operator=(const RBAViewContent&)=delete;
+ RBAViewContent& operator=(RBAViewContent&&)=delete;
+ ~RBAViewContent()=default;
+
+public:
+ /**
+ * @brief Returns the name of the view content.
+ * @return View content name
+ */
+ virtual std::string getName() const=0;
+
+ /**
+ * @brief Returns the state of the view content.
+ * @return List of view content state
+ */
+ virtual const std::list<const RBAViewContentState*>& getContentStates() const=0;
+
+ /**
+ * @brief Returns the area of the view content.
+ * @return List of the area
+ */
+ virtual const std::list<const RBAArea*>& getAreas() const=0;
+
+ /**
+ * @brief Returns the list of size assignment to this content.
+ * @return List of size
+ */
+ virtual const std::list<const RBASize*>& getSizes() const=0;
+
+ /**
+ * @brief Returns the loser type.
+ * @return Loser type
+ */
+ virtual RBAContentLoserType getLoserType() const=0;
+
+public:
+ /**
+ * @brief Defines the default loser type.
+ */
+ const static RBAContentLoserType LOSER_TYPE_EDEFAULT =
+ RBAContentLoserType::NEVER_GIVEUP;
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAViewContentState.hpp b/src/include/rba/RBAViewContentState.hpp
new file mode 100644
index 0000000..be15d02
--- /dev/null
+++ b/src/include/rba/RBAViewContentState.hpp
@@ -0,0 +1,119 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * VIew content state class
+ */
+
+#ifndef RBAVIEWCONTENTSTATE_HPP
+#define RBAVIEWCONTENTSTATE_HPP
+
+#include <string>
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+namespace rba
+{
+
+class RBAViewContent;
+
+/**
+ * @class RBAViewContentState
+ * Define the state of view contents.
+ */
+class DLL_EXPORT RBAViewContentState
+{
+protected:
+ RBAViewContentState()=default;
+ RBAViewContentState(const RBAViewContentState&)=delete;
+ RBAViewContentState(RBAViewContentState&&)=delete;
+ RBAViewContentState& operator=(const RBAViewContentState&)=delete;
+ RBAViewContentState& operator=(RBAViewContentState&&)=delete;
+ ~RBAViewContentState()=default;
+
+public:
+ /**
+ * @brief Returns the name of the view contents state.
+ * @return view contents state name.
+ */
+ virtual std::string getName() const=0;
+
+ /**
+ * @brief Returns the priority.
+ * @return priority value
+ */
+ virtual std::int32_t getPriority() const=0;
+
+ /**
+ * @brief Returns the view content.
+ * @return view content
+ */
+ virtual const RBAViewContent* getOwner() const=0;
+
+ /**
+ * @brief Returns the order.
+ * @return order value
+ * @detail The order is a number of sequence of the entry view content state
+ * by request. The order value is an integer value starting from 1 and
+ * incremented in order, and the order value of the view content state
+ * without view request is set to 0.\n
+ * The order of the view content state does not include the output request
+ * of the sound content state.
+ */
+ virtual std::int32_t getOrder() const=0;
+
+ /**
+ * @brief Returns the unique character string of the view contents state.
+ * @return Unique character string of the view contents state.
+ *
+ * Unique character string is
+ * view content name + CONTEXT_SEPARATER + view content state name.
+ * Use the unique character string as a context name.
+ */
+ virtual std::string getUniqueName() const=0;
+
+ /**
+ * @brief Returns the name of the view content from context name.
+ * @param context the context name
+ * @return name of the view content
+ */
+ static std::string getContentNameByContext(const std::string& context);
+
+ /**
+ * @brief Returns the state of the view content from context name.
+ * @param context the context name
+ * @return state of the view content
+ */
+ static std::string getContentStateNameByContext(const std::string& context);
+
+ /**
+ * @brief Check if argument is The unique character string(context name).
+ * @param context the context name
+ * @return true: unique character string(context name)
+ * @return false: Not unique character string(context name)
+ */
+ static bool isUniqueName(const std::string& context);
+
+public:
+ /**
+ * @brief Defines the default priority value.
+ */
+ const static std::int32_t PRIORITY_EDEFAULT = 0;
+
+ /**
+ * @brief Defines the separator for separating view content name and view content state name.
+ * And be the character to connect it.
+ */
+ const static char CONTEXT_SEPARATER = '/';
+
+};
+
+}
+
+#endif
diff --git a/src/include/rba/RBAZone.hpp b/src/include/rba/RBAZone.hpp
new file mode 100644
index 0000000..2bf613c
--- /dev/null
+++ b/src/include/rba/RBAZone.hpp
@@ -0,0 +1,72 @@
+// Copyright (c) 2018 DENSO CORPORATION. All rights reserved.
+/**
+ * Zone class
+ */
+
+#ifndef RBAZONE_HPP
+#define RBAZONE_HPP
+
+#ifdef _MSC_VER
+#ifdef _WINDLL
+#define DLL_EXPORT __declspec(dllexport)
+#else
+#define DLL_EXPORT __declspec(dllimport)
+#endif
+#else
+#define DLL_EXPORT
+#endif
+
+#include <list>
+#include <string>
+#include "RBAArbitrationPolicy.hpp"
+
+namespace rba
+{
+
+class RBASoundContent;
+
+/**
+ * @class RBAZone
+ * Defines a Frame for outputting sound content.<br>
+ * At run time, at most one sound content is allocated to one zone.
+ * This class has arbitration policy definitions, because it is executed for each zone.
+ */
+class DLL_EXPORT RBAZone
+{
+protected:
+ RBAZone()=default;
+ RBAZone(const RBAZone&)=delete;
+ RBAZone(RBAZone&&)=delete;
+ RBAZone& operator=(const RBAZone&)=delete;
+ RBAZone& operator=(RBAZone&&)=delete;
+ ~RBAZone()=default;
+
+public:
+ /**
+ * @brief Returns the name of the zone.
+ * @return Zone name
+ */
+ virtual std::string getName() const=0;
+
+ /**
+ * @brief Returns the priority.
+ * @return Priority value
+ */
+ virtual std::int32_t getPriority() const=0;
+
+ /**
+ * @brief Returns the list of content which can be output in this zone.
+ * @return List of content
+ */
+ virtual const std::list<const RBASoundContent*>& getContents() const=0;
+
+ /**
+ * @brief Returns the arbitration policy value defined to this zone.
+ * @return arbitration policy value
+ */
+ virtual RBAArbitrationPolicy getArbitrationPolicy() const=0;
+};
+
+}
+
+#endif
diff --git a/src/lib/.gitkeep b/src/lib/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/lib/.gitkeep
diff --git a/src/log/RBACoverageLog.cpp b/src/log/RBACoverageLog.cpp
new file mode 100644
index 0000000..ca64f14
--- /dev/null
+++ b/src/log/RBACoverageLog.cpp
@@ -0,0 +1,357 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Coverage Log class definition file
+ */
+
+#include <algorithm>
+#include <sstream>
+#include "RBACoverageLog.hpp"
+
+#include "RBAExpression.hpp"
+#include "RBALog.hpp"
+#include "RBAAbstractConstraint.hpp"
+#include "RBAConstraintImpl.hpp"
+#include "RBAILogCollector.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+#ifdef RBA_USE_LOG
+const std::string RBACoverageLog::SEP = ",";
+const std::string RBACoverageLog::EXP_SEP = "\t";
+const std::string RBACoverageLog::START = "START";
+const std::string RBACoverageLog::END = "END";
+const std::string RBACoverageLog::EXPRESSION = "EXPRESSION";
+const std::string RBACoverageLog::CONSTRAINT = "Constraint";
+const std::string RBACoverageLog::RULE = "Rule";
+
+/**
+ * Add request log in one line
+ *
+ * @param message log message
+ */
+void
+RBACoverageLog::addRequestLogLine(const std::string& message)
+{
+ notify("#Request#" + message);
+}
+
+/**
+ * Add allocate setting log in one line
+ *
+ * @param message log
+ */
+void
+RBACoverageLog::addPrevResultLogLine(const std::string& message)
+{
+ notify("#PrevResult#" + message);
+}
+
+/**
+ * Add result log in one line
+ *
+ * @param message
+ */
+void
+RBACoverageLog::addResultLogLine(const std::string& message)
+{
+ notify("#Result#" + message);
+}
+
+void
+RBACoverageLog::addStartLogLine(const std::string& log)
+{
+ notify(log);
+}
+
+void
+RBACoverageLog::addCoverageLogCollector(RBAILogCollector* collector)
+{
+ collectors_.insert(collector);
+}
+
+void
+RBACoverageLog::removeCoverageLogCollector(RBAILogCollector* collector)
+{
+ auto it = std::find(collectors_.begin(), collectors_.end(), collector);
+ if(it != collectors_.end()) {
+ collectors_.erase(it);
+ }
+}
+
+/**
+ * Add "Constraint" log in one line
+ *
+ * @param message
+ */
+void
+RBACoverageLog::addConstraintLogLine(const std::string& message)
+{
+ notify("#Constraint#" + message);
+}
+
+/**
+ * Add "Constraint" start log
+ *
+ * @param constraint
+ */
+void
+RBACoverageLog::addConstraintStartLog(const RBAAbstractConstraint* element)
+{
+ std::string isRuntime = "t";
+ std::string eleName = element->getElementName();
+ if(element->isConstraint()) {
+ const RBAConstraintImpl* constraint
+ = dynamic_cast<const RBAConstraintImpl*>(element);
+ if(!constraint->isRuntime()) {
+ isRuntime = "f";
+ }
+ }
+ addConstraintLogLine(START + SEP + eleName + SEP + isRuntime);
+}
+
+/**
+ * Add "Constraint" finish log
+ *
+ * @param constraint
+ */
+void
+RBACoverageLog::addConstraintEndLog(const RBAAbstractConstraint* element)
+{
+ addConstraintLogLine(END);
+}
+
+/**
+ * Add "Constraint expression" execution log
+ *
+ * @param expressionText
+ * @param result
+ */
+void
+RBACoverageLog::addConstraintExpressionLog(
+ const std::string& expressionText, RBAExecuteResult result)
+{
+ std::string resultMsg;
+ if (RBAExecuteResult::TRUE == result) {
+ resultMsg = "t";
+ } else if (RBAExecuteResult::FALSE == result) {
+ resultMsg = "f";
+ } else if (RBAExecuteResult::EXE == result) {
+ resultMsg = "e";
+ } else if (RBAExecuteResult::NOTEXE == result) {
+ resultMsg = "ne";
+ } else {
+ resultMsg = "skip";
+ }
+ addConstraintLogLine(
+ EXPRESSION + EXP_SEP + getHierarchy() + EXP_SEP + expressionText + EXP_SEP
+ + resultMsg);
+}
+
+/**
+ * Add "Constraint expression" execution log (For Action)
+ *
+ * @param expressionText
+ */
+void
+RBACoverageLog::addConstraintExpressionLog(const std::string& expressionText)
+{
+ addConstraintLogLine(EXPRESSION + EXP_SEP +
+ getHierarchy() + EXP_SEP +
+ expressionText);
+}
+
+/**
+ * Add request cancellation log in one line
+ *
+ * @param message
+ */
+void
+RBACoverageLog::addCanceledRequestLogLine(const std::string& message)
+{
+ notify("#CanceledRequest#" + message);
+}
+
+/**
+ * Add constraint structure log in one line
+ *
+ * @param message
+ */
+void
+RBACoverageLog::addHierarchyOfConstraintLogLine(const std::string& message)
+{
+ notify("#HierarchyOfConstraint#" + message);
+}
+
+/**
+ * Add constraint structure start log in one line
+ *
+ * @param message
+ */
+void
+
+RBACoverageLog::
+addHierarchyOfConstraintStartLog(const RBAAbstractConstraint* element)
+{
+ std::string isRuntime = "t";
+ std::string type = CONSTRAINT;
+ std::string eleName = element->getElementName();
+ if(element->isConstraint()) {
+ const RBAConstraintImpl* constraint
+ = dynamic_cast<const RBAConstraintImpl*>(element);
+ if(!constraint->isRuntime()) {
+ isRuntime = "f";
+ }
+ }
+ else if(element->isRule()) {
+ type = RULE;
+ }
+ addHierarchyOfConstraintLogLine(START + SEP +
+ eleName + SEP +
+ isRuntime + SEP + type);
+}
+
+/**
+ * Add constraint structure finish log
+ *
+ * @param constraint
+ */
+void
+RBACoverageLog::addHierarchyOfConstraintEndLog(const RBAAbstractConstraint* element)
+{
+ std::string eleName = element->getElementName();
+ addHierarchyOfConstraintLogLine(END + SEP + eleName);
+}
+
+/**
+ * Add constraint structure execution log
+ *
+ * @param expressionText
+ * @param result
+ */
+void
+RBACoverageLog::
+addHierarchyOfConstraintExpressionLog(const std::string& expressionText,
+ const RBAExpression* expression)
+{
+ addHierarchyOfConstraintLogLine(EXPRESSION + EXP_SEP +
+ getHierarchy() + EXP_SEP +
+ expressionText + EXP_SEP +
+ getExpressionType(expression));
+}
+
+// ---------------------------------------------------------
+// Hierarchical information of constraint log for coverage
+// ---------------------------------------------------------
+
+/**
+ * Initialize the constraint hierarchy
+ */
+void
+RBACoverageLog::initConstraintHierarchy()
+{
+ hierarchys_.clear();
+}
+
+/**
+ * Returns the constraint hierarchy as a string
+ *
+ * @return
+ */
+std::string
+RBACoverageLog::getHierarchy() const
+{
+ std::ostringstream oss;
+
+ std::string pre;
+ int32_t i=0;
+ for(std::string now : hierarchys_) {
+ if((i != 0) && (pre[0] != '#')) {
+ // If it is the first time and it is not treated as multiple operators,
+ // add split identifier
+ oss << "#";
+ }
+ pre = now;
+ if(now[0] == '#') {
+ now = now.substr(1, now.length());
+ }
+ oss << now;
+ i++;
+ }
+
+ return oss.str();
+}
+
+/**
+ * Add constraint hierarchy
+ *
+ * @param data
+ * @return
+ */
+bool
+RBACoverageLog::addHierarchy(const std::string& data)
+{
+ hierarchys_.push_back(data);
+ return true;
+}
+
+/**
+ * Remove constraint hierarchy
+ *
+ * @param data
+ * @return
+ */
+void
+RBACoverageLog::removeHierarchy()
+{
+ hierarchys_.pop_back();
+}
+
+/**
+ * Returns the type string of the expression
+ * to be output to the hierarchical log
+ *
+ * @param expression
+ * @return
+ */
+std::string
+RBACoverageLog::getExpressionType(const RBAExpression* expression) const
+{
+ switch(expression->getUnderlyingType()) {
+ case RBAExpressionType::BOOLEAN:
+ return "boolean";
+ case RBAExpressionType::ACTION:
+ case RBAExpressionType::SET_OF_ACTION:
+ return "action";
+ default:
+ return "unknown";
+ }
+}
+
+void
+RBACoverageLog::notify(const std::string& log)
+{
+ for(RBAILogCollector* collector : collectors_) {
+ collector->log(log);
+ }
+}
+#endif
+
+}
diff --git a/src/log/RBACoverageLog.hpp b/src/log/RBACoverageLog.hpp
new file mode 100644
index 0000000..11e3695
--- /dev/null
+++ b/src/log/RBACoverageLog.hpp
@@ -0,0 +1,118 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Coverage Log class
+ */
+
+#ifndef RBACOVERAGELOG_HPP
+#define RBACOVERAGELOG_HPP
+
+#include <vector>
+#include <set>
+#include "RBAILogCollector.hpp"
+#include "RBAExecuteResult.hpp"
+
+namespace rba
+{
+
+#ifdef RBA_USE_LOG
+class RBALog;
+class RBAExpression;
+class RBAAbstractConstraint;
+
+class DLL_EXPORT RBACoverageLog
+{
+public:
+ RBACoverageLog()=default;
+ RBACoverageLog(const RBACoverageLog&)=delete;
+ RBACoverageLog(const RBACoverageLog&&)=delete;
+ RBACoverageLog& operator=(const RBACoverageLog&)=delete;
+ RBACoverageLog& operator=(const RBACoverageLog&&)=delete;
+ virtual ~RBACoverageLog()=default;
+
+public:
+ void addRequestLogLine(const std::string& message);
+ void addPrevResultLogLine(const std::string& message);
+ void addResultLogLine(const std::string& message);
+ void addStartLogLine(const std::string& log);
+ void addCoverageLogCollector(RBAILogCollector* collector);
+ void removeCoverageLogCollector(RBAILogCollector* collector);
+ void addConstraintLogLine(const std::string& message);
+ void addConstraintStartLog(const RBAAbstractConstraint* element);
+ void addConstraintEndLog(const RBAAbstractConstraint* element);
+ void addConstraintExpressionLog(const std::string& expressionText,
+ const RBAExecuteResult result);
+ void addConstraintExpressionLog(const std::string& expressionText);
+ void addCanceledRequestLogLine(const std::string& message);
+ void addHierarchyOfConstraintLogLine(const std::string& message);
+ void addHierarchyOfConstraintStartLog(const RBAAbstractConstraint* element);
+ void addHierarchyOfConstraintEndLog(const RBAAbstractConstraint* element);
+ void addHierarchyOfConstraintExpressionLog(const std::string& expressionText,
+ const RBAExpression* expression);
+ void initConstraintHierarchy();
+ std::string getHierarchy() const;
+ bool addHierarchy(const std::string& data);
+ void removeHierarchy();
+ std::string getExpressionType(const RBAExpression* expression) const;
+
+public:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ // Delimiters other than constraint expression lines
+ const static std::string SEP;
+ // Delimiters of constraint expression line (Tab)
+ const static std::string EXP_SEP;
+ const static std::string START;
+ const static std::string END;
+ const static std::string EXPRESSION;
+ const static std::string CONSTRAINT;
+ const static std::string RULE;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+private:
+ std::string createLog(std::vector<RBALog*> logs);
+ void notify(const std::string& log);
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::vector<std::string> hierarchys_; // Constraint hierarchy (x#y#z format)
+ std::set<RBAILogCollector*> collectors_;
+ std::vector<RBALog*> requestLogs_;
+ std::vector<RBALog*> resultLogs_;
+ std::vector<RBALog*> constraintLogs;
+ std::vector<RBALog*> canceledRequestLogs_;
+
+  // Constraint structure log for finding the denominator of
+ // constraint coverage. The constraint log is different
+ // because it also has the execution result.
+ std::vector<RBALog*> hierarchyOfConstraintLogs_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+#endif
+
+}
+#endif
diff --git a/src/log/RBAILogCollector.cpp b/src/log/RBAILogCollector.cpp
new file mode 100644
index 0000000..d9765f0
--- /dev/null
+++ b/src/log/RBAILogCollector.cpp
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * Log collector interface class definition file
+ */
+
+#include "RBAILogCollector.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/log/RBAILogCollector.hpp b/src/log/RBAILogCollector.hpp
new file mode 100644
index 0000000..b873912
--- /dev/null
+++ b/src/log/RBAILogCollector.hpp
@@ -0,0 +1,47 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ /**
+ * Log collector interface class
+ */
+
+#ifndef RBAILOGCOLLECTOR_HPP
+#define RBAILOGCOLLECTOR_HPP
+
+#include <string>
+#include "RBADllExport.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAILogCollector
+{
+protected:
+ RBAILogCollector()=default;
+ RBAILogCollector(const RBAILogCollector&)=delete;
+ RBAILogCollector(const RBAILogCollector&&)=delete;
+ RBAILogCollector& operator=(const RBAILogCollector&)=delete;
+ RBAILogCollector& operator=(const RBAILogCollector&&)=delete;
+ virtual ~RBAILogCollector()=default;
+
+public:
+ virtual void log(const std::string& logLine)=0;
+
+};
+
+}
+
+#endif
diff --git a/src/log/RBALog.cpp b/src/log/RBALog.cpp
new file mode 100644
index 0000000..917ee57
--- /dev/null
+++ b/src/log/RBALog.cpp
@@ -0,0 +1,43 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Log class definition file
+ */
+
+#include "RBALog.hpp"
+
+namespace rba {
+
+RBALog::RBALog(const std::int32_t level, const std::string& log)
+ : level_{level}
+ , log_{log}
+{
+}
+
+int32_t
+RBALog::getLevel() const
+{
+ return level_;
+}
+
+const std::string&
+RBALog::getLog() const
+{
+ return log_;
+}
+
+}
diff --git a/src/log/RBALog.hpp b/src/log/RBALog.hpp
new file mode 100644
index 0000000..d0d44ee
--- /dev/null
+++ b/src/log/RBALog.hpp
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Log class
+ */
+
+#ifndef RBALOG_HPP
+#define RBALOG_HPP
+
+#include <string>
+
+namespace rba
+{
+
+class RBALog
+{
+public:
+ RBALog(const std::int32_t level, const std::string& log);
+ RBALog(const RBALog&)=delete;
+ RBALog(const RBALog&&)=delete;
+ RBALog& operator=(const RBALog&)=delete;
+ RBALog& operator=(const RBALog&&)=delete;
+ virtual ~RBALog()=default;
+
+public:
+ int32_t getLevel() const;
+ const std::string& getLog() const;
+
+private:
+ int32_t level_;
+ std::string log_;
+
+};
+
+}
+
+#endif
diff --git a/src/log/RBALogManager.cpp b/src/log/RBALogManager.cpp
new file mode 100644
index 0000000..cb1bd83
--- /dev/null
+++ b/src/log/RBALogManager.cpp
@@ -0,0 +1,863 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Log manager class definition file
+ */
+
+#include <sstream>
+#include <bitset>
+#include "RBALogManager.hpp"
+#include "RBALog.hpp"
+
+namespace rba
+{
+
+#ifdef RBA_USE_LOG
+RBALogManager* RBALogManager::instance_=nullptr;
+
+const std::string RBALogManager::STR_TRUE = "true";
+const std::string RBALogManager::STR_FALSE = "false";
+std::string RBALogManager::indent_ = "";
+
+RBALogManager::RBALogManager()
+{
+}
+
+//
+// Static method
+//
+
+void
+RBALogManager::setLogManager(RBALogManager* logManager)
+{
+ instance_ = logManager;
+}
+
+RBALogManager*
+RBALogManager::getLogManager()
+{
+ return instance_;
+}
+
+void
+RBALogManager::setType(std::uint16_t logType)
+{
+ if(instance_) {
+ instance_->setTypeImpl(logType);
+ }
+}
+
+void
+RBALogManager::setEnable(std::uint16_t logType, bool sw)
+{
+ if(instance_) {
+ instance_->setEnableImpl(logType, sw);
+ }
+}
+
+void
+RBALogManager::init(int32_t level)
+{
+ if(instance_) {
+ instance_->initImpl(level);
+ }
+}
+
+void
+RBALogManager::requestLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->requestLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::resultLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->resultLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::arbitrateAreaLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->arbitrateAreaLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::arbitrateContentLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->arbitrateContentLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::arbitrateConstraintLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->arbitrateConstraintLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::arbitrateConstraintLogicLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->arbitrateConstraintLogicLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::allConstraintLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->allConstraintLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::cancelRequestLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->cancelRequestLogLineImpl(message);
+ }
+}
+
+std::string
+RBALogManager::getArbitrateLog()
+{
+ if(instance_) {
+ return instance_->getArbitrateLogImpl();
+ }
+ else {
+ return "";
+ }
+}
+
+std::string
+RBALogManager::getAllConstraintLog()
+{
+ if(instance_) {
+ return instance_->getAllConstraintLogImpl();
+ }
+ else {
+ return "";
+ }
+}
+
+std::string
+RBALogManager::getCheckAllConstraintLog()
+{
+ if(instance_) {
+ return instance_->getCheckAllConstraintLogImpl();
+ }
+ else {
+ return "";
+ }
+}
+
+std::string
+RBALogManager::getRequestLog()
+{
+ if(instance_) {
+ return instance_->getRequestLogImpl();
+ }
+ else {
+ return "";
+ }
+}
+
+std::string
+RBALogManager::getPreviousResultLog()
+{
+ if(instance_) {
+ return instance_->getPreviousResultLogImpl();
+ }
+ else {
+ return "";
+ }
+}
+
+std::string
+RBALogManager::getResultLog()
+{
+ if(instance_) {
+ return instance_->getResultLogImpl();
+ }
+ else {
+ return "";
+ }
+}
+
+std::string
+RBALogManager::getCancelRequestLog()
+{
+ if(instance_) {
+ return instance_->getCancelRequestLogImpl();
+ }
+ else {
+ return "";
+ }
+}
+
+void
+RBALogManager::coverageRequestLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->coverageRequestLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::coveragePrevResultLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->coveragePrevResultLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::coverageResultLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->coverageResultLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::coverageConstraintStartLog(const RBAAbstractConstraint* constraint)
+{
+ if(instance_) {
+ instance_->coverageConstraintStartLogImpl(constraint);
+ }
+}
+
+void
+RBALogManager::coverageConstraintEndLog(const RBAAbstractConstraint* constraint)
+{
+ if(instance_) {
+ instance_->coverageConstraintEndLogImpl(constraint);
+ }
+}
+
+void
+RBALogManager::coverageConstraintExpressionLog(
+ const std::string& expressionText, RBAExecuteResult result) {
+ if (instance_) {
+ instance_->coverageConstraintExpressionLogImpl(expressionText, result);
+ }
+}
+
+void
+RBALogManager::
+coverageConstraintExpressionLog(const std::string& expressionText)
+{
+ if(instance_) {
+ instance_->coverageConstraintExpressionLogImpl(expressionText);
+ }
+}
+
+void
+RBALogManager::coverageCanceledRequestLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->coverageCanceledRequestLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::addStartLogLine(const std::string& log)
+{
+ if(instance_) {
+ instance_->addStartLogLineImpl(log);
+ }
+}
+
+void
+RBALogManager::addCoverageLogCollector(RBAILogCollector* collector)
+{
+ coverageLog_.addCoverageLogCollector(collector);
+}
+
+void
+RBALogManager::removeCoverageLogCollector(RBAILogCollector* collector)
+{
+ coverageLog_.removeCoverageLogCollector(collector);
+}
+
+void
+RBALogManager::coverageHierarchyOfConstraintLogLine(const std::string& message)
+{
+ if(instance_) {
+ instance_->coverageHierarchyOfConstraintLogLineImpl(message);
+ }
+}
+
+void
+RBALogManager::
+coverageHierarchyOfConstraintStartLog(const RBAAbstractConstraint* constraint)
+{
+ if(instance_) {
+ instance_->coverageHierarchyOfConstraintStartLogImpl(constraint);
+ }
+}
+
+void
+RBALogManager::
+coverageHierarchyOfConstraintEndLog(const RBAAbstractConstraint* constraint)
+{
+ if(instance_) {
+ instance_->coverageHierarchyOfConstraintEndLogImpl(constraint);
+ }
+}
+
+void
+RBALogManager::
+coverageHierarchyOfConstraintExpressionLog(const std::string& expressionText,
+ RBAExpression* expression)
+{
+ if(instance_) {
+ instance_->coverageHierarchyOfConstraintExpressionLogImpl(expressionText,
+ expression);
+
+ }
+}
+
+void
+RBALogManager::initConstraintHierarchy()
+{
+ if(instance_) {
+ instance_->initConstraintHierarchyImpl();
+ }
+}
+
+bool RBALogManager::addHierarchy(const std::string& data)
+{
+{
+ if(instance_) {
+ return instance_->addHierarchyImpl(data);
+ }
+ else {
+ return true;
+ }
+}
+}
+
+void RBALogManager::removeHierarchy()
+{
+ if(instance_) {
+ instance_->removeHierarchyImpl();
+ }
+}
+
+//
+// Private method
+//
+
+void
+RBALogManager::setTypeImpl(std::uint16_t logType)
+{
+ execType_ = logType;
+}
+
+void
+RBALogManager::setEnableImpl(std::uint16_t logType, bool sw)
+{
+ if(sw) {
+ requestType_ |= logType;
+ } else {
+ requestType_ &= ~logType;
+ }
+}
+
+/**
+ * initialize log
+ */
+void
+RBALogManager::initImpl(int32_t level)
+{
+ level_ = level;
+ requestLogs_.clear();
+ previousResultLogs_.clear();
+ resultLogs_.clear();
+ cancelLogs_.clear();
+ checkAllConstraintsLogs_.clear();
+ allConstraintLogs_.clear();
+ arbitrateLogs_.clear();
+}
+
+/**
+ * Output request information log in one line
+ * @param message
+ */
+void
+RBALogManager::requestLogLineImpl(const std::string& message)
+{
+ if((TYPE_REQUEST & requestType_) != 0U) {
+ requestLogs_.push_back(std::make_shared<RBALog>(1, indent_ + message));
+ }
+}
+
+/**
+ * Ouput result information log in one line
+ * @param message
+ */
+void
+RBALogManager::resultLogLineImpl(const std::string& message)
+{
+ if((TYPE_RESULT & requestType_ & execType_) != 0U) {
+ resultLogs_.push_back(std::make_shared<RBALog>(1, indent_ + message));
+ }
+ if((TYPE_PREVIOUS_RESULT & requestType_ & execType_) != 0U) {
+ previousResultLogs_.push_back(std::make_shared<RBALog>(1, indent_ + message));
+ }
+}
+
+/**
+ * Ouput Area arbitration information log in one line
+ * @param message
+ */
+void
+RBALogManager::arbitrateAreaLogLineImpl(const std::string& message)
+{
+ if((TYPE_ARBITRATE & requestType_) != 0U) {
+ arbitrateLogs_.push_back(std::make_shared<RBALog>(2, indent_ + message));
+ }
+}
+
+/**
+ * Ouput Content arbitration information log in one line
+ * @param message
+ */
+void
+RBALogManager::arbitrateContentLogLineImpl(const std::string& message)
+{
+ if((TYPE_ARBITRATE & requestType_) != 0U) {
+ arbitrateLogs_.push_back(std::make_shared<RBALog>(2, indent_ + message));
+ }
+}
+
+/**
+ * Ouput Constraint confirmation information log in one line
+ * @param message
+ */
+void
+RBALogManager::arbitrateConstraintLogLineImpl(const std::string& message)
+{
+ if((TYPE_ARBITRATE & requestType_ & execType_) != 0U) {
+ arbitrateLogs_.push_back(std::make_shared<RBALog>(3, indent_ + message));
+ }
+ if((TYPE_CHECK_ALL_CONSTRAINTS & requestType_ & execType_) != 0U) {
+ checkAllConstraintsLogs_.push_back(std::make_shared<RBALog>(3, indent_ + message));
+ }
+ if((TYPE_CANCEL_REQUEST & requestType_ & execType_) != 0U) {
+ cancelLogs_.push_back(std::make_shared<RBALog>(3, indent_ + message));
+ }
+}
+
+/**
+ * Ouput Constraint logic information log in one line
+ * @param message
+ */
+void
+RBALogManager::arbitrateConstraintLogicLogLineImpl(const std::string& message)
+{
+ if((TYPE_ARBITRATE & requestType_ & execType_) != 0U) {
+ arbitrateLogs_.push_back(std::make_shared<RBALog>(4, indent_ + message));
+ }
+ if((TYPE_CHECK_ALL_CONSTRAINTS & requestType_ & execType_) != 0U) {
+ checkAllConstraintsLogs_.push_back(std::make_shared<RBALog>(4, indent_ + message));
+ }
+ if((TYPE_CANCEL_REQUEST & requestType_ & execType_) != 0U) {
+ cancelLogs_.push_back(std::make_shared<RBALog>(4, indent_ + message));
+ }
+}
+
+/**
+ * Ouput all Constraint check log in one line
+ * @param message
+ */
+void
+RBALogManager::allConstraintLogLineImpl(const std::string& message)
+{
+ if((TYPE_ALL_CONSTRAINTS & requestType_) != 0U) {
+ allConstraintLogs_.push_back(std::make_shared<RBALog>(0, indent_ + message));
+ }
+}
+
+/**
+ * Ouput Request cancel log in one line
+ * @param message
+ */
+void
+RBALogManager::cancelRequestLogLineImpl(const std::string& message)
+{
+ if((TYPE_CANCEL_REQUEST & requestType_) != 0U) {
+ cancelLogs_.push_back(std::make_shared<RBALog>(2, indent_ + message));
+ }
+}
+
+/**
+ * Get the string of arbitration log below the set level
+ * @return
+ */
+std::string
+RBALogManager::getArbitrateLogImpl()
+{
+ std::ostringstream oss;
+ for(auto it=arbitrateLogs_.begin(); it!=arbitrateLogs_.end(); it++) {
+ if(it->get()->getLevel() <= level_) {
+ oss << it->get()->getLog() << std::endl;
+ }
+ }
+
+ return oss.str();
+}
+
+/**
+ * get all constraints log
+ * @return
+ */
+std::string
+RBALogManager::getAllConstraintLogImpl()
+{
+ std::ostringstream oss;
+ for(auto it=allConstraintLogs_.begin(); it!=allConstraintLogs_.end(); it++) {
+ RBALog* log = it->get();
+ if(log->getLevel() <= level_) {
+ oss << log->getLog() << std::endl;
+ }
+ }
+
+ return oss.str();
+}
+
+/**
+ * get check all constraints log
+ * @return
+ */
+std::string
+RBALogManager::getCheckAllConstraintLogImpl()
+{
+ std::ostringstream oss;
+ for(auto it=checkAllConstraintsLogs_.begin();
+ it!=checkAllConstraintsLogs_.end(); it++) {
+ RBALog* log = it->get();
+ if(log->getLevel() <= level_) {
+ oss << log->getLog() << std::endl;
+ }
+ }
+
+ return oss.str();
+}
+
+/**
+ * get request log
+ * @return
+ */
+std::string
+RBALogManager::getRequestLogImpl()
+{
+ std::ostringstream oss;
+ for(auto it=requestLogs_.begin(); it!=requestLogs_.end(); it++) {
+ RBALog* log = it->get();
+ if(log->getLevel() <= level_) {
+ oss << log->getLog() << std::endl;
+ }
+ }
+
+ return oss.str();
+}
+
+/**
+ * get previous result log
+ * @return
+ */
+std::string
+RBALogManager::getPreviousResultLogImpl()
+{
+ std::ostringstream oss;
+ for(auto it=previousResultLogs_.begin();
+ it!=previousResultLogs_.end(); it++) {
+ RBALog* log = it->get();
+ if(log->getLevel() <= level_) {
+ oss << log->getLog() << std::endl;
+ }
+ }
+
+ return oss.str();
+}
+
+/**
+ * get result log
+ * @return
+ */
+std::string
+RBALogManager::getResultLogImpl()
+{
+ std::ostringstream oss;
+ for(auto it=resultLogs_.begin(); it!=resultLogs_.end(); it++) {
+ RBALog* log = it->get();
+ if(log->getLevel() <= level_) {
+ oss << log->getLog() << std::endl;
+ }
+ }
+
+ return oss.str();
+}
+
+/**
+ * get rule log
+ * @return
+ */
+std::string
+RBALogManager::getCancelRequestLogImpl()
+{
+ std::ostringstream oss;
+ for(auto it=cancelLogs_.begin(); it!=cancelLogs_.end(); it++) {
+ RBALog* log = it->get();
+ if(log->getLevel() <= level_) {
+ oss << log->getLog() << std::endl;
+ }
+ }
+
+ return oss.str();
+}
+
+// ------------------------------
+// Log information for coverage
+// ------------------------------
+/**
+ * Add request log for coverage in one line
+ * @param message
+ */
+void
+RBALogManager::coverageRequestLogLineImpl(const std::string& message)
+{
+ coverageLog_.addRequestLogLine(message);
+}
+
+/**
+ * Add Allocate setting log for coverage in one line
+ * @param message
+ */
+void
+RBALogManager::coveragePrevResultLogLineImpl(const std::string& message)
+{
+ coverageLog_.addPrevResultLogLine(message);
+}
+
+/**
+ * Add result log for coverage in one line
+ * @param message
+ */
+void
+RBALogManager::coverageResultLogLineImpl(const std::string& message)
+{
+ coverageLog_.addResultLogLine(message);
+}
+
+/**
+ * Add Constraint start log for coverage
+ * @param constraint
+ */
+void
+RBALogManager::coverageConstraintStartLogImpl(const RBAAbstractConstraint* constraint)
+{
+ if ((execType_ == TYPE_ARBITRATE) ||
+ (execType_ == TYPE_CANCEL_REQUEST) ||
+ (execType_ == TYPE_NOTHING)) {
+ coverageLog_.addConstraintStartLog(constraint);
+ }
+}
+
+/**
+ * Add Constraint finish log for coverage
+ * @param constraint
+ */
+void
+RBALogManager::coverageConstraintEndLogImpl(const RBAAbstractConstraint* constraint)
+{
+ if ((execType_ == TYPE_ARBITRATE) ||
+ (execType_ == TYPE_CANCEL_REQUEST) ||
+ (execType_ == TYPE_NOTHING)) {
+ coverageLog_.addConstraintEndLog(constraint);
+ }
+}
+
+/**
+ * Add Constraint execution log for coverage
+ * @param expressionText
+ * @param result
+ */
+void
+RBALogManager::coverageConstraintExpressionLogImpl(
+ const std::string& expressionText, RBAExecuteResult result)
+{
+ if ((execType_ == TYPE_ARBITRATE) ||
+ (execType_ == TYPE_CANCEL_REQUEST) ||
+ (execType_ == TYPE_NOTHING)) {
+ coverageLog_.addConstraintExpressionLog(expressionText, result);
+ }
+}
+
+/**
+ * Add action constraint execution log for coverage
+ * @param expressionText
+ */
+void
+RBALogManager::
+coverageConstraintExpressionLogImpl(const std::string& expressionText)
+{
+ coverageLog_.addConstraintExpressionLog(expressionText);
+}
+
+/**
+ * Add request cancellation log for coverage in one line
+ * @param message
+ */
+void
+RBALogManager::coverageCanceledRequestLogLineImpl(const std::string& message)
+{
+ coverageLog_.addCanceledRequestLogLine(message);
+}
+
+/**
+ * add start log line
+ * @param log
+ */
+void
+RBALogManager::addStartLogLineImpl(const std::string& log)
+{
+ coverageLog_.addStartLogLine(log);
+}
+
+/**
+ * Add Constraint structure log for coverage in one line
+ * @param message
+ */
+void
+RBALogManager::coverageHierarchyOfConstraintLogLineImpl(const std::string& message)
+{
+ coverageLog_.addHierarchyOfConstraintLogLine(message);
+}
+
+/**
+ * Add Constraint structure start log for coverage
+ * @param constraint
+ */
+void
+RBALogManager::
+coverageHierarchyOfConstraintStartLogImpl(const RBAAbstractConstraint* constraint)
+{
+ coverageLog_.addHierarchyOfConstraintStartLog(constraint);
+}
+
+/**
+ * Add Constraint structure finish log for coverage
+ * @param constraint
+ */
+void
+RBALogManager::
+coverageHierarchyOfConstraintEndLogImpl(const RBAAbstractConstraint* constraint)
+{
+ coverageLog_.addHierarchyOfConstraintEndLog(constraint);
+}
+
+/**
+ * Add Constraint structure formula log for coverage
+ * @param expressionText
+ * @param expression
+ */
+void
+RBALogManager::
+coverageHierarchyOfConstraintExpressionLogImpl(const std::string& expressionText,
+ const RBAExpression* expression)
+{
+ coverageLog_.addHierarchyOfConstraintExpressionLog(expressionText,
+ expression);
+}
+
+// ----------------------------------------------------------
+// Hierarchical information of constraint log for coverage
+// ----------------------------------------------------------
+/**
+ * Initilize hierarchical structure of constraint
+ */
+void
+RBALogManager::initConstraintHierarchyImpl()
+{
+ coverageLog_.initConstraintHierarchy();
+}
+
+/**
+ * Add hierarchical structure of constraint
+ * @param data
+ * @return
+ */
+bool
+RBALogManager::addHierarchyImpl(const std::string& data)
+{
+ if ((execType_ == TYPE_ARBITRATE) ||
+ (execType_ == TYPE_CANCEL_REQUEST) ||
+ (execType_ == TYPE_NOTHING)) {
+ return coverageLog_.addHierarchy(data);
+ } else {
+ return false;
+ }
+}
+
+/**
+ * Remove hierarchical structure of constraint
+ * @param data
+ * @return
+ */
+void
+RBALogManager::removeHierarchyImpl()
+{
+ if ((execType_ == TYPE_ARBITRATE) ||
+ (execType_ == TYPE_CANCEL_REQUEST) ||
+ (execType_ == TYPE_NOTHING)) {
+ coverageLog_.removeHierarchy();
+ }
+}
+
+const std::string&
+RBALogManager::boolToString(const bool value)
+{
+ if (value == true) {
+ return STR_TRUE;
+ } else {
+ return STR_FALSE;
+ }
+}
+
+void
+RBALogManager::setIndent(std::int32_t nest)
+{
+ indent_ = "";
+ for (std::int32_t i = 0; i < nest; ++i) {
+ indent_ += " ";
+ }
+}
+#endif
+
+}
diff --git a/src/log/RBALogManager.hpp b/src/log/RBALogManager.hpp
new file mode 100644
index 0000000..a8f2427
--- /dev/null
+++ b/src/log/RBALogManager.hpp
@@ -0,0 +1,232 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Log manager class header file
+ */
+
+#ifndef RBALOGMANAGER_HPP
+#define RBALOGMANAGER_HPP
+
+#include <memory>
+#include "RBACoverageLog.hpp"
+
+#ifdef RBA_USE_LOG
+
+namespace rba
+{
+
+class DLL_EXPORT RBALogManager
+{
+public:
+ RBALogManager();
+ RBALogManager(const RBALogManager&)=delete;
+ RBALogManager(const RBALogManager&&)=delete;
+ RBALogManager& operator=(const RBALogManager&)=delete;
+ RBALogManager& operator=(const RBALogManager&&)=delete;
+ virtual ~RBALogManager()=default;
+
+ // Interefae for RBA Tool
+ static void init(int32_t level);
+ void addCoverageLogCollector(RBAILogCollector* collector);
+ void removeCoverageLogCollector(RBAILogCollector* collector);
+ static void addStartLogLine(const std::string& log);
+ static void coverageHierarchyOfConstraintLogLine(const std::string& message);
+ static void setLogManager(RBALogManager* logManager);
+ static RBALogManager* getLogManager();
+ static void setEnable(std::uint16_t logType, bool sw=true);
+
+ // Interface private to the outside of RBA
+ static void setType(std::uint16_t logType);
+ static void requestLogLine(const std::string& message);
+ static void resultLogLine(const std::string& message);
+ static void arbitrateAreaLogLine(const std::string& message);
+ static void arbitrateContentLogLine(const std::string& message);
+ static void arbitrateConstraintLogLine(const std::string& message);
+ static void arbitrateConstraintLogicLogLine(const std::string& message);
+ static void allConstraintLogLine(const std::string& message);
+ static void cancelRequestLogLine(const std::string& message);
+ static std::string getArbitrateLog();
+ static std::string getAllConstraintLog();
+ static std::string getCheckAllConstraintLog();
+ static std::string getRequestLog();
+ static std::string getPreviousResultLog();
+ static std::string getResultLog();
+ static std::string getCancelRequestLog();
+ static void coverageRequestLogLine(const std::string& message);
+ static void coveragePrevResultLogLine(const std::string& message);
+ static void coverageResultLogLine(const std::string& message);
+ static void coverageConstraintStartLog(const RBAAbstractConstraint* constraint);
+ static void coverageConstraintEndLog(const RBAAbstractConstraint* constraint);
+ static void coverageConstraintExpressionLog(const std::string& expressionText,
+ RBAExecuteResult result);
+ static void coverageConstraintExpressionLog(const std::string& expressionText);
+ static void coverageCanceledRequestLogLine(const std::string& message);
+ static void coverageHierarchyOfConstraintStartLog(const RBAAbstractConstraint* constraint);
+ static void coverageHierarchyOfConstraintEndLog(const RBAAbstractConstraint* constraint);
+ static void coverageHierarchyOfConstraintExpressionLog(const std::string& expressionText,
+ RBAExpression* expression);
+ static void initConstraintHierarchy();
+ static bool addHierarchy(const std::string& data);
+ static void removeHierarchy();
+ static const std::string& boolToString(const bool value);
+ static void setIndent(std::int32_t nest);
+
+private:
+ void setTypeImpl(std::uint16_t logType);
+ void setEnableImpl(std::uint16_t logType, bool sw=true);
+ void initImpl(int32_t level);
+ void requestLogLineImpl(const std::string& message);
+ void resultLogLineImpl(const std::string& message);
+ void arbitrateAreaLogLineImpl(const std::string& message);
+ void arbitrateContentLogLineImpl(const std::string& message);
+ void arbitrateConstraintLogLineImpl(const std::string& message);
+ void arbitrateConstraintLogicLogLineImpl(const std::string& message);
+ void allConstraintLogLineImpl(const std::string& message);
+ void cancelRequestLogLineImpl(const std::string& message);
+ std::string getArbitrateLogImpl();
+ std::string getAllConstraintLogImpl();
+ std::string getCheckAllConstraintLogImpl();
+ std::string getRequestLogImpl();
+ std::string getPreviousResultLogImpl();
+ std::string getResultLogImpl();
+ std::string getCancelRequestLogImpl();
+ void coverageRequestLogLineImpl(const std::string& message);
+ void coveragePrevResultLogLineImpl(const std::string& message);
+ void coverageResultLogLineImpl(const std::string& message);
+ void coverageConstraintStartLogImpl(const RBAAbstractConstraint* constraint);
+ void coverageConstraintEndLogImpl(const RBAAbstractConstraint* constraint);
+ void coverageConstraintExpressionLogImpl(const std::string& expressionText,
+ RBAExecuteResult result);
+ void coverageConstraintExpressionLogImpl(const std::string& expressionText);
+ void coverageCanceledRequestLogLineImpl(const std::string& message);
+ void addStartLogLineImpl(const std::string& log);
+ void coverageHierarchyOfConstraintLogLineImpl(const std::string& message);
+ void coverageHierarchyOfConstraintStartLogImpl(const RBAAbstractConstraint* constraint);
+ void coverageHierarchyOfConstraintEndLogImpl(const RBAAbstractConstraint* constraint);
+ void coverageHierarchyOfConstraintExpressionLogImpl(const std::string& expressionText,
+ const RBAExpression* expression);
+ void initConstraintHierarchyImpl();
+ bool addHierarchyImpl(const std::string& data);
+ void removeHierarchyImpl();
+
+public:
+ const static std::uint16_t TYPE_NOTHING =0x0000U;
+ const static std::uint16_t TYPE_ALL_CONSTRAINTS =0x0001U;
+ const static std::uint16_t TYPE_REQUEST =0x0002U;
+ const static std::uint16_t TYPE_PREVIOUS_RESULT =0x0004U;
+ const static std::uint16_t TYPE_ARBITRATE =0x0008U;
+ const static std::uint16_t TYPE_CANCEL_REQUEST =0x0010U;
+ const static std::uint16_t TYPE_CHECK_ALL_CONSTRAINTS =0x0020U;
+ const static std::uint16_t TYPE_RESULT =0x0080U;
+ /*
+ * Used when implementing log output feature in C++.
+ * Currebtly, the file is output on the RBATool side
+ * when TYPE_SAVE_LOG is on, so this information is not referenced.
+ */
+ const static std::uint16_t TYPE_SAVE_LOG = 0x0100U;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ const static std::string STR_TRUE;
+ const static std::string STR_FALSE;
+ static RBALogManager* instance_;
+ static std::string indent_;
+ std::vector<std::shared_ptr<RBALog>> requestLogs_;
+ std::vector<std::shared_ptr<RBALog>> previousResultLogs_;
+ std::vector<std::shared_ptr<RBALog>> resultLogs_;
+ std::vector<std::shared_ptr<RBALog>> cancelLogs_;
+ std::vector<std::shared_ptr<RBALog>> checkAllConstraintsLogs_;
+ int32_t level_ = 0;
+ std::uint16_t requestType_ = RBALogManager::TYPE_NOTHING;
+ std::uint16_t execType_ = RBALogManager::TYPE_NOTHING;
+ std::vector<std::shared_ptr<RBALog>> allConstraintLogs_;
+ std::vector<std::shared_ptr<RBALog>> arbitrateLogs_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+ RBACoverageLog coverageLog_;
+
+};
+
+}
+
+// @Deviation (PRE00-CPP,Rule-16_0_4,Rule-16_2_1)
+// [Contents that deviate from the rules]
+// Function-like macros shall not be defined.
+// [Explanation that there is no problem even if it deviates from the rules]
+// Do not modify because it will cause processing load
+// if it is not a function macro
+#define LOG_initConstraintHierarchy() \
+ rba::RBALogManager::initConstraintHierarchy()
+#define LOG_removeHierarchy() \
+ rba::RBALogManager::removeHierarchy()
+#define LOG_coverageHierarchyOfConstraintStartLog(log) \
+ rba::RBALogManager::coverageHierarchyOfConstraintStartLog(log)
+#define LOG_coverageHierarchyOfConstraintEndLog(log) \
+ rba::RBALogManager::coverageHierarchyOfConstraintEndLog(log)
+#define LOG_addCoverageLogCollector(collector) \
+ rba::RBALogManager::addCoverageLogCollector(collector)
+#define LOG_addHierarchy(log) \
+ rba::RBALogManager::addHierarchy(log)
+#define LOG_allConstraintLogLine(log) \
+ rba::RBALogManager::allConstraintLogLine(log)
+#define LOG_arbitrateAreaLogLine(log) \
+ rba::RBALogManager::arbitrateAreaLogLine(log)
+#define LOG_arbitrateConstraintLogLine(log) \
+ rba::RBALogManager::arbitrateConstraintLogLine(log)
+#define LOG_arbitrateConstraintLogicLogLine(log) \
+ rba::RBALogManager::arbitrateConstraintLogicLogLine(log)
+#define LOG_coverageConstraintExpressionLog(log, flag) \
+ rba::RBALogManager::coverageConstraintExpressionLog(log, flag)
+#define LOG_coverageConstraintExpressionLog2(log) \
+ rba::RBALogManager::coverageConstraintExpressionLog(log)
+#define LOG_coverageConstraintStartLog(constraint) \
+ rba::RBALogManager::coverageConstraintStartLog(constraint)
+#define LOG_coverageConstraintEndLog(constraint) \
+ rba::RBALogManager::coverageConstraintEndLog(constraint)
+#else
+#define LOG_initConstraintHierarchy() do{} while(false)
+#define LOG_removeHierarchy() do{} while(false)
+#define LOG_coverageHierarchyOfConstraintStartLog(log) do{} while(false)
+#define LOG_coverageHierarchyOfConstraintEndLog(log) do{} while(false)
+#define LOG_addCoverageLogCollector(collector) do{} while(false)
+#define LOG_addHierarchy(log) do{} while(false)
+#define LOG_allConstraintLogLine(log) do{} while(false)
+#define LOG_arbitrateAreaLogLine(log) do{} while(false)
+#define LOG_arbitrateConstraintLogLine(log) do{} while(false)
+#define LOG_arbitrateConstraintLogicLogLine(log) do{} while(false)
+#define LOG_coverageConstraintExpressionLog(log, flag) do{} while(false)
+#define LOG_coverageConstraintExpressionLog2(log) do{} while(false)
+#define LOG_coverageConstraintStartLog(constraint) do{} while(false)
+#define LOG_coverageConstraintEndLog(constraint) do{} while(false)
+#endif
+
+// class method
+#ifdef RBA_USE_LOG
+#define LOG_getSymbol() getSymbol()
+#define LOG_getExpressionText() getExpressionText()
+#define LOG_getCoverageExpressionText() getCoverageExpressionText()
+#else
+#define LOG_getSymbol() std::string("")
+#define LOG_getExpressionText() std::string("")
+#define LOG_getCoverageExpressionText() std::string("")
+#endif
+
+#endif
diff --git a/src/optimize/RBAAbstractCollector.cpp b/src/optimize/RBAAbstractCollector.cpp
new file mode 100644
index 0000000..8d1574b
--- /dev/null
+++ b/src/optimize/RBAAbstractCollector.cpp
@@ -0,0 +1,598 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Abstract search class implementation file
+ */
+
+#include <memory>
+
+#include "RBAAbstractCollector.hpp"
+
+#include "RBAAllocatable.hpp"
+#include "RBAAllocatableSet.hpp"
+#include "RBAAllocatedContent.hpp"
+#include "RBAAndOperator.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentSet.hpp"
+#include "RBAContentValue.hpp"
+#include "RBADisplayingContent.hpp"
+#include "RBAExistsOperator.hpp"
+#include "RBAForAllOperator.hpp"
+#include "RBAGetAllocatables.hpp"
+#include "RBAActiveState.hpp"
+#include "RBAActiveContents.hpp"
+#include "RBAGetContentsList.hpp"
+#include "RBAGetProperty.hpp"
+#include "RBAHasBeenDisplayed.hpp"
+#include "RBAHasComeEarlierThan.hpp"
+#include "RBAHasComeLaterThan.hpp"
+#include "RBAIfStatement.hpp"
+#include "RBAImpliesOperator.hpp"
+#include "RBAIsActive.hpp"
+#include "RBAIsAttenuated.hpp"
+#include "RBAIsDisplayed.hpp"
+#include "RBAIsEqualToOperator.hpp"
+#include "RBAIsGreaterThanEqualOperator.hpp"
+#include "RBAIsGreaterThanOperator.hpp"
+#include "RBAIsHidden.hpp"
+#include "RBAIsLowerThanEqualOperator.hpp"
+#include "RBAIsLowerThanOperator.hpp"
+#include "RBAIsMuted.hpp"
+#include "RBAIsOn.hpp"
+#include "RBAIsOutputted.hpp"
+#include "RBAIsSounding.hpp"
+#include "RBAIsVisible.hpp"
+#include "RBALambdaExpression.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBANotOperator.hpp"
+#include "RBAObjectCompare.hpp"
+#include "RBAOrOperator.hpp"
+#include "RBAOutputtingSound.hpp"
+#include "RBAPreviousModifier.hpp"
+#include "RBAMaxOperator.hpp"
+#include "RBAMinOperator.hpp"
+#include "RBASelectOperator.hpp"
+#include "RBASizeOperator.hpp"
+#include "RBAResultImpl.hpp"
+#include "RBAResultSet.hpp"
+#include "RBAStateValue.hpp"
+#include "RBAObjectReference.hpp"
+#include "RBASetOfOperator.hpp"
+#include "RBALetStatement.hpp"
+#include "RBAOperator.hpp"
+#include "RBAIsTypeOfOperator.hpp"
+#include "RBAPreviousObjectWrapper.hpp"
+
+namespace rba
+{
+
+RBAAbstractCollector::RBAAbstractCollector(RBAModelImpl* const model)
+ : RBAExpressionVisitor(),
+ model_{model},
+ isLhs_{false},
+ isPreviousModifier_{false},
+ isPositive_{true},
+ visitsLetStatement_{false}
+{
+}
+
+// area status
+void RBAAbstractCollector::visit(RBAIsDisplayed& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBADisplayingContent& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAAllocatedContent& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAIsHidden& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAContentValue& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAGetContentsList& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+
+void RBAAbstractCollector::visit(RBAActiveContents& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+
+// display content status
+void RBAAbstractCollector::visit(RBAIsActive& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAIsVisible& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAStateValue& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAHasBeenDisplayed& exp)
+{
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAHasComeEarlierThan& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+ exp.getRhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAHasComeLaterThan& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+ exp.getRhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAGetAllocatables& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAActiveState& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+// zone status
+void RBAAbstractCollector::visit(RBAIsOutputted& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAOutputtingSound& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+// allocatedContent is common with area
+void RBAAbstractCollector::visit(RBAIsMuted& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAIsAttenuated& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+// contentValue is common with area
+// contentsList is common with area
+
+// sound content status
+// isActive is common with display content
+void RBAAbstractCollector::visit(RBAIsSounding& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+// stateValue is common with display content
+// hasComeEarlierThan is common with display content
+// hasComeLaterThan is common with display content
+// allocatables is common with display content
+
+// scene status
+void RBAAbstractCollector::visit(RBAIsOn& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAGetProperty& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+
+void RBAAbstractCollector::visit(RBAIsTypeOfOperator& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+
+// operator
+void RBAAbstractCollector::visit(RBAAndOperator& exp)
+{
+ visitLetStatement(exp);
+ for (RBAExpression* const ope : exp.getOperand()) {
+ ope->accept(*this);
+ }
+}
+void RBAAbstractCollector::visit(RBAOrOperator& exp)
+{
+ visitLetStatement(exp);
+ for (RBAExpression* const ope : exp.getOperand()) {
+ ope->accept(*this);
+ }
+}
+void RBAAbstractCollector::visit(RBANotOperator& exp)
+{
+ visitLetStatement(exp);
+ isPositive_ = !isPositive_;
+ exp.getLhsOperand()->accept(*this);
+ isPositive_ = !isPositive_;
+}
+void RBAAbstractCollector::visit(RBAImpliesOperator& exp)
+{
+ visitLetStatement(exp);
+ const bool backup {isLhs_};
+ exp.getLhsOperand()->accept(*this);
+ isLhs_ = backup;
+ exp.getRhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAIsEqualToOperator& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+ exp.getRhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAObjectCompare& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+ exp.getRhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAIsGreaterThanOperator& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+ exp.getRhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAIsGreaterThanEqualOperator& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+ exp.getRhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAIsLowerThanOperator& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+ exp.getRhsOperand()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBAIsLowerThanEqualOperator& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+ exp.getRhsOperand()->accept(*this);
+}
+
+// Quantification symbol
+void RBAAbstractCollector::visit(RBAForAllOperator& exp)
+{
+ visitLetStatement(exp);
+ RBAConstraintInfo dummyInfo;
+ RBAArbitrator dummyArb;
+ dummyArb.setModel(model_);
+ dummyArb.setResult(std::make_unique<RBAResultImpl>(
+ &dummyArb, std::make_unique<RBAResultSet>()));
+ const RBARuleObject* const ruleObj {exp.getLhsOperand()->getReferenceObject(
+ &dummyInfo, &dummyArb)};
+ if (ruleObj != nullptr) {
+ std::vector<const RBARuleObject*> objs;
+ const RBARuleObject* const objset {ruleObj->getRawObject()};
+ if (dynamic_cast<const RBAAllocatableSet*>(objset) != nullptr) {
+ for (const auto& alloc : dynamic_cast<const RBAAllocatableSet*>(objset)
+ ->getLeafAllocatable()) {
+ objs.push_back(alloc);
+ }
+ } else {
+ for (const auto& cont : dynamic_cast<const RBAContentSet*>(objset)
+ ->getLeafContent()) {
+ objs.push_back(cont);
+ }
+ }
+ for (const RBARuleObject* const obj : objs) {
+ exp.getLambda()->setRuleObj(obj);
+ exp.getLambda()->getBodyText()->accept(*this);
+ }
+ } else {
+ // As you go through this path, you may be referencing the LetStatement's Variable
+ for (auto& obj : letVal_) {
+ exp.getLambda()->setRuleObj(obj);
+ exp.getLambda()->getBodyText()->accept(*this);
+ }
+ }
+}
+void RBAAbstractCollector::visit(RBAExistsOperator& exp)
+{
+ visitLetStatement(exp);
+ RBAConstraintInfo dummyInfo;
+ RBAArbitrator dummyArb;
+ dummyArb.setModel(model_);
+ dummyArb.setResult(std::make_unique<RBAResultImpl>(
+ &dummyArb, std::make_unique<RBAResultSet>()));
+ const RBARuleObject* const ruleObj {exp.getLhsOperand()->getReferenceObject(
+ &dummyInfo, &dummyArb)};
+ if (ruleObj != nullptr) {
+ std::vector<const RBARuleObject*> objs;
+ const RBARuleObject* const objset {ruleObj->getRawObject()};
+ if (dynamic_cast<const RBAAllocatableSet*>(objset) != nullptr) {
+ for (const auto& alloc : dynamic_cast<const RBAAllocatableSet*>(objset)
+ ->getLeafAllocatable()) {
+ objs.push_back(alloc);
+ }
+ } else {
+ for (const auto& cont : dynamic_cast<const RBAContentSet*>(objset)
+ ->getLeafContent()) {
+ objs.push_back(cont);
+ }
+ }
+ for (const RBARuleObject* const obj : objs) {
+ exp.getLambda()->setRuleObj(obj);
+ exp.getLambda()->getBodyText()->accept(*this);
+ }
+ } else {
+ // As you go through this path, you may be referencing the LetStatement's Variable
+ for (auto& obj : letVal_) {
+ exp.getLambda()->setRuleObj(obj);
+ exp.getLambda()->getBodyText()->accept(*this);
+ }
+ }
+}
+
+// Built-in definition expression
+void RBAAbstractCollector::visit(RBAAllInstanceOfArea& exp)
+{
+ // This Visitor implementation refers to the set of ForAll and Exists with
+ // ReferenceObject, sets it to Variable, and then accepts it to the body.
+ // It does not accept to the set, so it does not pass through this path.
+}
+void RBAAbstractCollector::visit(RBAAllInstanceOfViewContent& exp)
+{
+ // This Visitor implementation refers to the set of ForAll and Exists with
+ // ReferenceObject, sets it to Variable, and then accepts it to the body.
+ // It does not accept to the set, so it does not pass through this path.
+}
+void RBAAbstractCollector::visit(RBAAllInstanceOfZone& exp)
+{
+ // This Visitor implementation refers to the set of ForAll and Exists with
+ // ReferenceObject, sets it to Variable, and then accepts it to the body.
+ // It does not accept to the set, so it does not pass through this path.
+}
+void RBAAbstractCollector::visit(RBAAllInstanceOfSoundContent& exp)
+{
+ // This Visitor implementation refers to the set of ForAll and Exists with
+ // ReferenceObject, sets it to Variable, and then accepts it to the body.
+ // It does not accept to the set, so it does not pass through this path.
+}
+
+// statement
+void RBAAbstractCollector::visit(RBAIfStatement& exp)
+{
+ visitLetStatement(exp);
+ const bool backup {isLhs_};
+ isLhs_ = true;
+ exp.getCondition()->accept(*this);
+ isLhs_ = backup;
+ exp.getThenExpression()->accept(*this);
+ exp.getElseExpression()->accept(*this);
+}
+void RBAAbstractCollector::visit(RBALetStatement& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+// modifier
+void RBAAbstractCollector::visit(RBAPreviousModifier& exp)
+{
+ visitLetStatement(exp);
+ const bool b_isPreviousModifier_ {isPreviousModifier_};
+ isPreviousModifier_ = true;
+ exp.getObjReference()->accept(*this);
+ isPreviousModifier_ = b_isPreviousModifier_;
+}
+// max operator
+void RBAAbstractCollector::visit(RBAMaxOperator& exp)
+{
+ visitLetStatement(exp);
+ RBAConstraintInfo dummyInfo;
+ RBAArbitrator dummyArb;
+ dummyArb.setModel(model_);
+ dummyArb.setResult(std::make_unique<RBAResultImpl>(
+ &dummyArb, std::make_unique<RBAResultSet>()));
+ const RBARuleObject* const ruleObj {exp.getLhsOperand()->getReferenceObject(
+ &dummyInfo, &dummyArb)};
+ if (ruleObj != nullptr) {
+ std::vector<const RBARuleObject*> objs;
+ const RBARuleObject* const objset {ruleObj->getRawObject()};
+ if (dynamic_cast<const RBAAllocatableSet*>(objset) != nullptr) {
+ for (const auto& alloc : dynamic_cast<const RBAAllocatableSet*>(objset)
+ ->getLeafAllocatable()) {
+ objs.push_back(alloc);
+ }
+ } else {
+ for (const auto& cont : dynamic_cast<const RBAContentSet*>(objset)
+ ->getLeafContent()) {
+ objs.push_back(cont);
+ }
+ }
+ for (const RBARuleObject* const obj : objs) {
+ exp.getLambda()->setRuleObj(obj);
+ exp.getLambda()->getBodyText()->accept(*this);
+ }
+ } else {
+ // As you go through this path, you may be referencing the LetStatement's Variable
+ for (auto& obj : letVal_) {
+ exp.getLambda()->setRuleObj(obj);
+ exp.getLambda()->getBodyText()->accept(*this);
+ }
+ }
+}
+void RBAAbstractCollector::visit(RBAMinOperator& exp)
+{
+ visitLetStatement(exp);
+ RBAConstraintInfo dummyInfo;
+ RBAArbitrator dummyArb;
+ dummyArb.setModel(model_);
+ dummyArb.setResult(std::make_unique<RBAResultImpl>(
+ &dummyArb, std::make_unique<RBAResultSet>()));
+ const RBARuleObject* const ruleObj {exp.getLhsOperand()->getReferenceObject(
+ &dummyInfo, &dummyArb)};
+ if (ruleObj != nullptr) {
+ std::vector<const RBARuleObject*> objs;
+ const RBARuleObject* const objset {ruleObj->getRawObject()};
+ if (dynamic_cast<const RBAAllocatableSet*>(objset) != nullptr) {
+ for (const auto& alloc : dynamic_cast<const RBAAllocatableSet*>(objset)
+ ->getLeafAllocatable()) {
+ objs.push_back(alloc);
+ }
+ } else {
+ for (const auto& cont : dynamic_cast<const RBAContentSet*>(objset)
+ ->getLeafContent()) {
+ objs.push_back(cont);
+ }
+ }
+ for (const RBARuleObject* const obj : objs) {
+ exp.getLambda()->setRuleObj(obj);
+ exp.getLambda()->getBodyText()->accept(*this);
+ }
+ } else {
+ // As you go through this path, you may be referencing the LetStatement's Variable
+ for (auto& obj : letVal_) {
+ exp.getLambda()->setRuleObj(obj);
+ exp.getLambda()->getBodyText()->accept(*this);
+ }
+ }
+}
+void RBAAbstractCollector::visit(RBASelectOperator& exp)
+{
+ visitLetStatement(exp);
+ RBAConstraintInfo dummyInfo;
+ RBAArbitrator dummyArb;
+ dummyArb.setModel(model_);
+ dummyArb.setResult(std::make_unique<RBAResultImpl>(
+ &dummyArb, std::make_unique<RBAResultSet>()));
+ const RBARuleObject* const ruleObj {exp.getLhsOperand()->getReferenceObject(
+ &dummyInfo, &dummyArb)};
+ if (ruleObj != nullptr) {
+ std::vector<const RBARuleObject*> objs;
+ const RBARuleObject* const objset {ruleObj->getRawObject()};
+ if (dynamic_cast<const RBAAllocatableSet*>(objset) != nullptr) {
+ for (const auto& alloc : dynamic_cast<const RBAAllocatableSet*>(objset)
+ ->getLeafAllocatable()) {
+ objs.push_back(alloc);
+ }
+ } else {
+ for (const auto& cont : dynamic_cast<const RBAContentSet*>(objset)
+ ->getLeafContent()) {
+ objs.push_back(cont);
+ }
+ }
+ for (const RBARuleObject* const obj : objs) {
+ exp.getLambda()->setRuleObj(obj);
+ exp.getLambda()->getBodyText()->accept(*this);
+ }
+ } else {
+ // As you go through this path, you may be referencing the LetStatement's Variable
+ for (auto& obj : letVal_) {
+ exp.getLambda()->setRuleObj(obj);
+ exp.getLambda()->getBodyText()->accept(*this);
+ }
+ }
+}
+void RBAAbstractCollector::visit(RBASizeOperator& exp)
+{
+ visitLetStatement(exp);
+ exp.getLhsOperand()->accept(*this);
+}
+// object reference
+void RBAAbstractCollector::visit(RBAObjectReference& exp)
+{
+ visitLetStatement(exp);
+}
+void RBAAbstractCollector::visit(RBASetOfOperator& exp)
+{
+ visitLetStatement(exp);
+ for (RBAExpression* const ope : exp.getOperand()) {
+ ope->accept(*this);
+ }
+}
+void RBAAbstractCollector::visitLetStatement(RBAExpression& exp)
+{
+ const bool backup_let {visitsLetStatement_};
+ visitsLetStatement_ = true;
+ for (auto& letStatement : exp.getLetStatements()) {
+ letStatement->accept(*this);
+ }
+ visitsLetStatement_ = backup_let;
+}
+
+std::set<const RBARuleObject*>& RBAAbstractCollector::getLetVal()
+{
+ return letVal_;
+}
+
+void RBAAbstractCollector::addLetVal(const RBARuleObject* const obj)
+{
+ static_cast<void>(letVal_.insert(obj));
+}
+
+bool RBAAbstractCollector::isVisitsLetStatement() const
+{
+ return visitsLetStatement_;
+}
+
+bool RBAAbstractCollector::isLhs() const
+{
+ return isLhs_;
+}
+
+void RBAAbstractCollector::setLhs(const bool lhs)
+{
+ isLhs_ = lhs;
+}
+
+bool RBAAbstractCollector::isPositive() const
+{
+ return isPositive_;
+}
+
+RBAModelImpl* RBAAbstractCollector::getModel() const
+{
+ return model_;
+}
+
+bool RBAAbstractCollector::isPreviousModifier() const
+{
+ return isPreviousModifier_;
+}
+
+} /* namespace rba */
diff --git a/src/optimize/RBAAbstractCollector.hpp b/src/optimize/RBAAbstractCollector.hpp
new file mode 100644
index 0000000..a77db51
--- /dev/null
+++ b/src/optimize/RBAAbstractCollector.hpp
@@ -0,0 +1,160 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Abstract search class header file
+ */
+
+#ifndef RBAABSTRACTCOLLECTOR_HPP
+#define RBAABSTRACTCOLLECTOR_HPP
+
+#include <set>
+
+#include "RBAExpressionVisitor.hpp"
+#include "RBAExpression.hpp"
+
+namespace rba
+{
+class RBAModelImpl;
+class RBARuleObject;
+
+class RBAAbstractCollector : public RBAExpressionVisitor
+{
+ public:
+ RBAAbstractCollector(RBAModelImpl* const model);
+ RBAAbstractCollector(const RBAAbstractCollector&)=default;
+ RBAAbstractCollector(RBAAbstractCollector&&)=default;
+ RBAAbstractCollector& operator=(const RBAAbstractCollector&)=default;
+ RBAAbstractCollector& operator=(RBAAbstractCollector&&)=default;
+ virtual ~RBAAbstractCollector()=default;
+
+ // area status
+ void visit(RBAIsDisplayed& exp) override;
+ void visit(RBADisplayingContent& exp) override;
+ void visit(RBAAllocatedContent& exp) override;
+ void visit(RBAIsHidden& exp) override;
+ void visit(RBAContentValue& exp) override;
+ void visit(RBAGetContentsList& exp) override;
+ void visit(RBAActiveContents& exp) override;
+
+ // display content status
+ void visit(RBAIsActive& exp) override;
+ void visit(RBAIsVisible& exp) override;
+ void visit(RBAStateValue& exp) override;
+ void visit(RBAHasBeenDisplayed& exp) override;
+ void visit(RBAHasComeEarlierThan& exp) override;
+ void visit(RBAHasComeLaterThan& exp) override;
+ void visit(RBAGetAllocatables& exp) override;
+ void visit(RBAActiveState& exp) override;
+
+ // zone status
+ void visit(RBAIsOutputted& exp) override;
+ void visit(RBAOutputtingSound& exp) override;
+ // allocatedContent is common with area
+ void visit(RBAIsMuted& exp) override;
+ void visit(RBAIsAttenuated& exp) override;
+ // contentValue is common with area
+ // contentsList is common with area
+
+ // sound content status
+ // isActive is common with display content
+ void visit(RBAIsSounding& exp) override;
+ // stateValue is common with display content
+ // hasComeEarlierThan is common with display content
+ // hasComeLaterThan is common with display content
+ // allocatables is common with display content
+ // activeState is common with display content
+
+ // scene
+ void visit(RBAIsOn& exp) override;
+ void visit(RBAGetProperty& exp) override;
+
+ void visit(RBAIsTypeOfOperator& exp) override;
+
+ // operator
+ void visit(RBAAndOperator& exp) override;
+ void visit(RBAOrOperator& exp) override;
+ void visit(RBANotOperator& exp) override;
+ void visit(RBAImpliesOperator& exp) override;
+ void visit(RBAIsEqualToOperator& exp) override;
+ void visit(RBAObjectCompare& exp) override;
+ void visit(RBAIsGreaterThanOperator& exp) override;
+ void visit(RBAIsGreaterThanEqualOperator& exp) override;
+ void visit(RBAIsLowerThanOperator& exp) override;
+ void visit(RBAIsLowerThanEqualOperator& exp) override;
+
+ // Quantification symbol
+ void visit(RBAForAllOperator& exp) override;
+ void visit(RBAExistsOperator& exp) override;
+
+ // Built-in definition expression
+ void visit(RBAAllInstanceOfArea& exp) override;
+ void visit(RBAAllInstanceOfViewContent& exp) override;
+ void visit(RBAAllInstanceOfZone& exp) override;
+ void visit(RBAAllInstanceOfSoundContent& exp) override;
+
+ // statement
+ void visit(RBAIfStatement& exp) override;
+ void visit(RBALetStatement& exp) override;
+
+ // modifier
+ void visit(RBAPreviousModifier& exp) override;
+
+ // operator
+ void visit(RBAMaxOperator& exp) override;
+ void visit(RBAMinOperator& exp) override;
+ void visit(RBASelectOperator& exp) override;
+ void visit(RBASizeOperator& exp) override;
+
+ // object reference
+ void visit(RBAObjectReference& exp) override;
+ void visit(RBASetOfOperator& exp) override;
+
+ protected:
+ void visitLetStatement(RBAExpression& exp) ;
+
+ // getter, setter
+ std::set<const RBARuleObject*>& getLetVal();
+ void addLetVal(const RBARuleObject* const obj);
+ bool isVisitsLetStatement() const;
+ bool isLhs() const;
+ void setLhs(const bool lhs);
+ bool isPositive() const;
+ RBAModelImpl* getModel() const;
+ bool isPreviousModifier() const;
+
+ private:
+ // Object that can be taken as the evaluation result of letStatement
+ std::set<const RBARuleObject*> letVal_;
+ // Model referenced in getReferenceObject()
+ RBAModelImpl* model_;
+ // True when searching the left side
+ // Otherwise, false
+ bool isLhs_;
+ // true when in Expression under (pre)
+ // Otherwise, false
+ bool isPreviousModifier_;
+ // True if not inverted with Not
+ // False if inverted with Not
+ bool isPositive_;
+ // true when searching through letStatement
+ // Otherwise, false
+ bool visitsLetStatement_;
+};
+
+} /* namespace rba */
+
+#endif /* RBAABSTRACTCOLLECTOR_HPP */
diff --git a/src/optimize/RBAAllwaysCheckConstraintCollector.cpp b/src/optimize/RBAAllwaysCheckConstraintCollector.cpp
new file mode 100644
index 0000000..9476f52
--- /dev/null
+++ b/src/optimize/RBAAllwaysCheckConstraintCollector.cpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// RBAAllwaysCheckConstraintCollector.hpp
+//
+
+#include "RBAAllwaysCheckConstraintCollector.hpp"
+
+#include "RBAConstraintImpl.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+RBAAllwaysCheckConstraintCollector::RBAAllwaysCheckConstraintCollector(
+ RBAModelImpl* const model)
+ : RBAAbstractCollector{model}
+{
+}
+
+void RBAAllwaysCheckConstraintCollector::init(
+ const RBAConstraintImpl* const constraint)
+{
+ constraint_ = constraint;
+ isAllways_ = false;
+}
+
+bool RBAAllwaysCheckConstraintCollector::isAllways() const
+{
+ return isAllways_;
+}
+
+void RBAAllwaysCheckConstraintCollector::visit(RBAPreviousModifier& exp)
+{
+ isAllways_ = true;
+}
+
+} /* namespace rba */
diff --git a/src/optimize/RBAAllwaysCheckConstraintCollector.hpp b/src/optimize/RBAAllwaysCheckConstraintCollector.hpp
new file mode 100644
index 0000000..3b552e5
--- /dev/null
+++ b/src/optimize/RBAAllwaysCheckConstraintCollector.hpp
@@ -0,0 +1,51 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+//
+// RBAAllwaysCheckConstraintCollector.hpp
+//
+
+#ifndef RBAALLWAYSCHECKCONSTRAINTSETTER_HPP
+#define RBAALLWAYSCHECKCONSTRAINTSETTER_HPP
+
+#include "RBAAbstractCollector.hpp"
+
+namespace rba
+{
+class RBAConstraintImpl;
+
+class RBAAllwaysCheckConstraintCollector : public RBAAbstractCollector
+{
+ public:
+ RBAAllwaysCheckConstraintCollector(RBAModelImpl* const model);
+ RBAAllwaysCheckConstraintCollector(const RBAAllwaysCheckConstraintCollector&)=default;
+ RBAAllwaysCheckConstraintCollector(RBAAllwaysCheckConstraintCollector&&)=default;
+ RBAAllwaysCheckConstraintCollector& operator=(const RBAAllwaysCheckConstraintCollector&)=default;
+ RBAAllwaysCheckConstraintCollector& operator=(RBAAllwaysCheckConstraintCollector&&)=default;
+ virtual ~RBAAllwaysCheckConstraintCollector()=default;
+ void init(const RBAConstraintImpl* const constraint);
+ bool isAllways() const;
+ void visit(RBAPreviousModifier& exp) final;
+ private:
+ // Constraint expression during search
+ const RBAConstraintImpl* constraint_ {nullptr};
+ // True if the constraint expression being searched is a constraint expression that must always be arbitrated
+ bool isAllways_ {false};
+};
+
+} /* namespace rba */
+
+#endif /* RBAALLWAYSCHECKCONSTRAINTSETTER_HPP */
diff --git a/src/project/msvc/rba.sln b/src/project/msvc/rba.sln
new file mode 100644
index 0000000..d7f8101
--- /dev/null
+++ b/src/project/msvc/rba.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26430.13
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rba", "rba\rba.vcxproj", "{4C711A76-D47F-4E7A-A833-5068E79C76B3}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {4C711A76-D47F-4E7A-A833-5068E79C76B3}.Debug|x64.ActiveCfg = Debug|x64
+ {4C711A76-D47F-4E7A-A833-5068E79C76B3}.Debug|x64.Build.0 = Debug|x64
+ {4C711A76-D47F-4E7A-A833-5068E79C76B3}.Debug|x86.ActiveCfg = Debug|Win32
+ {4C711A76-D47F-4E7A-A833-5068E79C76B3}.Debug|x86.Build.0 = Debug|Win32
+ {4C711A76-D47F-4E7A-A833-5068E79C76B3}.Release|x64.ActiveCfg = Release|x64
+ {4C711A76-D47F-4E7A-A833-5068E79C76B3}.Release|x64.Build.0 = Release|x64
+ {4C711A76-D47F-4E7A-A833-5068E79C76B3}.Release|x86.ActiveCfg = Release|Win32
+ {4C711A76-D47F-4E7A-A833-5068E79C76B3}.Release|x86.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {904A4AE0-A993-425B-BCED-3B0796A094DD}
+ EndGlobalSection
+EndGlobal
diff --git a/src/project/msvc/rba/rba.vcxproj b/src/project/msvc/rba/rba.vcxproj
new file mode 100644
index 0000000..b5c5a84
--- /dev/null
+++ b/src/project/msvc/rba/rba.vcxproj
@@ -0,0 +1,352 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\..\src\RBAAbstractAllocatable.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAbstractConstraint.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAbstractContent.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAbstractFactory.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAbstractProperty.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAbstractScene.cpp" />
+ <ClCompile Include="..\..\..\src\RBAActionOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAffectInfo.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllInstanceOfArea.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllInstanceOfAreaImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllInstanceOfSoundContent.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllInstanceOfSoundContentImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllInstanceOfViewContent.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllInstanceOfViewContentImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllInstanceOfZone.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllInstanceOfZoneImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllocatable.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllocatableOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllocatableSet.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllocatedContent.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAllocatedContentImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAndOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAndOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAnimationExecutor.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAnimationManager.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAnimationManagerImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAnimationQueue.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAnimationRequest.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAnimationRequestImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAArbitrator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAArbitratorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAArea.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAreaImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAreaOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAreaSet.cpp" />
+ <ClCompile Include="..\..\..\src\RBAAreaSetImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAArithmeticOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBABackUpAllocatable.cpp" />
+ <ClCompile Include="..\..\..\src\RBAConstraint.cpp" />
+ <ClCompile Include="..\..\..\src\RBAConstraintImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAConstraintInfo.cpp" />
+ <ClCompile Include="..\..\..\src\RBAContent.cpp" />
+ <ClCompile Include="..\..\..\src\RBAContentOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAContentSet.cpp" />
+ <ClCompile Include="..\..\..\src\RBAContentState.cpp" />
+ <ClCompile Include="..\..\..\src\RBAContentValue.cpp" />
+ <ClCompile Include="..\..\..\src\RBAContentValueImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBACoverageLog.cpp" />
+ <ClCompile Include="..\..\..\src\RBADefeats.cpp" />
+ <ClCompile Include="..\..\..\src\RBADefeatsImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBADisplay.cpp" />
+ <ClCompile Include="..\..\..\src\RBADisplayImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBADisplayingContent.cpp" />
+ <ClCompile Include="..\..\..\src\RBADisplayingContentImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAEventProcessing.cpp" />
+ <ClCompile Include="..\..\..\src\RBAEventProcessingImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAExclusiveOrOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAExclusiveOrOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAExistsOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAExistsOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAExpression.cpp" />
+ <ClCompile Include="..\..\..\src\RBAExpressionImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAForAllOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAForAllOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAGetAllocatables.cpp" />
+ <ClCompile Include="..\..\..\src\RBAGetAllocatablesImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAGetContentsList.cpp" />
+ <ClCompile Include="..\..\..\src\RBAGetContentsListImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAGetProperty.cpp" />
+ <ClCompile Include="..\..\..\src\RBAGetPropertyImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAHasComeEarlierThan.cpp" />
+ <ClCompile Include="..\..\..\src\RBAHasComeEarlierThanImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAHasComeLaterThan.cpp" />
+ <ClCompile Include="..\..\..\src\RBAHasComeLaterThanImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIfActionOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIfActionOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIfStatement.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIfStatementImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAILogCollector.cpp" />
+ <ClCompile Include="..\..\..\src\RBAImpliesOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAImpliesOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIntegerPropertyImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIntegerValue.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIntegerValueImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsActive.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsActiveImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsAttenuated.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsAttenuatedImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsCanceled.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsCanceledImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsDefeatedBy.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsDefeatedByImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsDisappeared.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsDisappearedImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsDisplayed.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsDisplayedImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsEqualToOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsEqualToOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsGreaterThanEqualOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsGreaterThanEqualOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsGreaterThanOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsHidden.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsHiddenImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsLowerThanEqualOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsLowerThanEqualOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsLowerThanOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsLowerThanOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsMuted.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsMutedImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsOn.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsOnImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsOutputted.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsOutputtedImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsSounding.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsSoundingImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsVisible.cpp" />
+ <ClCompile Include="..\..\..\src\RBAIsVisibleImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAJsonElement.cpp" />
+ <ClCompile Include="..\..\..\src\RBAJsonParser.cpp" />
+ <ClCompile Include="..\..\..\src\RBAJsonParserImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBALambdaContext.cpp" />
+ <ClCompile Include="..\..\..\src\RBALambdaExpression.cpp" />
+ <ClCompile Include="..\..\..\src\RBALambdaExpressionImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBALog.cpp" />
+ <ClCompile Include="..\..\..\src\RBALogicalOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBALogManager.cpp" />
+ <ClCompile Include="..\..\..\src\RBAModel.cpp" />
+ <ClCompile Include="..\..\..\src\RBAModelFactory.cpp" />
+ <ClCompile Include="..\..\..\src\RBAModelImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBANamedElement.cpp" />
+ <ClCompile Include="..\..\..\src\RBANotOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBANotOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAObject.cpp" />
+ <ClCompile Include="..\..\..\src\RBAObjectCompare.cpp" />
+ <ClCompile Include="..\..\..\src\RBAObjectCompareImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAObjectReference.cpp" />
+ <ClCompile Include="..\..\..\src\RBAObjectReferenceImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAOffScene.cpp" />
+ <ClCompile Include="..\..\..\src\RBAOffSceneImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAOnScene.cpp" />
+ <ClCompile Include="..\..\..\src\RBAOnSceneImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAOrOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAOrOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAOutputtingSound.cpp" />
+ <ClCompile Include="..\..\..\src\RBAOutputtingSoundImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAPackageableElement.cpp" />
+ <ClCompile Include="..\..\..\src\RBAPlusOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAPlusOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAPositionContainer.cpp" />
+ <ClCompile Include="..\..\..\src\RBAPositionContainerImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAPostConstraint.cpp" />
+ <ClCompile Include="..\..\..\src\RBAPostConstraintImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAPreviousModifier.cpp" />
+ <ClCompile Include="..\..\..\src\RBAPreviousModifierImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAPropertyOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAResult.cpp" />
+ <ClCompile Include="..\..\..\src\RBAResultImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAResultSet.cpp" />
+ <ClCompile Include="..\..\..\src\RBARollbacker.cpp" />
+ <ClCompile Include="..\..\..\src\RBARule.cpp" />
+ <ClCompile Include="..\..\..\src\RBARuleImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBARuleObject.cpp" />
+ <ClCompile Include="..\..\..\src\RBAScene.cpp" />
+ <ClCompile Include="..\..\..\src\RBASceneCondition.cpp" />
+ <ClCompile Include="..\..\..\src\RBASceneConditionImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBASceneImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBASceneOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBASetExpression.cpp" />
+ <ClCompile Include="..\..\..\src\RBASetOfOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBASetOfOperatorImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBASetOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBASetProperty.cpp" />
+ <ClCompile Include="..\..\..\src\RBASetPropertyImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBASize.cpp" />
+ <ClCompile Include="..\..\..\src\RBASizeImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBASoundContent.cpp" />
+ <ClCompile Include="..\..\..\src\RBASoundContentImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBASoundContentOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBASoundContentSet.cpp" />
+ <ClCompile Include="..\..\..\src\RBASoundContentSetImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBASoundContentState.cpp" />
+ <ClCompile Include="..\..\..\src\RBASoundContentStateImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAStateValue.cpp" />
+ <ClCompile Include="..\..\..\src\RBAStateValueImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAValueExpression.cpp" />
+ <ClCompile Include="..\..\..\src\RBAVariable.cpp" />
+ <ClCompile Include="..\..\..\src\RBAVariableImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAViewAction.cpp" />
+ <ClCompile Include="..\..\..\src\RBAViewContent.cpp" />
+ <ClCompile Include="..\..\..\src\RBAViewContentImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAViewContentOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAViewContentSet.cpp" />
+ <ClCompile Include="..\..\..\src\RBAViewContentSetImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAViewContentState.cpp" />
+ <ClCompile Include="..\..\..\src\RBAViewContentStateImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAViewMove.cpp" />
+ <ClCompile Include="..\..\..\src\RBAViewTransition.cpp" />
+ <ClCompile Include="..\..\..\src\RBAZone.cpp" />
+ <ClCompile Include="..\..\..\src\RBAZoneImpl.cpp" />
+ <ClCompile Include="..\..\..\src\RBAZoneOperator.cpp" />
+ <ClCompile Include="..\..\..\src\RBAZoneSet.cpp" />
+ <ClCompile Include="..\..\..\src\RBAZoneSetImpl.cpp" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <VCProjectVersion>15.0</VCProjectVersion>
+ <ProjectGuid>{4C711A76-D47F-4E7A-A833-5068E79C76B3}</ProjectGuid>
+ <RootNamespace>rba</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v141</PlatformToolset>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="Shared">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <IncludePath>..\..\..\include\rba;..\..\..\include\model;..\..\..\src;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
+ <TargetName>$(ProjectName)d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <IncludePath>..\..\..\include\rba;..\..\..\include\model;..\..\..\src;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <IncludePath>..\..\..\include\rba;..\..\..\include\model;..\..\..\src;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
+ <TargetName>$(ProjectName)32d</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <IncludePath>..\..\..\include\rba;..\..\..\include\model;..\..\..\src;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
+ <TargetName>$(ProjectName)32</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>copy "$(TargetPath)" ..\..\..\lib\.</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>Disabled</Optimization>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ </ClCompile>
+ <PostBuildEvent>
+ <Command>copy "$(TargetPath)" ..\..\..\lib\.</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <PostBuildEvent>
+ <Command>copy "$(TargetPath)" ..\..\..\lib\.</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <SDLCheck>true</SDLCheck>
+ <AdditionalOptions>/source-charset:utf-8 %(AdditionalOptions)</AdditionalOptions>
+ </ClCompile>
+ <Link>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ <PostBuildEvent>
+ <Command>copy "$(TargetPath)" ..\..\..\lib\.</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/public/RBAArea.cpp b/src/public/RBAArea.cpp
new file mode 100644
index 0000000..55aaea2
--- /dev/null
+++ b/src/public/RBAArea.cpp
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Area class definition
+ */
+
+#include "RBAArea.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/public/RBADisplay.cpp b/src/public/RBADisplay.cpp
new file mode 100644
index 0000000..90cf60b
--- /dev/null
+++ b/src/public/RBADisplay.cpp
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Display class definition
+ */
+
+#include "RBADisplay.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/public/RBADllExport.hpp b/src/public/RBADllExport.hpp
new file mode 100644
index 0000000..b5a950d
--- /dev/null
+++ b/src/public/RBADllExport.hpp
@@ -0,0 +1,35 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBADllExport.hpp
+/// @brief DLL_EXPORT definition file
+
+#ifndef RBADLLEXPORT_HPP
+#define RBADLLEXPORT_HPP
+
+#ifdef _MSC_VER
+ #ifndef DLL_EXPORT
+ #ifdef _WINDLL
+ #define DLL_EXPORT __declspec(dllexport)
+ #else
+ #define DLL_EXPORT __declspec(dllimport)
+ #endif
+ #endif
+#else
+ #define DLL_EXPORT
+#endif
+
+#endif
diff --git a/src/public/RBAModel.cpp b/src/public/RBAModel.cpp
new file mode 100644
index 0000000..71fadde
--- /dev/null
+++ b/src/public/RBAModel.cpp
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Mode class definition
+ */
+
+#include "RBAModel.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/public/RBAPositionContainer.cpp b/src/public/RBAPositionContainer.cpp
new file mode 100644
index 0000000..ed2f3f9
--- /dev/null
+++ b/src/public/RBAPositionContainer.cpp
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * PositionContainer class definition
+ */
+
+#include "RBAPositionContainer.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/public/RBAResult.cpp b/src/public/RBAResult.cpp
new file mode 100644
index 0000000..fabdc25
--- /dev/null
+++ b/src/public/RBAResult.cpp
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Arbitration result class definition
+ */
+
+#include "RBAResult.hpp"
+
+namespace rba {
+
+}
diff --git a/src/public/RBAScene.cpp b/src/public/RBAScene.cpp
new file mode 100644
index 0000000..a46453b
--- /dev/null
+++ b/src/public/RBAScene.cpp
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Scene class definition
+ */
+
+#include "RBAScene.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/public/RBASize.cpp b/src/public/RBASize.cpp
new file mode 100644
index 0000000..34fa800
--- /dev/null
+++ b/src/public/RBASize.cpp
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Size information class definition
+ */
+
+#include "RBASize.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/public/RBAZone.cpp b/src/public/RBAZone.cpp
new file mode 100644
index 0000000..268765b
--- /dev/null
+++ b/src/public/RBAZone.cpp
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Zone class definition
+ */
+
+#include "RBAZone.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/script/conv_release.py b/src/script/conv_release.py
new file mode 100644
index 0000000..24f62c4
--- /dev/null
+++ b/src/script/conv_release.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+
+import sys
+import re
+
+def convert_release():
+ skip_flag = False
+ for line in sys.stdin:
+ line = line.rstrip()
+ if not skip_flag:
+ if re.search(r'// +internal +{', line):
+ skip_flag = True
+ continue
+ else:
+ if re.search(r'// +}', line):
+ skip_flag = False
+ continue
+ print(line)
+
+if __name__ == '__main__':
+ convert_release()
+
+# end of file
diff --git a/src/script/make_dll_x64.bat b/src/script/make_dll_x64.bat
new file mode 100644
index 0000000..0b51c4d
--- /dev/null
+++ b/src/script/make_dll_x64.bat
@@ -0,0 +1,50 @@
+@echo off
+set ARCH=x64
+set LOG=OFF
+set MODE=%1
+
+if "%MODE%" == "" (
+ set MODE=Release
+)
+if not "%MODE%" == "Debug" (
+ if not "%MODE%" == "Release" (
+ echo Usage: %0 Debug or Release
+ goto end
+ )
+)
+set LOGLABEL=
+if "%LOG%" == "ON" (
+ set LOGLABEL=_log
+) else (
+ set LOGLABEL=
+)
+
+set CMAKE_OPTION=
+if "%ARCH%" == "x86" (
+ set CMAKE_OPTION="Visual Studio 15 2017"
+) else if "%ARCH%" == "x64" (
+ set CMAKE_OPTION="Visual Studio 15 2017 Win64"
+)
+
+set DIRNAME=build_%ARCH%%LOGLABEL%
+set OUTNAME=%MODE%_%ARCH%%LOGLABEL%
+
+if exist "%DIRNAME%\" (
+ goto exec_make
+)
+
+mkdir %DIRNAME%
+cd %DIRNAME%
+
+if "%LOG%" == "ON" (
+ cmake -G %CMAKE_OPTION% ..
+) else (
+ cmake -G %CMAKE_OPTION% -DNOLOG=1 ..
+)
+cd ..
+
+:exec_make
+cmake --build %DIRNAME% --config %MODE%
+
+:end
+echo done.
diff --git a/src/script/make_dll_x64_log.bat b/src/script/make_dll_x64_log.bat
new file mode 100644
index 0000000..414936d
--- /dev/null
+++ b/src/script/make_dll_x64_log.bat
@@ -0,0 +1,50 @@
+@echo off
+set ARCH=x64
+set LOG=ON
+set MODE=%1
+
+if "%MODE%" == "" (
+ set MODE=Release
+)
+if not "%MODE%" == "Debug" (
+ if not "%MODE%" == "Release" (
+ echo Usage: %0 Debug or Release
+ goto end
+ )
+)
+set LOGLABEL=
+if "%LOG%" == "ON" (
+ set LOGLABEL=_log
+) else (
+ set LOGLABEL=
+)
+
+set CMAKE_OPTION=
+if "%ARCH%" == "x86" (
+ set CMAKE_OPTION="Visual Studio 15 2017"
+) else if "%ARCH%" == "x64" (
+ set CMAKE_OPTION="Visual Studio 15 2017 Win64"
+)
+
+set DIRNAME=build_%ARCH%%LOGLABEL%
+set OUTNAME=%MODE%_%ARCH%%LOGLABEL%
+
+if exist "%DIRNAME%\" (
+ goto exec_make
+)
+
+mkdir %DIRNAME%
+cd %DIRNAME%
+
+if "%LOG%" == "ON" (
+ cmake -G %CMAKE_OPTION% ..
+) else (
+ cmake -G %CMAKE_OPTION% -DNOLOG=1 ..
+)
+cd ..
+
+:exec_make
+cmake --build %DIRNAME% --config %MODE%
+
+:end
+echo done.
diff --git a/src/script/make_dll_x86.bat b/src/script/make_dll_x86.bat
new file mode 100644
index 0000000..fa6f5ff
--- /dev/null
+++ b/src/script/make_dll_x86.bat
@@ -0,0 +1,50 @@
+@echo off
+set ARCH=x86
+set LOG=OFF
+set MODE=%1
+
+if "%MODE%" == "" (
+ set MODE=Release
+)
+if not "%MODE%" == "Debug" (
+ if not "%MODE%" == "Release" (
+ echo Usage: %0 Debug or Release
+ goto end
+ )
+)
+set LOGLABEL=
+if "%LOG%" == "ON" (
+ set LOGLABEL=_log
+) else (
+ set LOGLABEL=
+)
+
+set CMAKE_OPTION=
+if "%ARCH%" == "x86" (
+ set CMAKE_OPTION="Visual Studio 15 2017"
+) else if "%ARCH%" == "x64" (
+ set CMAKE_OPTION="Visual Studio 15 2017 Win64"
+)
+
+set DIRNAME=build_%ARCH%%LOGLABEL%
+set OUTNAME=%MODE%_%ARCH%%LOGLABEL%
+
+if exist "%DIRNAME%\" (
+ goto exec_make
+)
+
+mkdir %DIRNAME%
+cd %DIRNAME%
+
+if "%LOG%" == "ON" (
+ cmake -G %CMAKE_OPTION% ..
+) else (
+ cmake -G %CMAKE_OPTION% -DNOLOG=1 ..
+)
+cd ..
+
+:exec_make
+cmake --build %DIRNAME% --config %MODE%
+
+:end
+echo done.
diff --git a/src/script/make_dll_x86_log.bat b/src/script/make_dll_x86_log.bat
new file mode 100644
index 0000000..7d7d057
--- /dev/null
+++ b/src/script/make_dll_x86_log.bat
@@ -0,0 +1,50 @@
+@echo off
+set ARCH=x86
+set LOG=ON
+set MODE=%1
+
+if "%MODE%" == "" (
+ set MODE=Release
+)
+if not "%MODE%" == "Debug" (
+ if not "%MODE%" == "Release" (
+ echo Usage: %0 Debug or Release
+ goto end
+ )
+)
+set LOGLABEL=
+if "%LOG%" == "ON" (
+ set LOGLABEL=_log
+) else (
+ set LOGLABEL=_nolog
+)
+
+set CMAKE_OPTION=
+if "%ARCH%" == "x86" (
+ set CMAKE_OPTION="Visual Studio 15 2017"
+) else if "%ARCH%" == "x64" (
+ set CMAKE_OPTION="Visual Studio 15 2017 Win64"
+)
+
+set DIRNAME=build_%ARCH%%LOGLABEL%
+set OUTNAME=%MODE%_%ARCH%%LOGLABEL%
+
+if exist "%DIRNAME%\" (
+ goto exec_make
+)
+
+mkdir %DIRNAME%
+cd %DIRNAME%
+
+if "%LOG%" == "ON" (
+ cmake -G %CMAKE_OPTION% ..
+) else (
+ cmake -G %CMAKE_OPTION% -DNOLOG=1 ..
+)
+cd ..
+
+:exec_make
+cmake --build %DIRNAME% --config %MODE%
+
+:end
+echo done.
diff --git a/src/script/make_release.sh b/src/script/make_release.sh
new file mode 100644
index 0000000..5f7769d
--- /dev/null
+++ b/src/script/make_release.sh
@@ -0,0 +1,98 @@
+#!/bin/sh
+
+RELEASE_DIR=./release
+
+# Get SHA-1 first 6 chatacters
+dt=`date "+%Y%m%d"`
+sha1=`git rev-parse HEAD | cut -c 1-7`
+workdir=$RELEASE_DIR/${dt}_${sha1}/rba
+docdir=$RELEASE_DIR/$sha1/doc
+rbadir=`pwd`
+includedir=$workdir/include/rba
+libdir=$workdir/lib
+unittestdir=$workdir/unittest
+
+# Make work directory
+if [ ! -d $workdir ]; then
+ mkdir -p $workdir
+fi
+
+# if [ ! -d $docdir ]; then
+# mkdir -p $docdir
+# fi
+
+# Make librba
+builddir=./build_release
+if [ ! -d $builddir ]; then
+ mkdir -p $builddir
+fi
+
+pushd $builddir
+if [ -f CMakeCache.txt ]; then
+ /bin/rm -f CMakeCache.txt
+fi
+cmake -DNOLOG=1 -DRELEASE=1 ..
+make -j9
+popd
+
+# Copy lib files
+if [ ! -d $libdir ]; then
+ mkdir -p $libdir
+fi
+
+cp lib/librba.* $libdir/.
+
+# Copy header files
+if [ ! -d $includedir ]; then
+ mkdir -p $includedir
+fi
+
+for hppfile in `/bin/ls include/rba/*.hpp`; do
+ # remove internal region
+ anim=`echo $hppfile | grep "Animation"`
+ if [ -n "$anim" ]; then
+ continue
+ fi
+ cat $hppfile | python3 script/remove_internal.py > __tmp
+ /bin/mv -f __tmp $workdir/$hppfile
+done
+echo "Copy header files...done"
+
+# Copy unittest
+if [ -d $unittestdir ]; then
+ /bin/rm -fr $unittestdir
+fi
+/bin/mkdir -p $unittestdir
+/bin/cp -f unittest/BUILD.md $unittestdir/.
+/bin/cp -f unittest/main.cpp $unittestdir/.
+/bin/cp -f unittest/exec_unittest.bat $unittestdir/.
+#/bin/cp -f unittest/CMakeLists.txt $unittestdir/.
+echo "set(NOLOG TRUE)" > $unittestdir/CMakeLists.txt
+cat unittest/CMakeLists.txt >> $unittestdir/CMakeLists.txt
+
+/bin/mkdir -p $unittestdir/script
+/bin/cp -f unittest/script/install_gt.sh $unittestdir/script/.
+/bin/cp -f unittest/script/gtbuild.bat $unittestdir/script/.
+/bin/cp -f unittest/script/make_ut.bat $unittestdir/script/.
+
+/bin/cp -r unittest/logic_test $unittestdir/.
+/bin/cp -r unittest/api_test $unittestdir/.
+
+echo Copy unittest...done
+
+echo $workdir
+
+exit
+#
+# make document
+#
+pushd doc
+sh mkdoc.sh
+popd
+cp -r ./doc/work/rtf_en $docdir/.
+cp -r ./doc/work/rtf_jp $docdir/.
+
+echo Release directory is $workdir
+echo done
+
+# end of file
diff --git a/src/script/remove_comment.py b/src/script/remove_comment.py
new file mode 100644
index 0000000..673f3b3
--- /dev/null
+++ b/src/script/remove_comment.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+
+import sys
+import re
+
+def convert_release():
+ skip_flag = False
+ for line in sys.stdin:
+ line = line.rstrip()
+ if not skip_flag:
+ if re.search(r'// +remove +doxygen +{', line):
+ skip_flag = True
+ continue
+ else:
+ if re.search(r'// +}', line):
+ skip_flag = False
+ continue
+ print(line)
+
+if __name__ == '__main__':
+ convert_release()
+
+# end of file
diff --git a/src/script/remove_internal.py b/src/script/remove_internal.py
new file mode 100644
index 0000000..24f62c4
--- /dev/null
+++ b/src/script/remove_internal.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+
+import sys
+import re
+
+def convert_release():
+ skip_flag = False
+ for line in sys.stdin:
+ line = line.rstrip()
+ if not skip_flag:
+ if re.search(r'// +internal +{', line):
+ skip_flag = True
+ continue
+ else:
+ if re.search(r'// +}', line):
+ skip_flag = False
+ continue
+ print(line)
+
+if __name__ == '__main__':
+ convert_release()
+
+# end of file
diff --git a/src/sound/RBAAllInstanceOfSoundContent.cpp b/src/sound/RBAAllInstanceOfSoundContent.cpp
new file mode 100644
index 0000000..181fb7b
--- /dev/null
+++ b/src/sound/RBAAllInstanceOfSoundContent.cpp
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AllInstanceOfSoundContent class
+ */
+
+#include "RBAAllInstanceOfSoundContent.hpp"
+#include "RBASoundContentImpl.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void
+RBAAllInstanceOfSoundContent::accept(RBAExpressionVisitor& visitor)
+{
+ // RBASceneAllocatableCollector, the only existing visitor at this time,
+ // does not accept this set of "For-All", "Exists", so it does not pass
+ // this path.
+ // It is implemented because another visitor may accept it in the future.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAAllInstanceOfSoundContent::getModelElementType() const
+{
+ return RBAModelElementType::AllInstanceOfSoundContent;
+}
+
+const RBARuleObject*
+RBAAllInstanceOfSoundContent::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ return &allSoundContentSet_;
+}
+
+void
+RBAAllInstanceOfSoundContent::setContents(const std::list<const RBASoundContentImpl*>& contents)
+{
+ for(auto& cont : contents) {
+ allSoundContentSet_.addTarget(cont);
+ }
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAAllInstanceOfSoundContent::getExpressionText() const
+{
+ return "ALL_SOUNDCONTENTS";
+}
+
+const std::string
+RBAAllInstanceOfSoundContent::getCoverageExpressionText() const
+{
+ return getExpressionText();
+}
+#endif
+
+}
diff --git a/src/sound/RBAAllInstanceOfSoundContent.hpp b/src/sound/RBAAllInstanceOfSoundContent.hpp
new file mode 100644
index 0000000..08ea67f
--- /dev/null
+++ b/src/sound/RBAAllInstanceOfSoundContent.hpp
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AllInstanceOfSoundContent class header
+ */
+
+#ifndef RBAALLINSRTANCEOFSOUNDCONTENTIMPL_HPP
+#define RBAALLINSRTANCEOFSOUNDCONTENTIMPL_HPP
+
+#include "RBASetExpression.hpp"
+#include "RBASoundContentSet.hpp"
+
+namespace rba {
+
+class DLL_EXPORT RBAAllInstanceOfSoundContent : public RBASetExpression
+{
+public:
+ RBAAllInstanceOfSoundContent()=default;
+ RBAAllInstanceOfSoundContent(const RBAAllInstanceOfSoundContent&)=delete;
+ RBAAllInstanceOfSoundContent(const RBAAllInstanceOfSoundContent&&)=delete;
+ RBAAllInstanceOfSoundContent& operator=(const RBAAllInstanceOfSoundContent&)=delete;
+ RBAAllInstanceOfSoundContent& operator=(const RBAAllInstanceOfSoundContent&&)=delete;
+ virtual ~RBAAllInstanceOfSoundContent()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+ void setContents(const std::list<const RBASoundContentImpl*>& contents);
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+
+private:
+ RBASoundContentSet allSoundContentSet_;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAAllInstanceOfSoundContentMaker.cpp b/src/sound/RBAAllInstanceOfSoundContentMaker.cpp
new file mode 100644
index 0000000..b08f6b2
--- /dev/null
+++ b/src/sound/RBAAllInstanceOfSoundContentMaker.cpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAAllInstanceOfSoundContentMaker.cpp
+/// @brief AllInstanceOfSoundContent object generator class
+
+#include <iostream>
+#include "RBAAllInstanceOfSoundContentMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAAllInstanceOfSoundContent.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAAllInstanceOfSoundContentMaker::RBAAllInstanceOfSoundContentMaker()
+ : RBAExpressionMaker{"AllInstanceOfSoundContent"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAAllInstanceOfSoundContentMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAAllInstanceOfSoundContent>();
+}
+
+RBAModelElement*
+RBAAllInstanceOfSoundContentMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBAAllInstanceOfSoundContent* const allSoundCont
+ {dynamic_cast<RBAAllInstanceOfSoundContent*>(element)};
+
+ // Set sound content
+ allSoundCont->setContents(model->getSoundContentImpls());
+
+ return allSoundCont;
+}
+
+}
diff --git a/src/sound/RBAAllInstanceOfSoundContentMaker.hpp b/src/sound/RBAAllInstanceOfSoundContentMaker.hpp
new file mode 100644
index 0000000..ff03da6
--- /dev/null
+++ b/src/sound/RBAAllInstanceOfSoundContentMaker.hpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAAllInstanceOfSoundContentMaker.hpp
+/// @brief AllInstanceOfSoundContent object generator class header
+
+#ifndef RBAALLINSTANCEOFSOUNDCONTENTMAKER_HPP
+#define RBAALLINSTANCEOFSOUNDCONTENTMAKER_HPP
+
+#include "RBAExpressionMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+class RBAAllInstanceOfSoundContentMaker : public RBAExpressionMaker
+{
+public:
+ RBAAllInstanceOfSoundContentMaker();
+ RBAAllInstanceOfSoundContentMaker(const RBAAllInstanceOfSoundContentMaker&)=delete;
+ RBAAllInstanceOfSoundContentMaker(const RBAAllInstanceOfSoundContentMaker&&)=delete;
+ RBAAllInstanceOfSoundContentMaker& operator=(const RBAAllInstanceOfSoundContentMaker&)=delete;
+ RBAAllInstanceOfSoundContentMaker& operator=(const RBAAllInstanceOfSoundContentMaker&&)=delete;
+ virtual ~RBAAllInstanceOfSoundContentMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAAllInstanceOfZone.cpp b/src/sound/RBAAllInstanceOfZone.cpp
new file mode 100644
index 0000000..e50768c
--- /dev/null
+++ b/src/sound/RBAAllInstanceOfZone.cpp
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AllInstanceOfZone class
+ */
+
+#include "RBAAllInstanceOfZone.hpp"
+#include "RBAZoneImpl.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void
+RBAAllInstanceOfZone::accept(RBAExpressionVisitor& visitor)
+{
+ // RBASceneAllocatableCollector, the only existing visitor at this time,
+ // does not accept this set of "For-All", "Exists", so it does not pass
+ // this path.
+ // It is implemented because another visitor may accept it in the future.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAAllInstanceOfZone::getModelElementType() const
+{
+ return RBAModelElementType::AllInstanceOfZone;
+}
+
+const RBARuleObject*
+RBAAllInstanceOfZone::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ return &allZoneSet_;
+}
+
+void
+RBAAllInstanceOfZone::setZones(const std::list<const RBAZoneImpl*> zones)
+{
+ for (auto& content : zones) {
+ allZoneSet_.addTarget(content);
+ }
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAAllInstanceOfZone::getExpressionText() const
+{
+ return "ALL_ZONES";
+}
+
+const std::string
+RBAAllInstanceOfZone::getCoverageExpressionText() const
+{
+ return getExpressionText();
+}
+#endif
+
+}
diff --git a/src/sound/RBAAllInstanceOfZone.hpp b/src/sound/RBAAllInstanceOfZone.hpp
new file mode 100644
index 0000000..73f15a4
--- /dev/null
+++ b/src/sound/RBAAllInstanceOfZone.hpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AllInstanceOfZone class header
+ */
+
+#ifndef RBAALLINSTANCEOFZONE_HPP
+#define RBAALLINSTANCEOFZONE_HPP
+
+#include "RBASetExpression.hpp"
+#include "RBAZoneSet.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAAllInstanceOfZone : public RBASetExpression
+{
+public:
+ RBAAllInstanceOfZone()=default;
+ RBAAllInstanceOfZone(const RBAAllInstanceOfZone&)=delete;
+ RBAAllInstanceOfZone(const RBAAllInstanceOfZone&&)=delete;
+ RBAAllInstanceOfZone& operator=(const RBAAllInstanceOfZone&)=delete;
+ RBAAllInstanceOfZone& operator=(const RBAAllInstanceOfZone&&)=delete;
+ virtual ~RBAAllInstanceOfZone()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+ void setZones(const std::list<const RBAZoneImpl*> zones);
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+
+private:
+ RBAZoneSet allZoneSet_;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAAllInstanceOfZoneMaker.cpp b/src/sound/RBAAllInstanceOfZoneMaker.cpp
new file mode 100644
index 0000000..7283a7a
--- /dev/null
+++ b/src/sound/RBAAllInstanceOfZoneMaker.cpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAAllInstanceOfZoneMaker.cpp
+/// @brief AllInstanceOfZone object generator class
+
+#include <iostream>
+#include "RBAAllInstanceOfZoneMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAAllInstanceOfZone.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAAllInstanceOfZoneMaker::RBAAllInstanceOfZoneMaker()
+ : RBAExpressionMaker{"AllInstanceOfZone"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAAllInstanceOfZoneMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAAllInstanceOfZone>();
+}
+
+RBAModelElement*
+RBAAllInstanceOfZoneMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBAAllInstanceOfZone* const allInstZone
+ {dynamic_cast<RBAAllInstanceOfZone*>(element)};
+
+ // Set zone
+ allInstZone->setZones(model->getZoneImpls());
+
+ return allInstZone;
+}
+
+}
diff --git a/src/sound/RBAAllInstanceOfZoneMaker.hpp b/src/sound/RBAAllInstanceOfZoneMaker.hpp
new file mode 100644
index 0000000..738a95e
--- /dev/null
+++ b/src/sound/RBAAllInstanceOfZoneMaker.hpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAAllInstanceOfZoneMaker.hpp
+/// @brief AllInstanceOfZone object generator class header
+
+#ifndef RBAALLINSTANCEOFZONEMAKER_HPP
+#define RBAALLINSTANCEOFZONEMAKER_HPP
+
+#include "RBAExpressionMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief AllInstanceOfZone object generator class
+class RBAAllInstanceOfZoneMaker : public RBAExpressionMaker
+{
+public:
+ RBAAllInstanceOfZoneMaker();
+ RBAAllInstanceOfZoneMaker(const RBAAllInstanceOfZoneMaker&)=delete;
+ RBAAllInstanceOfZoneMaker(const RBAAllInstanceOfZoneMaker&&)=delete;
+ RBAAllInstanceOfZoneMaker& operator=(const RBAAllInstanceOfZoneMaker&)=delete;
+ RBAAllInstanceOfZoneMaker& operator=(const RBAAllInstanceOfZoneMaker&&)=delete;
+ virtual ~RBAAllInstanceOfZoneMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAIsAttenuated.cpp b/src/sound/RBAIsAttenuated.cpp
new file mode 100644
index 0000000..cf55890
--- /dev/null
+++ b/src/sound/RBAIsAttenuated.cpp
@@ -0,0 +1,135 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// IsAttenuated class
+
+#include "RBAIsAttenuated.hpp"
+
+#include "RBAExpression.hpp"
+#include "RBAZoneImpl.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAResultImpl.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAIsAttenuated::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsAttenuated::getModelElementType() const
+{
+ return RBAModelElementType::IsAttenuated;
+}
+
+bool
+RBAIsAttenuated::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj
+ {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+ if ((leftInfo->isExceptionBeforeArbitrate() ) || (ruleObj == nullptr)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ const RBAZoneImpl* const zone {dynamic_cast<const RBAZoneImpl*>(ruleObj->getRawObject())};
+ info->addOperandAllocatable(zone);
+ if (ruleObj->isPrevious() == true) {
+ isPassed = arb->getResult()->isPreAttenuated(zone);
+ } else {
+ if (zone->isAttenuateChecked() == true) {
+ isPassed = zone->isAttenuated();
+ if (isPassed == true) {
+ info->addTrueAllocatable(zone);
+ } else {
+ info->addFalseAllocatable(zone);
+ }
+ } else {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ }
+ }
+#ifdef RBA_USE_LOG
+ if (ruleObj != nullptr) {
+ const RBAZoneImpl* zone = dynamic_cast<const RBAZoneImpl*>(ruleObj
+ ->getRawObject());
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + getPreMsg(ruleObj->isPrevious()) + zone->getName()
+ + getSymbol() + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + getPreMsg(ruleObj->isPrevious()) + zone->getName()
+ + getSymbol() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + getPreMsg(ruleObj->isPrevious()) + zone->getName()
+ + getSymbol() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+ } else {
+ // At the moment, there is no expression that returns null as an Allocable,
+ // so it will not go through this path.
+ // This is implmented because we may add an expression that returns null,
+ // in the future.
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + getPreMsg(ruleObj->isPrevious()) + "NULL" + getSymbol()
+ + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + getPreMsg(ruleObj->isPrevious()) + "NULL" + getSymbol()
+ + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+ }
+#endif
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsAttenuated::getSymbol() const
+{
+ return ".isAttenuated()";
+}
+
+RBAExpressionType
+RBAIsAttenuated::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/sound/RBAIsAttenuated.hpp b/src/sound/RBAIsAttenuated.hpp
new file mode 100644
index 0000000..2ed62b2
--- /dev/null
+++ b/src/sound/RBAIsAttenuated.hpp
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * IsAttenuated class header
+ */
+
+#ifndef RBAISATTENUATED_HPP
+#define RBAISATTENUATED_HPP
+
+#include "RBAZoneOperator.hpp"
+
+namespace rba
+{
+
+class RBAExpression;
+
+class DLL_EXPORT RBAIsAttenuated : public RBAZoneOperator
+{
+public:
+ RBAIsAttenuated()=default;
+ RBAIsAttenuated(const RBAIsAttenuated&)=delete;
+ RBAIsAttenuated(const RBAIsAttenuated&&)=delete;
+ RBAIsAttenuated& operator=(const RBAIsAttenuated&)=delete;
+ RBAIsAttenuated& operator=(const RBAIsAttenuated&&)=delete;
+ virtual ~RBAIsAttenuated()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAIsAttenuatedMaker.cpp b/src/sound/RBAIsAttenuatedMaker.cpp
new file mode 100644
index 0000000..625d4f2
--- /dev/null
+++ b/src/sound/RBAIsAttenuatedMaker.cpp
@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsAttenuatedMaker.cpp
+/// @brief IsAttenuated object generator class
+
+#include <iostream>
+#include "RBAIsAttenuatedMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAIsAttenuated.hpp"
+
+namespace rba
+{
+
+RBAIsAttenuatedMaker::RBAIsAttenuatedMaker()
+ : RBAOperatorMaker{"IsAttenuated"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsAttenuatedMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsAttenuated>();
+}
+
+}
diff --git a/src/sound/RBAIsAttenuatedMaker.hpp b/src/sound/RBAIsAttenuatedMaker.hpp
new file mode 100644
index 0000000..30b9132
--- /dev/null
+++ b/src/sound/RBAIsAttenuatedMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsAttenuatedMaker.hpp
+/// @brief IsAttenuated object generator class header
+
+#ifndef RBAISATTENUATEDMAKER_HPP
+#define RBAISATTENUATEDMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief IsAttenuated object generator class
+class RBAIsAttenuatedMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsAttenuatedMaker();
+ RBAIsAttenuatedMaker(const RBAIsAttenuatedMaker&)=delete;
+ RBAIsAttenuatedMaker(const RBAIsAttenuatedMaker&&)=delete;
+ RBAIsAttenuatedMaker& operator=(const RBAIsAttenuatedMaker&)=delete;
+ RBAIsAttenuatedMaker& operator=(const RBAIsAttenuatedMaker&&)=delete;
+ virtual ~RBAIsAttenuatedMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAIsMuted.cpp b/src/sound/RBAIsMuted.cpp
new file mode 100644
index 0000000..1555137
--- /dev/null
+++ b/src/sound/RBAIsMuted.cpp
@@ -0,0 +1,124 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// IsMuted class
+
+#include "RBAIsMuted.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAResultImpl.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAIsMuted::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsMuted::getModelElementType() const
+{
+ return RBAModelElementType::IsMuted;
+}
+
+bool
+RBAIsMuted::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj
+ {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+ if ((leftInfo->isExceptionBeforeArbitrate()) || (ruleObj == nullptr)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ const RBAAllocatable* const zone {dynamic_cast<const RBAAllocatable*>(ruleObj->getRawObject())};
+ info->addOperandAllocatable(zone);
+ if (ruleObj->isPrevious() == false) {
+ if (zone->isHiddenChecked() == false) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (zone->isHidden() == true) {
+ isPassed = true;
+ info->addTrueAllocatable(zone);
+ } else {
+ info->addFalseAllocatable(zone);
+ }
+ } else {
+ isPassed = arb->getResult()->isPreHidden(zone);
+ }
+ }
+#ifdef RBA_USE_LOG
+ if (ruleObj != nullptr) {
+ const RBAAllocatable* zone = dynamic_cast<const RBAAllocatable*>(ruleObj
+ ->getRawObject());
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + zone->getElementName() + getSymbol()
+ + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + getPreMsg(ruleObj->isPrevious()) + zone->getElementName()
+ + getSymbol() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + getPreMsg(ruleObj->isPrevious()) + zone->getElementName()
+ + getSymbol() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+ } else {
+ // At the moment, there is no expression that returns null as an Allocable,
+ // so it will not go through this path.
+ // This is implmented because we may add an expression that returns null,
+ // in the future.
+ LOG_arbitrateConstraintLogicLogLine(
+ " [NULL" + getSymbol() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsMuted::getSymbol() const
+{
+ return ".isMuted()";
+}
+
+RBAExpressionType
+RBAIsMuted::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/sound/RBAIsMuted.hpp b/src/sound/RBAIsMuted.hpp
new file mode 100644
index 0000000..71b9d94
--- /dev/null
+++ b/src/sound/RBAIsMuted.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * IsMuted class header
+ */
+
+#ifndef RBAISMUTED_HPP
+#define RBAISMUTED_HPP
+
+#include <string>
+#include "RBAZoneOperator.hpp"
+
+namespace rba
+{
+
+class RBAExpression;
+
+class DLL_EXPORT RBAIsMuted : public RBAZoneOperator
+{
+public:
+ RBAIsMuted()=default;
+ RBAIsMuted(const RBAIsMuted&)=delete;
+ RBAIsMuted(const RBAIsMuted&&)=delete;
+ RBAIsMuted& operator=(const RBAIsMuted&)=delete;
+ RBAIsMuted& operator=(const RBAIsMuted&&)=delete;
+ virtual ~RBAIsMuted()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAIsMutedMaker.cpp b/src/sound/RBAIsMutedMaker.cpp
new file mode 100644
index 0000000..8165635
--- /dev/null
+++ b/src/sound/RBAIsMutedMaker.cpp
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsMutedMaker.cpp
+/// @brief IsMuted object generator class
+
+#include "RBAIsMutedMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAIsMuted.hpp"
+
+namespace rba
+{
+
+RBAIsMutedMaker::RBAIsMutedMaker()
+ : RBAOperatorMaker{"IsMuted"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsMutedMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsMuted>();
+}
+
+}
diff --git a/src/sound/RBAIsMutedMaker.hpp b/src/sound/RBAIsMutedMaker.hpp
new file mode 100644
index 0000000..3f954c5
--- /dev/null
+++ b/src/sound/RBAIsMutedMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsMutedMaker.hpp
+/// @brief IsMuted object generator class header
+
+#ifndef RBAISMUTEDMAKER_HPP
+#define RBAISMUTEDMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief IsMuted object generator class
+class RBAIsMutedMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsMutedMaker();
+ RBAIsMutedMaker(const RBAIsMutedMaker&)=delete;
+ RBAIsMutedMaker(const RBAIsMutedMaker&&)=delete;
+ RBAIsMutedMaker& operator=(const RBAIsMutedMaker&)=delete;
+ RBAIsMutedMaker& operator=(const RBAIsMutedMaker&&)=delete;
+ virtual ~RBAIsMutedMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAIsOutputted.cpp b/src/sound/RBAIsOutputted.cpp
new file mode 100644
index 0000000..f99d8d5
--- /dev/null
+++ b/src/sound/RBAIsOutputted.cpp
@@ -0,0 +1,144 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// IsOutputted class
+
+#include "RBAIsOutputted.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAZoneImpl.hpp"
+#include "RBAResultImpl.hpp"
+#include "RBAContentState.hpp"
+#include "RBAContent.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAIsOutputted::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsOutputted::getModelElementType() const
+{
+ return RBAModelElementType::IsOutputted;
+}
+
+bool
+RBAIsOutputted::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj
+ {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+ if ((leftInfo->isExceptionBeforeArbitrate()) || (ruleObj == nullptr)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ const RBAAllocatable* const zone {dynamic_cast<const RBAAllocatable*>(ruleObj->getRawObject())};
+ info->addOperandAllocatable(zone);
+ if (ruleObj->isPrevious() == true) {
+ if ((arb->getResult()->isPreHidden(zone) == false)
+ && (arb->getResult()->getPreAllocatedContentState(zone) != nullptr)) {
+ isPassed = true;
+ }
+ } else {
+ if ((zone->isHiddenChecked()==true) && (zone->isHidden()==true)) {
+ info->addFalseAllocatable(zone);
+ } else {
+ if (zone->isChecked()) {
+ if (zone->getState() != nullptr) {
+ info->clearFalseAllocatable();
+ info->addTrueAllocatable(zone);
+ isPassed = true;
+ } else {
+ info->addFalseAllocatable(zone);
+ }
+ } else {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ }
+ }
+ }
+#ifdef RBA_USE_LOG
+ if (ruleObj != nullptr) {
+ const RBAAllocatable* zone = dynamic_cast<const RBAAllocatable*>(ruleObj
+ ->getRawObject());
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " Zone[" + zone->getElementName()
+ + "] is before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ const RBAContentState* contentState;
+ if (ruleObj->isPrevious() == true) {
+ contentState = arb->getResult()->getPreAllocatedContentState(zone);
+ } else {
+ contentState = zone->getState();
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Zone["
+ + zone->getElementName() + "] is Outputted Content["
+ + contentState->getOwner()->getElementName() + "::"
+ + contentState->getElementName() + "]");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Zone["
+ + zone->getElementName() + "] is not Outputted");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+ } else if (info->isExceptionBeforeArbitrate() == true) {
+ // At the moment, there is no expression that returns null as an Allocable,
+ // so it will not go through this path.
+ // This is implmented because we may add an expression that returns null,
+ // in the future.
+ LOG_arbitrateConstraintLogicLogLine(
+ " Zone[NULL] is not Outputted");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsOutputted::getSymbol() const
+{
+ return ".isOutputted()";
+}
+
+RBAExpressionType
+RBAIsOutputted::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/sound/RBAIsOutputted.hpp b/src/sound/RBAIsOutputted.hpp
new file mode 100644
index 0000000..995527c
--- /dev/null
+++ b/src/sound/RBAIsOutputted.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * IsOutputted class header
+ */
+
+#ifndef RBAISOUTPUTTED_HPP
+#define RBAISOUTPUTTED_HPP
+
+#include <string>
+#include "RBAZoneOperator.hpp"
+
+namespace rba
+{
+
+class RBAExpression;
+
+class DLL_EXPORT RBAIsOutputted : public RBAZoneOperator
+{
+public:
+ RBAIsOutputted()=default;
+ RBAIsOutputted(const RBAIsOutputted&)=delete;
+ RBAIsOutputted(const RBAIsOutputted&&)=delete;
+ RBAIsOutputted& operator=(const RBAIsOutputted&)=delete;
+ RBAIsOutputted& operator=(const RBAIsOutputted&&)=delete;
+ virtual ~RBAIsOutputted()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAIsOutputtedMaker.cpp b/src/sound/RBAIsOutputtedMaker.cpp
new file mode 100644
index 0000000..844fd27
--- /dev/null
+++ b/src/sound/RBAIsOutputtedMaker.cpp
@@ -0,0 +1,42 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsOutputtedMaker.cpp
+/// @brief IsOutputted object generator class
+
+#include <iostream>
+#include "RBAIsOutputtedMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAIsOutputted.hpp"
+
+namespace rba
+{
+
+RBAIsOutputtedMaker::RBAIsOutputtedMaker()
+ : RBAOperatorMaker{"IsOutputted"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsOutputtedMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsOutputted>();
+}
+
+
+}
diff --git a/src/sound/RBAIsOutputtedMaker.hpp b/src/sound/RBAIsOutputtedMaker.hpp
new file mode 100644
index 0000000..cf31e7f
--- /dev/null
+++ b/src/sound/RBAIsOutputtedMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsOutputtedMaker.hpp
+/// @brief IsOutputted object generator class header
+
+#ifndef RBAISOUTPUTTEDMAKER_HPP
+#define RBAISOUTPUTTEDMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief IsOutputted object generator class
+class RBAIsOutputtedMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsOutputtedMaker();
+ RBAIsOutputtedMaker(const RBAIsOutputtedMaker&)=delete;
+ RBAIsOutputtedMaker(const RBAIsOutputtedMaker&&)=delete;
+ RBAIsOutputtedMaker& operator=(const RBAIsOutputtedMaker&)=delete;
+ RBAIsOutputtedMaker& operator=(const RBAIsOutputtedMaker&&)=delete;
+ virtual ~RBAIsOutputtedMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAIsSounding.cpp b/src/sound/RBAIsSounding.cpp
new file mode 100644
index 0000000..a4ab4c4
--- /dev/null
+++ b/src/sound/RBAIsSounding.cpp
@@ -0,0 +1,161 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// IsSounding class
+
+#include <algorithm>
+
+#include "RBAAllocatable.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentState.hpp"
+#include "RBAExecuteResult.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAIsSounding.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAResultImpl.hpp"
+
+namespace rba
+{
+
+void
+RBAIsSounding::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsSounding::getModelElementType() const
+{
+ return RBAModelElementType::IsSounding;
+}
+
+bool
+RBAIsSounding::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to the constraint hierarchy for coverage
+ LOG_addHierarchy(getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj
+ {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+ const RBAContent* content {nullptr};
+ if (ruleObj != nullptr) {
+ content = dynamic_cast<const RBAContent*>(ruleObj->getRawObject());
+ }
+ if (leftInfo->isExceptionBeforeArbitrate() || (content == nullptr)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (ruleObj->isPrevious() == false) {
+ const RBAContentState* const contentState
+ {arb->getResult()->getActiveState(content)};
+ if (contentState != nullptr) {
+ for(const RBAAllocatable* const allocatable : content->getAllocatables()) {
+ info->addOperandAllocatable(allocatable);
+ if (allocatable->isChecked() == true) {
+ const RBAContentState* const allocateContentState {allocatable->getState()};
+ if (contentState == allocateContentState) {
+ if ((allocatable->isHiddenChecked() == true)
+ && (allocatable->isHidden() == true)) {
+ info->addFalseAllocatable(allocatable);
+ } else {
+ info->setExceptionBeforeArbitrate(false);
+ info->clearFalseAllocatable();
+ info->addTrueAllocatable(allocatable);
+ isPassed = true;
+ break;
+ }
+ } else {
+ info->addFalseAllocatable(allocatable);
+ }
+ } else {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ }
+ } else{
+ for(const auto a:content->getAllocatables()){
+ info->addFalseAllocatable(a);
+ }
+ }
+ } else {
+ const RBAContentState* const contentState
+ {arb->getResult()->getPreActiveState(content)};
+ if (contentState != nullptr) {
+ for(const RBAAllocatable* const allocatable : content->getAllocatables()) {
+ info->addOperandAllocatable(allocatable);
+ const RBAContentState* const allocateContentState
+ {arb->getResult()->getPreAllocatedContentState(allocatable)};
+ if ((contentState == allocateContentState)
+ && (arb->getResult()->isPreHidden(allocatable) == false)) {
+ isPassed = true;
+ }
+ }
+ }
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate() == true) {
+ if (content != nullptr) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " Content[" + content->getElementName()
+ + "] before arbitrate skip");
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " Content[NULL] before arbitrate skip");
+ }
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ const RBAContentState* contentState;
+ if (ruleObj->isPrevious() == false) {
+ contentState = arb->getResult()->getActiveState(content);
+ } else {
+ contentState = arb->getResult()->getPreActiveState(content);
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Content["
+ + content->getElementName() + "::" + contentState->getElementName()
+ + "] is Sounding");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Content["
+ + content->getElementName() + "] is not Sounding");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from the constraint hierarchy for coverage
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsSounding::getSymbol() const
+{
+ return ".isSounding()";
+}
+
+RBAExpressionType RBAIsSounding::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/sound/RBAIsSounding.hpp b/src/sound/RBAIsSounding.hpp
new file mode 100644
index 0000000..45aa0ed
--- /dev/null
+++ b/src/sound/RBAIsSounding.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// IsSounding class header
+
+#ifndef RBAISSOUNDING_HPP
+#define RBAISSOUNDING_HPP
+
+#include <string>
+#include "RBASoundContentOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAIsSounding : public RBASoundContentOperator
+{
+public:
+ RBAIsSounding()=default;
+ RBAIsSounding(const RBAIsSounding&)=delete;
+ RBAIsSounding(const RBAIsSounding&&)=delete;
+ RBAIsSounding& operator=(const RBAIsSounding&)=delete;
+ RBAIsSounding& operator=(const RBAIsSounding&&)=delete;
+ virtual ~RBAIsSounding()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAIsSoundingMaker.cpp b/src/sound/RBAIsSoundingMaker.cpp
new file mode 100644
index 0000000..c00981e
--- /dev/null
+++ b/src/sound/RBAIsSoundingMaker.cpp
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsSoundingMaker.cpp
+/// @brief IsSounding object generator class
+
+#include "RBAIsSoundingMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAIsSounding.hpp"
+
+namespace rba
+{
+
+RBAIsSoundingMaker::RBAIsSoundingMaker()
+ : RBAOperatorMaker{"IsSounding"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsSoundingMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsSounding>();
+}
+
+}
diff --git a/src/sound/RBAIsSoundingMaker.hpp b/src/sound/RBAIsSoundingMaker.hpp
new file mode 100644
index 0000000..764967b
--- /dev/null
+++ b/src/sound/RBAIsSoundingMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsSoundingMaker.hpp
+/// @brief IsSounding object generator class header
+
+#ifndef RBAISSOUNDINGMAKER_HPP
+#define RBAISSOUNDINGMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief IsSounding object generator class
+class RBAIsSoundingMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsSoundingMaker();
+ RBAIsSoundingMaker(const RBAIsSoundingMaker&)=delete;
+ RBAIsSoundingMaker(const RBAIsSoundingMaker&&)=delete;
+ RBAIsSoundingMaker& operator=(const RBAIsSoundingMaker&)=delete;
+ RBAIsSoundingMaker& operator=(const RBAIsSoundingMaker&&)=delete;
+ virtual ~RBAIsSoundingMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAOutputtingSound.cpp b/src/sound/RBAOutputtingSound.cpp
new file mode 100644
index 0000000..14d1567
--- /dev/null
+++ b/src/sound/RBAOutputtingSound.cpp
@@ -0,0 +1,139 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ /**
+ * OutputtingSound class implementation
+ */
+
+#include "RBAOutputtingSound.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentState.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAResultImpl.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBAOutputtingSound::accept(RBAExpressionVisitor& visitor)
+{
+ // RBASceneAllocatableCollector, the only existing visitor at this time,
+ // does not accept expression that returns RBARuleObject, so it does not pass
+ // this path.
+ // It is implemented because another visitor may accept it in the future.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAOutputtingSound::getModelElementType() const
+{
+ return RBAModelElementType::OutputtingSound;
+}
+
+const RBARuleObject*
+RBAOutputtingSound::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ const RBARuleObject* object {nullptr};
+ const auto leftInfo = info->getChild(0U);
+ const auto ruleObj = getLhsOperand()->getReferenceObject(leftInfo, arb);
+ if (!leftInfo->isExceptionBeforeArbitrate()) {
+ if (ruleObj != nullptr) {
+ const RBAAllocatable* const alloc {dynamic_cast<const RBAAllocatable*>(ruleObj->getRawObject())};
+ if (ruleObj->isPrevious()) {
+ if (!arb->getResult()->isPreHidden(alloc)) {
+ const auto contentState = arb->getResult()->getDirectPreContentState(alloc);
+ if (contentState != nullptr) {
+ object = contentState->getOwner();
+ }
+ }
+ } else {
+ if (!alloc->isChecked()) {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ // When "Hidden" judgment is not executed, or when "Hidden" is already
+ // judged and "Hidden" is false, contentState assigned to allocatable
+ // is acquired.
+ else if (!alloc->isHiddenChecked() || !alloc->isHidden()) {
+ const auto contentState = alloc->getState();
+ if (contentState != nullptr) {
+ object = contentState->getOwner();
+ }
+ // At this point, it is unknown whether the constraint expression
+ // will be False or True, so put it in both.
+ info->addFalseAllocatable(alloc);
+ info->addTrueAllocatable(alloc);
+ } else {
+ ;
+ }
+ }
+ }
+ } else {
+ info->setExceptionBeforeArbitrate(true);
+ }
+#ifdef RBA_USE_LOG
+ bool pre = false;
+ std::string operandName;
+ std::string resultText;
+ if (ruleObj == nullptr) {
+ operandName = "NULL";
+ } else {
+ pre = ruleObj->isPrevious();
+ operandName = ruleObj->getElementName();
+ }
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ resultText = "is before arbitrate skip";
+ } else if (object == nullptr) {
+ if((ruleObj != nullptr) && dynamic_cast<const RBAAllocatable*>(ruleObj->getRawObject())->isChecked()) {
+ resultText = "has no Outputted Content";
+ } else {
+ resultText = "is before arbitrate skip";
+ }
+ } else {
+ resultText = "has Outputted Content[" + object->getElementName() + "]";
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(pre) + "Zone[" + operandName + "] " + resultText);
+#endif
+ return object;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAOutputtingSound::getSymbol() const
+{
+ return ".outputtingSound()";
+}
+
+void
+RBAOutputtingSound::createHierarchy()
+{
+ getLhsOperand()->createHierarchy();
+}
+
+RBAExpressionType
+RBAOutputtingSound::getUnderlyingType() const
+{
+ return RBAExpressionType::SOUND;
+}
+#endif
+
+}
diff --git a/src/sound/RBAOutputtingSound.hpp b/src/sound/RBAOutputtingSound.hpp
new file mode 100644
index 0000000..67b476c
--- /dev/null
+++ b/src/sound/RBAOutputtingSound.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * 音声出力クラス
+ */
+
+#ifndef RBAOUTPUTTINGSOUND_HPP
+#define RBAOUTPUTTINGSOUND_HPP
+
+#include <string>
+#include "RBAZoneOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAOutputtingSound : public RBAZoneOperator
+{
+public:
+ RBAOutputtingSound()=default;
+ RBAOutputtingSound(const RBAOutputtingSound&)=delete;
+ RBAOutputtingSound(const RBAOutputtingSound&&)=delete;
+ RBAOutputtingSound& operator=(const RBAOutputtingSound&)=delete;
+ RBAOutputtingSound& operator=(const RBAOutputtingSound&&)=delete;
+ virtual ~RBAOutputtingSound()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ void createHierarchy() override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAOutputtingSoundMaker.cpp b/src/sound/RBAOutputtingSoundMaker.cpp
new file mode 100644
index 0000000..4771fc6
--- /dev/null
+++ b/src/sound/RBAOutputtingSoundMaker.cpp
@@ -0,0 +1,40 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAOutputtingSoundMaker.cpp
+/// @brief OutputtingSound object generator class implementation
+
+#include "RBAOutputtingSoundMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAOutputtingSound.hpp"
+
+namespace rba
+{
+
+RBAOutputtingSoundMaker::RBAOutputtingSoundMaker()
+ : RBAOperatorMaker{"OutputtingSound"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAOutputtingSoundMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAOutputtingSound>();
+}
+
+}
diff --git a/src/sound/RBAOutputtingSoundMaker.hpp b/src/sound/RBAOutputtingSoundMaker.hpp
new file mode 100644
index 0000000..39cbe59
--- /dev/null
+++ b/src/sound/RBAOutputtingSoundMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAOutputtingSoundMaker.hpp
+/// @brief OutputtingSound object generator class header
+
+#ifndef RBAOUTPUTTINGSOUNDMAKER_HPP
+#define RBAOUTPUTTINGSOUNDMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief OutputtingSound object generator class
+class RBAOutputtingSoundMaker : public RBAOperatorMaker
+{
+public:
+ RBAOutputtingSoundMaker();
+ RBAOutputtingSoundMaker(const RBAOutputtingSoundMaker&)=delete;
+ RBAOutputtingSoundMaker(const RBAOutputtingSoundMaker&&)=delete;
+ RBAOutputtingSoundMaker& operator=(const RBAOutputtingSoundMaker&)=delete;
+ RBAOutputtingSoundMaker& operator=(const RBAOutputtingSoundMaker&&)=delete;
+ virtual ~RBAOutputtingSoundMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBASoundContent.cpp b/src/sound/RBASoundContent.cpp
new file mode 100644
index 0000000..32424ed
--- /dev/null
+++ b/src/sound/RBASoundContent.cpp
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Sound Content class
+ */
+
+#include "RBASoundContent.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/sound/RBASoundContentImpl.cpp b/src/sound/RBASoundContentImpl.cpp
new file mode 100644
index 0000000..02f452b
--- /dev/null
+++ b/src/sound/RBASoundContentImpl.cpp
@@ -0,0 +1,95 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Sound Content class implementation
+ */
+
+#include "RBASoundContentImpl.hpp"
+#include "RBASoundContentStateImpl.hpp"
+#include "RBAZoneImpl.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBASoundContentImpl::RBASoundContentImpl(const std::string& name)
+ : RBARuleObject{name},
+ RBASoundContent(),
+ RBAContent{name}
+{
+}
+
+bool
+RBASoundContentImpl::isSoundContent() const
+{
+ return true;
+}
+
+std::string
+RBASoundContentImpl::getName() const
+{
+ return RBANamedElement::getElementName();
+}
+
+const std::list<const RBASoundContentState*>&
+RBASoundContentImpl::getContentStates() const
+{
+ if(externStates_.size() == 0U) {
+ for(const RBAContentState* state : getStates()) {
+ externStates_.push_back(dynamic_cast<const RBASoundContentStateImpl*>(state));
+ }
+ }
+ return externStates_;
+}
+
+const std::list<const RBAZone*>&
+RBASoundContentImpl::getZones() const
+{
+ if(externZones_.size() == 0U) {
+ for(const RBAAllocatable* allocatable : getAllocatables()) {
+ externZones_.push_back(dynamic_cast<const RBAZoneImpl*>(allocatable));
+ }
+ }
+ return externZones_;
+}
+
+RBAContentLoserType
+RBASoundContentImpl::getLoserType() const
+{
+ return getContentLoserType();
+}
+
+RBAModelElementType
+RBASoundContentImpl::getModelElementType() const
+{
+ return RBAModelElementType::SoundContent;
+}
+
+#ifdef RBA_USE_LOG
+std::string
+RBASoundContentImpl::getSymbol() const
+{
+ return "SoundContent";
+}
+
+std::string
+RBASoundContentImpl::getVisibleSymbol() const
+{
+ return "sounding";
+}
+#endif
+
+}
diff --git a/src/sound/RBASoundContentImpl.hpp b/src/sound/RBASoundContentImpl.hpp
new file mode 100644
index 0000000..75d9ab0
--- /dev/null
+++ b/src/sound/RBASoundContentImpl.hpp
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Sound Content implementation class header
+ */
+
+#ifndef RBASOUNDCONTENTIMPL_HPP
+#define RBASOUNDCONTENTIMPL_HPP
+
+#include <string>
+#include "RBASoundContent.hpp"
+#include "RBAContent.hpp"
+
+namespace rba
+{
+
+class RBASoundContentState;
+class RBAZone;
+class RBAZoneImpl;
+class RBASoundContentStateImpl;
+
+class DLL_EXPORT RBASoundContentImpl : public RBASoundContent, public RBAContent
+{
+public:
+ explicit RBASoundContentImpl(const std::string& name="");
+ RBASoundContentImpl(const RBASoundContentImpl&)=delete;
+ RBASoundContentImpl(const RBASoundContentImpl&&)=delete;
+ RBASoundContentImpl& operator=(const RBASoundContentImpl&)=delete;
+ RBASoundContentImpl& operator=(const RBASoundContentImpl&&)=delete;
+ virtual ~RBASoundContentImpl()=default;
+
+public:
+ bool isSoundContent() const override;
+ std::string getName() const override;
+ const std::list<const RBASoundContentState*>& getContentStates() const override;
+ const std::list<const RBAZone*>& getZones() const override;
+ RBAContentLoserType getLoserType() const override;
+
+ RBAModelElementType getModelElementType() const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ std::string getSymbol() const override;
+ std::string getVisibleSymbol() const override;
+#endif
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ mutable std::list<const RBASoundContentState*> externStates_;
+ mutable std::list<const RBAZone*> externZones_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBASoundContentMaker.cpp b/src/sound/RBASoundContentMaker.cpp
new file mode 100644
index 0000000..6bf0582
--- /dev/null
+++ b/src/sound/RBASoundContentMaker.cpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASoundContentMaker.cpp
+/// @brief SoundContent object generator class
+
+#include "RBASoundContentMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBASoundContentImpl.hpp"
+#include "RBASoundContentStateMaker.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBASoundContentMaker::RBASoundContentMaker()
+ : RBARuleObjectMaker{"soundcontents"},
+ RBAContentMaker()
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBASoundContentMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBASoundContentImpl>(name);
+}
+
+RBAModelElement*
+RBASoundContentMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ element = RBAContentMaker::setProperty(element, jsonElem, model, owner);
+ if(element == nullptr) {
+ return nullptr;
+ }
+
+ RBASoundContentImpl* const content {dynamic_cast<RBASoundContentImpl*>(element)};
+
+ return content;
+}
+
+}
diff --git a/src/sound/RBASoundContentMaker.hpp b/src/sound/RBASoundContentMaker.hpp
new file mode 100644
index 0000000..f954cb3
--- /dev/null
+++ b/src/sound/RBASoundContentMaker.hpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASoundContentMaker.hpp
+/// @brief SoundContent object generator class header
+
+#ifndef RBASOUNDCONTENTMAKER_HPP
+#define RBASOUNDCONTENTMAKER_HPP
+
+#include "RBAContentMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief SoundContent object generator class
+class RBASoundContentMaker : public RBAContentMaker
+{
+public:
+ RBASoundContentMaker();
+ RBASoundContentMaker(const RBASoundContentMaker&)=delete;
+ RBASoundContentMaker(const RBASoundContentMaker&&)=delete;
+ RBASoundContentMaker& operator=(const RBASoundContentMaker&)=delete;
+ RBASoundContentMaker& operator=(const RBASoundContentMaker&&)=delete;
+ virtual ~RBASoundContentMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBASoundContentOperator.cpp b/src/sound/RBASoundContentOperator.cpp
new file mode 100644
index 0000000..d56ee34
--- /dev/null
+++ b/src/sound/RBASoundContentOperator.cpp
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * SoundContentOperator class
+ */
+
+#include "RBASoundContentOperator.hpp"
+#include "RBASoundContentImpl.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/sound/RBASoundContentOperator.hpp b/src/sound/RBASoundContentOperator.hpp
new file mode 100644
index 0000000..ba400e6
--- /dev/null
+++ b/src/sound/RBASoundContentOperator.hpp
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * SoundContentOperator class header
+ */
+
+#ifndef RBASOUNDCONTENTOPERATOR_HPP
+#define RBASOUNDCONTENTOPERATOR_HPP
+
+#include "RBAContentOperator.hpp"
+
+namespace rba
+{
+
+class RBASoundContentImpl;
+
+class DLL_EXPORT RBASoundContentOperator : public RBAContentOperator
+{
+protected:
+ RBASoundContentOperator()=default;
+ RBASoundContentOperator(const RBASoundContentOperator&)=delete;
+ RBASoundContentOperator(const RBASoundContentOperator&&)=delete;
+ RBASoundContentOperator& operator=(const RBASoundContentOperator&)=delete;
+ RBASoundContentOperator& operator=(const RBASoundContentOperator&&)=delete;
+
+public:
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBASoundContentSet.cpp b/src/sound/RBASoundContentSet.cpp
new file mode 100644
index 0000000..4b50397
--- /dev/null
+++ b/src/sound/RBASoundContentSet.cpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * SoundContentSet class
+ */
+
+#include "RBASoundContentSet.hpp"
+#include "RBASoundContent.hpp"
+#include "RBAContent.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBASoundContentSet::RBASoundContentSet(const std::string& name)
+ : RBARuleObject{name},
+ RBAContentSet{name}
+{
+}
+
+const std::list<const RBASoundContent*>&
+RBASoundContentSet::getTargets() const
+{
+ return externalContents_;
+}
+
+void
+RBASoundContentSet::addTarget(const RBAContent* content)
+{
+ RBAContentSet::addTarget(content);
+ externalContents_.push_back(dynamic_cast<const RBASoundContent*>(content));
+}
+
+void
+RBASoundContentSet::clear()
+{
+ RBAContentSet::clear();
+ externalContents_.clear();
+}
+
+RBAModelElementType
+RBASoundContentSet::getModelElementType() const
+{
+ return RBAModelElementType::SoundContentSet;
+}
+
+}
diff --git a/src/sound/RBASoundContentSet.hpp b/src/sound/RBASoundContentSet.hpp
new file mode 100644
index 0000000..0d927d9
--- /dev/null
+++ b/src/sound/RBASoundContentSet.hpp
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * SoundContentSet class header
+ */
+
+#ifndef RBASOUNDCONTENTSET_HPP
+#define RBASOUNDCONTENTSET_HPP
+
+#include "RBAContentSet.hpp"
+#include "RBADllExport.hpp"
+
+namespace rba
+{
+
+class RBASoundContent;
+class RBASoundContentImpl;
+
+class DLL_EXPORT RBASoundContentSet : public RBAContentSet
+{
+public:
+ explicit RBASoundContentSet(const std::string& name="");
+ RBASoundContentSet(const RBASoundContentSet&)=delete;
+ RBASoundContentSet(const RBASoundContentSet&&)=delete;
+ RBASoundContentSet& operator=(const RBASoundContentSet&)=delete;
+ RBASoundContentSet& operator=(const RBASoundContentSet&&)=delete;
+ virtual ~RBASoundContentSet()=default;
+
+public:
+ const std::list<const RBASoundContent*>& getTargets() const;
+ void addTarget(const RBAContent* content) override;
+ void clear() override;
+ RBAModelElementType getModelElementType() const override;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<const RBASoundContent*> externalContents_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBASoundContentSetMaker.cpp b/src/sound/RBASoundContentSetMaker.cpp
new file mode 100644
index 0000000..8db2afe
--- /dev/null
+++ b/src/sound/RBASoundContentSetMaker.cpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASoundContentSetMaker.cpp
+/// @brief SoundContentSet object generator class
+
+#include "RBASoundContentSetMaker.hpp"
+#include "RBASoundContentSet.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBASoundContentSetMaker::RBASoundContentSetMaker()
+ : RBARuleObjectMaker{"soundcontentsets"},
+ RBAContentSetMaker()
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBASoundContentSetMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBASoundContentSet>(name);
+}
+
+RBAModelElement*
+RBASoundContentSetMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBAContentSetMaker::setProperty(element, jsonElem, model, owner));
+
+ const auto contentSet = dynamic_cast<RBASoundContentSet*>(element);
+
+ model->addSoundContentSet(contentSet);
+
+ return contentSet;
+}
+
+}
diff --git a/src/sound/RBASoundContentSetMaker.hpp b/src/sound/RBASoundContentSetMaker.hpp
new file mode 100644
index 0000000..256df09
--- /dev/null
+++ b/src/sound/RBASoundContentSetMaker.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASoundContentSetMaker.hpp
+/// @brief SoundContentSet object generator class header
+
+#ifndef RBASOUNDCONTENTSETMAKER_HPP
+#define RBASOUNDCONTENTSETMAKER_HPP
+
+#include "RBAContentSetMaker.hpp"
+
+namespace rba
+{
+
+/// @brief SoundContentSet object generator class
+class RBASoundContentSetMaker : public RBAContentSetMaker
+{
+public:
+ RBASoundContentSetMaker();
+ RBASoundContentSetMaker(const RBASoundContentSetMaker&)=delete;
+ RBASoundContentSetMaker(const RBASoundContentSetMaker&&)=delete;
+ RBASoundContentSetMaker& operator=(const RBASoundContentSetMaker&)=delete;
+ RBASoundContentSetMaker& operator=(const RBASoundContentSetMaker&&)=delete;
+ virtual ~RBASoundContentSetMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBASoundContentState.cpp b/src/sound/RBASoundContentState.cpp
new file mode 100644
index 0000000..14a1b3b
--- /dev/null
+++ b/src/sound/RBASoundContentState.cpp
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * SoundContentState class
+ */
+
+#include "RBASoundContentState.hpp"
+
+namespace rba
+{
+
+std::string
+RBASoundContentState::getContentNameByContext(const std::string& context)
+{
+ return context.substr(0U, context.find(CONTEXT_SEPARATER));
+}
+
+std::string
+RBASoundContentState::getContentStateNameByContext(const std::string& context)
+{
+ const std::string::size_type pos {context.find(CONTEXT_SEPARATER)};
+ if(pos == std::string::npos) {
+ // Returns null string if it does not contain a separator character.
+ return "";
+ }
+ else {
+ return context.substr(pos+1U, context.length()-1U);
+ }
+}
+
+bool
+RBASoundContentState::isUniqueName(const std::string& context)
+{
+ return (context.find(CONTEXT_SEPARATER) != std::string::npos);
+}
+
+}
diff --git a/src/sound/RBASoundContentStateImpl.cpp b/src/sound/RBASoundContentStateImpl.cpp
new file mode 100644
index 0000000..4903057
--- /dev/null
+++ b/src/sound/RBASoundContentStateImpl.cpp
@@ -0,0 +1,77 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * SoundContentState implementation class
+ */
+
+#include "RBASoundContentStateImpl.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentState.hpp"
+#include "RBASoundContentImpl.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBASoundContentStateImpl::RBASoundContentStateImpl(const std::string& name)
+ : RBASoundContentState(),
+ RBAContentState{name}
+{
+}
+
+bool
+RBASoundContentStateImpl::isSoundContentState() const
+{
+ return true;
+}
+
+std::string
+RBASoundContentStateImpl::getName() const
+{
+ return RBANamedElement::getElementName();
+}
+
+std::int32_t
+RBASoundContentStateImpl::getPriority() const
+{
+ return getContentStatePriority();
+}
+
+const RBASoundContent*
+RBASoundContentStateImpl::getOwner() const
+{
+ return dynamic_cast<const RBASoundContentImpl*>(RBARuleObject::getOwner());
+}
+
+std::int32_t
+RBASoundContentStateImpl::getOrder() const
+{
+ return getContentStateOrder();
+}
+
+std::string
+RBASoundContentStateImpl::getUniqueName() const
+{
+ return RBARuleObject::getOwner()->getUniqueName() + CONTEXT_SEPARATER + getName();
+}
+
+RBAModelElementType
+RBASoundContentStateImpl::getModelElementType() const
+{
+ return RBAModelElementType::SoundContentState;
+}
+
+}
diff --git a/src/sound/RBASoundContentStateImpl.hpp b/src/sound/RBASoundContentStateImpl.hpp
new file mode 100644
index 0000000..4865507
--- /dev/null
+++ b/src/sound/RBASoundContentStateImpl.hpp
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * SoundContentState implementation class header
+ */
+#ifndef RBASOUNDCONTENTSTATEIMPL_HPP
+#define RBASOUNDCONTENTSTATEIMPL_HPP
+
+#include <cstdint>
+#include "RBASoundContentState.hpp"
+#include "RBAContentState.hpp"
+
+namespace rba
+{
+
+class RBASoundContentImpl;
+
+class RBASoundContentStateImpl : public RBASoundContentState,
+ public RBAContentState
+{
+public:
+ explicit RBASoundContentStateImpl(const std::string& name="");
+ RBASoundContentStateImpl(const RBASoundContentStateImpl&)=delete;
+ RBASoundContentStateImpl(const RBASoundContentStateImpl&&)=delete;
+ RBASoundContentStateImpl& operator=(const RBASoundContentStateImpl&)=delete;
+ RBASoundContentStateImpl& operator=(const RBASoundContentStateImpl&&)=delete;
+ virtual ~RBASoundContentStateImpl()=default;
+
+public:
+ bool isSoundContentState() const override;
+ std::string getName() const override;
+ std::int32_t getPriority() const override;
+ const RBASoundContent* getOwner() const override;
+ std::int32_t getOrder() const override;
+ std::string getUniqueName() const override;
+ RBAModelElementType getModelElementType() const override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBASoundContentStateMaker.cpp b/src/sound/RBASoundContentStateMaker.cpp
new file mode 100644
index 0000000..ce4034d
--- /dev/null
+++ b/src/sound/RBASoundContentStateMaker.cpp
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASoundContentStateMaker.cpp
+/// @brief SoundContentState object generator class
+
+#include "RBASoundContentStateMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBASoundContentStateImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBASoundContentStateMaker::RBASoundContentStateMaker()
+ : RBAContentStateMaker{"SoundContentState"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBASoundContentStateMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBASoundContentStateImpl>(name);
+}
+
+RBAModelElement*
+RBASoundContentStateMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ // create instance of unique_ptr and register it to model
+ // name, priority and owner are also registered.
+ RBAModelElement* const elem {RBAContentStateMaker::setProperty(element,
+ jsonElem, model, owner)};
+ if(elem == nullptr) {
+ return nullptr;
+ }
+ RBASoundContentStateImpl* const state
+ {dynamic_cast<RBASoundContentStateImpl*>(elem)};
+
+ return state;
+}
+
+}
diff --git a/src/sound/RBASoundContentStateMaker.hpp b/src/sound/RBASoundContentStateMaker.hpp
new file mode 100644
index 0000000..04a43a4
--- /dev/null
+++ b/src/sound/RBASoundContentStateMaker.hpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASoundContentStateMaker.hpp
+/// @brief SoundContentState object generator class header
+
+#ifndef RBASOUNDCONTENTSTATEMAKER_HPP
+#define RBASOUNDCONTENTSTATEMAKER_HPP
+
+#include "RBAContentStateMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief SoundContentState object generator class
+class RBASoundContentStateMaker : public RBAContentStateMaker
+{
+public:
+ RBASoundContentStateMaker();
+ RBASoundContentStateMaker(const RBASoundContentStateMaker&)=delete;
+ RBASoundContentStateMaker(const RBASoundContentStateMaker&&)=delete;
+ RBASoundContentStateMaker& operator=(const RBASoundContentStateMaker&)=delete;
+ RBASoundContentStateMaker& operator=(const RBASoundContentStateMaker&&)=delete;
+ virtual ~RBASoundContentStateMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBASoundMakerTable.cpp b/src/sound/RBASoundMakerTable.cpp
new file mode 100644
index 0000000..6be7d91
--- /dev/null
+++ b/src/sound/RBASoundMakerTable.cpp
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASoundMakerTable.cpp
+/// @brief Sound element maker table class
+
+#include "RBASoundMakerTable.hpp"
+#include "RBAAllInstanceOfSoundContentMaker.hpp"
+#include "RBAAllInstanceOfZoneMaker.hpp"
+#include "RBAIsAttenuatedMaker.hpp"
+#include "RBAIsMutedMaker.hpp"
+#include "RBAIsOutputtedMaker.hpp"
+#include "RBAIsSoundingMaker.hpp"
+#include "RBAOutputtingSoundMaker.hpp"
+#include "RBASoundContentMaker.hpp"
+#include "RBASoundContentSetMaker.hpp"
+#include "RBASoundContentStateMaker.hpp"
+#include "RBAZoneMaker.hpp"
+#include "RBAZoneSetMaker.hpp"
+
+namespace rba
+{
+
+RBASoundMakerTable::RBASoundMakerTable()
+ : RBAAbstractMakerTable{}
+{
+ addTag("zones");
+ addTag("zonesets");
+ addTag("soundcontents");
+ addTag("soundcontentsets");
+}
+
+std::list<std::unique_ptr<RBAModelElementMaker>>
+RBASoundMakerTable::getMakers() const
+{
+ std::list<std::unique_ptr<RBAModelElementMaker>> makers;
+ makers.push_back(std::make_unique<RBAAllInstanceOfSoundContentMaker>());
+ makers.push_back(std::make_unique<RBAAllInstanceOfZoneMaker>());
+ makers.push_back(std::make_unique<RBAIsAttenuatedMaker>());
+ makers.push_back(std::make_unique<RBAIsMutedMaker>());
+ makers.push_back(std::make_unique<RBAIsOutputtedMaker>());
+ makers.push_back(std::make_unique<RBAIsSoundingMaker>());
+ makers.push_back(std::make_unique<RBAOutputtingSoundMaker>());
+ makers.push_back(std::make_unique<RBASoundContentMaker>());
+ RBAModelElementMaker::addMaker("SOUND", std::make_unique<RBASoundContentMaker>());
+ RBAModelElementMaker::addMaker("SoundContent", std::make_unique<RBASoundContentMaker>());
+ makers.push_back(std::make_unique<RBASoundContentSetMaker>());
+ RBAModelElementMaker::addMaker("SET_OF_SOUND", std::make_unique<RBASoundContentSetMaker>());
+ makers.push_back(std::make_unique<RBASoundContentStateMaker>());
+ makers.push_back(std::make_unique<RBAZoneMaker>());
+ RBAModelElementMaker::addMaker("ZONE", std::make_unique<RBAZoneMaker>());
+ makers.push_back(std::make_unique<RBAZoneSetMaker>());
+ RBAModelElementMaker::addMaker("SET_OF_ZONE", std::make_unique<RBAZoneSetMaker>());
+
+ return makers;
+}
+
+}
diff --git a/src/sound/RBASoundMakerTable.hpp b/src/sound/RBASoundMakerTable.hpp
new file mode 100644
index 0000000..f80e046
--- /dev/null
+++ b/src/sound/RBASoundMakerTable.hpp
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASoundMakerTable.hpp
+/// @brief Sound element maker table class header
+
+#ifndef RBASOUNDMAKERTABLE_HPP
+#define RBASOUNDMAKERTABLE_HPP
+
+#include <functional>
+#include "RBAAbstractMakerTable.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBASoundMakerTable : public RBAAbstractMakerTable
+{
+public:
+ RBASoundMakerTable();
+ RBASoundMakerTable(const RBASoundMakerTable&)=delete;
+ RBASoundMakerTable(const RBASoundMakerTable&&)=delete;
+ RBASoundMakerTable& operator=(const RBASoundMakerTable&)=delete;
+ RBASoundMakerTable& operator=(const RBASoundMakerTable&&)=delete;
+ virtual ~RBASoundMakerTable()=default;
+
+public:
+ std::list<std::unique_ptr<RBAModelElementMaker>> getMakers() const override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAZoneImpl.cpp b/src/sound/RBAZoneImpl.cpp
new file mode 100644
index 0000000..2c32498
--- /dev/null
+++ b/src/sound/RBAZoneImpl.cpp
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Zone implementation clas
+ */
+
+#include "RBASoundContentImpl.hpp"
+#include "RBAZone.hpp"
+#include "RBAArbitrationPolicy.hpp"
+#include "RBAExpression.hpp"
+#include "RBAZoneImpl.hpp"
+#include "RBAContent.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBAZoneImpl::RBAZoneImpl(const std::string& name)
+ : RBARuleObject{name},
+ RBAZone(),
+ RBAAllocatable{name}
+{
+}
+
+std::string
+RBAZoneImpl::getName() const
+{
+ return RBANamedElement::getElementName();
+}
+
+std::int32_t
+RBAZoneImpl::getPriority() const
+{
+ // Zone priority is treated the same as Area Visibility internally
+ return getVisibility();
+}
+
+const std::list<const RBASoundContent*>&
+RBAZoneImpl::getContents() const
+{
+ if(externContents_.size() == 0U) {
+ for(const RBAContent* content : getInternalContents()) {
+ externContents_.push_back(dynamic_cast<const RBASoundContentImpl*>(content));
+ }
+ }
+
+ return externContents_;
+}
+
+RBAArbitrationPolicy
+RBAZoneImpl::getArbitrationPolicy() const
+{
+ return getAllocatableArbitrationPolicy();
+}
+
+void
+RBAZoneImpl::addContent(const RBASoundContentImpl* const content)
+{
+ RBAAbstractAllocatable::addContent(content);
+}
+
+RBAModelElementType
+RBAZoneImpl::getModelElementType() const
+{
+ return RBAModelElementType::Zone;
+}
+
+#ifdef RBA_USE_LOG
+std::string
+RBAZoneImpl::getSymbol() const
+{
+ return "Zone";
+}
+
+std::string
+RBAZoneImpl::getHiddenSymbol() const
+{
+ return "muted";
+}
+#endif
+
+}
+
diff --git a/src/sound/RBAZoneImpl.hpp b/src/sound/RBAZoneImpl.hpp
new file mode 100644
index 0000000..efb345f
--- /dev/null
+++ b/src/sound/RBAZoneImpl.hpp
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Zone implementation clas header
+ */
+
+#ifndef RBAZONEIMPL_HPP
+#define RBAZONEIMPL_HPP
+
+#include <cstdint>
+#include <string>
+#include "RBAAllocatable.hpp"
+#include "RBAArbitrationPolicy.hpp"
+#include "RBAZone.hpp"
+
+namespace rba
+{
+
+class RBASoundContent;
+class RBASoundContentImpl;
+
+class RBAZoneImpl : public RBAZone, public RBAAllocatable
+{
+public:
+ explicit RBAZoneImpl(const std::string& name="");
+ RBAZoneImpl(const RBAZoneImpl&)=delete;
+ RBAZoneImpl(const RBAZoneImpl&&)=delete;
+ RBAZoneImpl& operator=(const RBAZoneImpl&)=delete;
+ RBAZoneImpl& operator=(const RBAZoneImpl&&)=delete;
+ virtual ~RBAZoneImpl()=default;
+
+public:
+ std::string getName() const override;
+ std::int32_t getPriority() const override;
+ const std::list<const RBASoundContent*>& getContents() const override;
+ RBAArbitrationPolicy getArbitrationPolicy() const override;
+
+ void addContent(const RBASoundContentImpl* const content);
+ RBAModelElementType getModelElementType() const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ std::string getSymbol() const override;
+ std::string getHiddenSymbol() const override;
+#endif
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ mutable std::list<const RBASoundContent*> externContents_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAZoneMaker.cpp b/src/sound/RBAZoneMaker.cpp
new file mode 100644
index 0000000..f6923fd
--- /dev/null
+++ b/src/sound/RBAZoneMaker.cpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAZoneMaker.cpp
+/// @brief Zone object generator class
+
+#include <iostream>
+#include "RBAZoneMaker.hpp"
+#include "RBAZoneImpl.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAZoneMaker::RBAZoneMaker()
+ : RBARuleObjectMaker{"zones"},
+ RBAAllocatableMaker()
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAZoneMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAZoneImpl>(name);
+}
+
+RBAModelElement*
+RBAZoneMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ element = RBAAllocatableMaker::setProperty(element, jsonElem, model, owner);
+ if(element == nullptr) {
+ return nullptr;
+ }
+
+ RBAZoneImpl* const zone {dynamic_cast<RBAZoneImpl*>(element)};
+
+ return zone;
+}
+
+}
diff --git a/src/sound/RBAZoneMaker.hpp b/src/sound/RBAZoneMaker.hpp
new file mode 100644
index 0000000..8367bd0
--- /dev/null
+++ b/src/sound/RBAZoneMaker.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAZoneMaker.hpp
+/// @brief Zone object generator class header
+
+#ifndef RBAZONEMAKER_HPP
+#define RBAZONEMAKER_HPP
+
+#include "RBAAllocatableMaker.hpp"
+
+namespace rba
+{
+
+/// @brief Zone object generator class
+class RBAZoneMaker : public RBAAllocatableMaker
+{
+public:
+ RBAZoneMaker();
+ RBAZoneMaker(const RBAZoneMaker&)=delete;
+ RBAZoneMaker(const RBAZoneMaker&&)=delete;
+ RBAZoneMaker& operator=(const RBAZoneMaker&)=delete;
+ RBAZoneMaker& operator=(const RBAZoneMaker&&)=delete;
+ virtual ~RBAZoneMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAZoneOperator.cpp b/src/sound/RBAZoneOperator.cpp
new file mode 100644
index 0000000..9add4a5
--- /dev/null
+++ b/src/sound/RBAZoneOperator.cpp
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ZoneOperator class
+ */
+
+#include "RBAZoneOperator.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/sound/RBAZoneOperator.hpp b/src/sound/RBAZoneOperator.hpp
new file mode 100644
index 0000000..86e6c00
--- /dev/null
+++ b/src/sound/RBAZoneOperator.hpp
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ZoneOperator class header
+ */
+
+#ifndef RBAZONEOPERATOR_HPP
+#define RBAZONEOPERATOR_HPP
+
+#include "RBAAllocatableOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAZoneOperator : public RBAAllocatableOperator
+{
+protected:
+ RBAZoneOperator()=default;
+ RBAZoneOperator(const RBAZoneOperator&)=delete;
+ RBAZoneOperator(const RBAZoneOperator&&)=delete;
+ RBAZoneOperator& operator=(const RBAZoneOperator&)=delete;
+ RBAZoneOperator& operator=(const RBAZoneOperator&&)=delete;
+
+public:
+ virtual ~RBAZoneOperator()=default;
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAZoneSet.cpp b/src/sound/RBAZoneSet.cpp
new file mode 100644
index 0000000..e23e84a
--- /dev/null
+++ b/src/sound/RBAZoneSet.cpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ZoneSet class
+ */
+
+#include "RBAZoneSet.hpp"
+#include "RBAZone.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBAZoneSet::RBAZoneSet(const std::string& name)
+ : RBARuleObject{name},
+ RBAAllocatableSet{name}
+{
+}
+
+const std::list<const RBAZone*>&
+RBAZoneSet::getTargets() const
+{
+ return externZones_;
+}
+
+void
+RBAZoneSet::addTarget(const RBAAllocatable* alloc)
+{
+ RBAAllocatableSet::addTarget(alloc);
+ externZones_.push_back(dynamic_cast<const RBAZone*>(alloc));
+}
+
+void
+RBAZoneSet::clear()
+{
+ RBAAllocatableSet::clear();
+ externZones_.clear();
+}
+
+RBAModelElementType
+RBAZoneSet::getModelElementType() const
+{
+ return RBAModelElementType::ZoneSet;
+}
+
+}
diff --git a/src/sound/RBAZoneSet.hpp b/src/sound/RBAZoneSet.hpp
new file mode 100644
index 0000000..1f5f1e6
--- /dev/null
+++ b/src/sound/RBAZoneSet.hpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ZoneSet class header
+ */
+
+#ifndef RBAZONESET_HPP
+#define RBAZONESET_HPP
+
+#include "RBAAllocatableSet.hpp"
+
+namespace rba
+{
+
+class RBAZoneImpl;
+class RBAZone;
+
+class DLL_EXPORT RBAZoneSet : public RBAAllocatableSet
+{
+public:
+ explicit RBAZoneSet(const std::string& name="");
+ RBAZoneSet(const RBAZoneSet&)=delete;
+ RBAZoneSet(const RBAZoneSet&&)=delete;
+ RBAZoneSet& operator=(const RBAZoneSet&)=delete;
+ RBAZoneSet& operator=(const RBAZoneSet&&)=delete;
+ virtual ~RBAZoneSet()=default;
+
+public:
+ const std::list<const RBAZone*>& getTargets() const;
+ void addTarget(const RBAAllocatable* alloc) override;
+ void clear() override;
+ RBAModelElementType getModelElementType() const override;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<const RBAZone*> externZones_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/sound/RBAZoneSetMaker.cpp b/src/sound/RBAZoneSetMaker.cpp
new file mode 100644
index 0000000..b05c935
--- /dev/null
+++ b/src/sound/RBAZoneSetMaker.cpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAZoneSetMaker.cpp
+/// @brief ZoneSet object generator class
+
+#include "RBAZoneSetMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAZoneSet.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAZoneSetMaker::RBAZoneSetMaker()
+ : RBARuleObjectMaker{"zonesets"},
+ RBAAllocatableSetMaker()
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAZoneSetMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAZoneSet>(name);
+}
+
+RBAModelElement*
+RBAZoneSetMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBAAllocatableSetMaker::setProperty(element, jsonElem, model, owner));
+
+ RBAZoneSet* const zoneSet {dynamic_cast<RBAZoneSet*>(element)};
+
+ model->addZoneSet(zoneSet);
+
+ return zoneSet;
+}
+
+}
diff --git a/src/sound/RBAZoneSetMaker.hpp b/src/sound/RBAZoneSetMaker.hpp
new file mode 100644
index 0000000..1265628
--- /dev/null
+++ b/src/sound/RBAZoneSetMaker.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAZoneSetMaker.hpp
+/// @brief ZoneSet object generator class header
+
+#ifndef RBAZONESETMAKER_HPP
+#define RBAZONESETMAKER_HPP
+
+#include "RBAAllocatableSetMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ZoneSet object generator class
+class RBAZoneSetMaker : public RBAAllocatableSetMaker
+{
+public:
+ RBAZoneSetMaker();
+ RBAZoneSetMaker(const RBAZoneSetMaker&)=delete;
+ RBAZoneSetMaker(const RBAZoneSetMaker&&)=delete;
+ RBAZoneSetMaker& operator=(const RBAZoneSetMaker&)=delete;
+ RBAZoneSetMaker& operator=(const RBAZoneSetMaker&&)=delete;
+ virtual ~RBAZoneSetMaker()=default;
+
+protected:
+ /// @brief Empty instanciation
+ /// @details Create an empty instance of unique_ptr in a derived class
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated RBARuleObjectMaker
+ /// @param[in,out] owner Parent object (Not in use)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAAllInstanceOfArea.cpp b/src/view/RBAAllInstanceOfArea.cpp
new file mode 100644
index 0000000..032cc90
--- /dev/null
+++ b/src/view/RBAAllInstanceOfArea.cpp
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AllInstanceOfArea implementation class definition file
+ */
+
+#include "RBAAllInstanceOfArea.hpp"
+#include "RBAAreaImpl.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void
+RBAAllInstanceOfArea::accept(RBAExpressionVisitor& visitor)
+{
+ // RBASceneAllocatableCollector, the only existing visitor at this time,
+ // does not accept this set of For-All, Exists, so it does not pass this path.
+ // It is left because another visitor may accept it in the future.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAAllInstanceOfArea::getModelElementType() const
+{
+ return RBAModelElementType::AllInstanceOfArea;
+}
+
+const RBARuleObject*
+RBAAllInstanceOfArea::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ return &allAreaSet_;
+}
+
+void
+RBAAllInstanceOfArea::setAreas(const std::list<const RBAAreaImpl*>& areas)
+{
+ for (auto& a : areas) {
+ allAreaSet_.addTarget(a);
+ }
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAAllInstanceOfArea::getExpressionText() const
+{
+ return "ALL_AREAS";
+}
+
+const std::string
+RBAAllInstanceOfArea::getCoverageExpressionText() const
+{
+ return getExpressionText();
+}
+#endif
+
+}
diff --git a/src/view/RBAAllInstanceOfArea.hpp b/src/view/RBAAllInstanceOfArea.hpp
new file mode 100644
index 0000000..b2ffaa7
--- /dev/null
+++ b/src/view/RBAAllInstanceOfArea.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * AllInstanceOfArea class header file
+ */
+
+#ifndef RBAAllInstanceOfArea_HPP
+#define RBAAllInstanceOfArea_HPP
+
+#include "RBAAreaSet.hpp"
+#include "RBASetExpression.hpp"
+
+namespace rba
+{
+class DLL_EXPORT RBAAllInstanceOfArea : public RBASetExpression
+{
+ public:
+ RBAAllInstanceOfArea()=default;
+ RBAAllInstanceOfArea(const RBAAllInstanceOfArea&)=delete;
+ RBAAllInstanceOfArea(const RBAAllInstanceOfArea&&)=delete;
+ RBAAllInstanceOfArea& operator=(const RBAAllInstanceOfArea&)=delete;
+ RBAAllInstanceOfArea& operator=(const RBAAllInstanceOfArea&&)=delete;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+ void setAreas(const std::list<const RBAAreaImpl*>& areas);
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+
+ private:
+ RBAAreaSet allAreaSet_;
+};
+
+}
+
+#endif
diff --git a/src/view/RBAAllInstanceOfAreaMaker.cpp b/src/view/RBAAllInstanceOfAreaMaker.cpp
new file mode 100644
index 0000000..f9cf28f
--- /dev/null
+++ b/src/view/RBAAllInstanceOfAreaMaker.cpp
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAllInstanceOfAreaMaker.cpp
+/// @brief AllInstanceOfArea object generation class definition file
+
+#include <iostream>
+#include "RBAAllInstanceOfAreaMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAAllInstanceOfArea.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAAllInstanceOfAreaMaker::RBAAllInstanceOfAreaMaker()
+ : RBAExpressionMaker{"AllInstanceOfArea"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAAllInstanceOfAreaMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAAllInstanceOfArea>();
+}
+
+RBAModelElement*
+RBAAllInstanceOfAreaMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBAAllInstanceOfArea* const allArea
+ {dynamic_cast<RBAAllInstanceOfArea*>(element)};
+ allArea->setAreas(model->getAreaImpls());
+
+ return allArea;
+}
+
+}
diff --git a/src/view/RBAAllInstanceOfAreaMaker.hpp b/src/view/RBAAllInstanceOfAreaMaker.hpp
new file mode 100644
index 0000000..7977874
--- /dev/null
+++ b/src/view/RBAAllInstanceOfAreaMaker.hpp
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAllInstanceOfAreaMaker.hpp
+/// @brief AllInstanceOfArea object generation class header file
+
+#ifndef RBAALLINSTANCEOFAREAMAKER_HPP
+#define RBAALLINSTANCEOFAREAMAKER_HPP
+
+#include "RBAExpressionMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief AllInstanceOfArea object generation class
+class RBAAllInstanceOfAreaMaker : public RBAExpressionMaker
+{
+public:
+ RBAAllInstanceOfAreaMaker();
+ RBAAllInstanceOfAreaMaker(const RBAAllInstanceOfAreaMaker&)=delete;
+ RBAAllInstanceOfAreaMaker(const RBAAllInstanceOfAreaMaker&&)=delete;
+ RBAAllInstanceOfAreaMaker& operator=(const RBAAllInstanceOfAreaMaker&)=delete;
+ RBAAllInstanceOfAreaMaker& operator=(const RBAAllInstanceOfAreaMaker&&)=delete;
+ virtual ~RBAAllInstanceOfAreaMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return instans of unique_ptr
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model Model to save the generated object
+ /// @param[in,out] owner parent object (unused)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAAllInstanceOfViewContent.cpp b/src/view/RBAAllInstanceOfViewContent.cpp
new file mode 100644
index 0000000..7620410
--- /dev/null
+++ b/src/view/RBAAllInstanceOfViewContent.cpp
@@ -0,0 +1,74 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * AllInstanceOfViewContent implementation class definition file
+ */
+
+#include "RBAAllInstanceOfViewContent.hpp"
+#include "RBAViewContentImpl.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+void
+RBAAllInstanceOfViewContent::accept(RBAExpressionVisitor& visitor)
+{
+ // RBASceneAllocatableCollector, the only existing visitor at this time,
+ // does not accept this set of For-All, Exists, so it does not pass this path.
+ // It is left because another visitor may accept it in the future.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAAllInstanceOfViewContent::getModelElementType() const
+{
+ return RBAModelElementType::AllInstanceOfViewContent;
+}
+
+const RBARuleObject*
+RBAAllInstanceOfViewContent::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ return &allViewContentSet_;
+}
+
+void
+RBAAllInstanceOfViewContent::setContents(const std::list<const RBAViewContentImpl*>& contents)
+{
+ for (auto& content : contents) {
+ allViewContentSet_.addTarget(content);
+ }
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAAllInstanceOfViewContent::getExpressionText() const
+{
+ return "ALL_VIEWCONTENTS";
+}
+
+const std::string
+RBAAllInstanceOfViewContent::getCoverageExpressionText() const
+{
+ return getExpressionText();
+}
+#endif
+
+}
diff --git a/src/view/RBAAllInstanceOfViewContent.hpp b/src/view/RBAAllInstanceOfViewContent.hpp
new file mode 100644
index 0000000..214a070
--- /dev/null
+++ b/src/view/RBAAllInstanceOfViewContent.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * AllInstanceOfViewContent class header file
+ */
+
+#ifndef RBAALLINSRTANCEOFVIEWCONTENTIMPL_HPP
+#define RBAALLINSRTANCEOFVIEWCONTENTIMPL_HPP
+
+#include "RBASetExpression.hpp"
+#include "RBAViewContentSet.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAAllInstanceOfViewContent : public RBASetExpression
+{
+public:
+ RBAAllInstanceOfViewContent()=default;
+ RBAAllInstanceOfViewContent(const RBAAllInstanceOfViewContent&)=delete;
+ RBAAllInstanceOfViewContent(const RBAAllInstanceOfViewContent&&)=delete;
+ RBAAllInstanceOfViewContent& operator=(const RBAAllInstanceOfViewContent&)=delete;
+ RBAAllInstanceOfViewContent& operator=(const RBAAllInstanceOfViewContent&&)=delete;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+ void setContents(const std::list<const RBAViewContentImpl*>& contents);
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getExpressionText() const override;
+ const std::string getCoverageExpressionText() const override;
+#endif
+
+private:
+ RBAViewContentSet allViewContentSet_;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAAllInstanceOfViewContentMaker.cpp b/src/view/RBAAllInstanceOfViewContentMaker.cpp
new file mode 100644
index 0000000..7fe7c6d
--- /dev/null
+++ b/src/view/RBAAllInstanceOfViewContentMaker.cpp
@@ -0,0 +1,55 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/// @file RBAAllInstanceOfViewContentMaker.cpp
+/// @brief AllInstanceOfViewContenta object generation class definition file
+
+#include <iostream>
+#include "RBAAllInstanceOfViewContentMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAAllInstanceOfViewContent.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAAllInstanceOfViewContentMaker::RBAAllInstanceOfViewContentMaker()
+ : RBAExpressionMaker{"AllInstanceOfViewContent"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAAllInstanceOfViewContentMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAAllInstanceOfViewContent>();
+}
+
+RBAModelElement*
+RBAAllInstanceOfViewContentMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBAAllInstanceOfViewContent* const allCont
+ {dynamic_cast<RBAAllInstanceOfViewContent*>(element)};
+ allCont->setContents(model->getViewContentImpls());
+
+ return allCont;
+}
+
+}
diff --git a/src/view/RBAAllInstanceOfViewContentMaker.hpp b/src/view/RBAAllInstanceOfViewContentMaker.hpp
new file mode 100644
index 0000000..f9e2b3f
--- /dev/null
+++ b/src/view/RBAAllInstanceOfViewContentMaker.hpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAAllInstanceOfViewContentMaker.hpp
+/// @brief AllInstanceOfViewContent object generation class header file
+
+#ifndef RBAALLINSTANCEOFVIEWCONTENTMAKER_HPP
+#define RBAALLINSTANCEOFVIEWCONTENTMAKER_HPP
+
+#include "RBAExpressionMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief AllInstanceOfViewContent object generation class
+class RBAAllInstanceOfViewContentMaker : public RBAExpressionMaker
+{
+public:
+ RBAAllInstanceOfViewContentMaker();
+ RBAAllInstanceOfViewContentMaker(const RBAAllInstanceOfViewContentMaker&)=delete;
+ RBAAllInstanceOfViewContentMaker(const RBAAllInstanceOfViewContentMaker&&)=delete;
+ RBAAllInstanceOfViewContentMaker& operator=(const RBAAllInstanceOfViewContentMaker&)=delete;
+ RBAAllInstanceOfViewContentMaker& operator=(const RBAAllInstanceOfViewContentMaker&&)=delete;
+ virtual ~RBAAllInstanceOfViewContentMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return instance of unique_ptr
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] JSON element of jsonElem ModelElement
+ /// @param[in] model Model to save the generated object
+ /// @param[in,out] owner Parent object (unused)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAAreaImpl.cpp b/src/view/RBAAreaImpl.cpp
new file mode 100644
index 0000000..ffc354f
--- /dev/null
+++ b/src/view/RBAAreaImpl.cpp
@@ -0,0 +1,222 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Area imeplementation class
+ */
+
+#include "RBAAreaImpl.hpp"
+
+#include "RBAArbitrationPolicy.hpp"
+#include "RBAContent.hpp"
+#include "RBASizeImpl.hpp"
+#include "RBAViewContentImpl.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBAAreaImpl::RBAAreaImpl(const std::string& name)
+ : RBARuleObject{name},
+ RBAArea(),
+ RBAAllocatable{name}
+{
+}
+
+std::string
+RBAAreaImpl::getName() const
+{
+ return RBANamedElement::getElementName();
+}
+
+std::int32_t
+RBAAreaImpl::getX() const
+{
+ return x_;
+}
+
+std::int32_t
+RBAAreaImpl::getY() const
+{
+ return y_;
+}
+
+std::int32_t
+RBAAreaImpl::getZorder() const
+{
+ return zorder_;
+}
+
+const std::list<const RBAViewContent*>&
+RBAAreaImpl::getContents() const
+{
+ if(externContents_.size() == 0U) {
+ for(const RBAContent* const content : getInternalContents()) {
+ if(content->isViewContent()) {
+ const RBAViewContentImpl* contentImpl
+ {dynamic_cast<const RBAViewContentImpl*>(content)};
+ externContents_.push_back(contentImpl);
+ }
+ }
+ }
+
+ return externContents_;
+}
+
+const std::list<const RBAViewContent*>&
+RBAAreaImpl::getAllViewContents() const
+{
+ if(externAllContents_.size() == 0U) {
+ for(const RBAViewContent* const content : getAllViewContentsRecursive(this)) {
+ externAllContents_.push_back(content);
+ }
+ }
+
+ return externAllContents_;
+}
+
+const std::list<const RBAViewContent*>
+RBAAreaImpl::getAllViewContentsRecursive(const RBAAllocatable* const alloc) const
+{
+ std::list<const RBAViewContent*> contents;
+ if(alloc == nullptr) {
+ return contents;
+ }
+
+ for(const RBAContent* const content : alloc->getInternalContents()) {
+ if(content->isViewContent()) {
+ const RBAViewContentImpl* contentImpl {dynamic_cast<const RBAViewContentImpl*>(content)};
+ contents.push_back(contentImpl);
+ }
+ else {
+ const RBAAllocatable* const a {dynamic_cast<const RBAAllocatable*>(content)};
+ if(a != nullptr) {
+ // @Deviation (MEM05-CPP,Rule-7_5_4,A7-5-2)
+ // [Contents that deviate from the rules]
+ // Recursively calling getAllViewContentsRecursive()
+ // [Why there is no problem if it deviate from the rules]
+ // When getAllViewContentsRecursive() is performed for Area associated
+ // with CyclicContent, it responds including ViewContent associated
+ // with CyclicContent.
+ // Multiple recursive calls may be made, such as when CyclicContent
+ // is assigned to CyclicContent, but the rule model definition
+ // is finite and stack overflow does not occur, so there is no problem.
+ for(const RBAViewContent* const c : getAllViewContentsRecursive(a)) {
+ contents.push_back(c);
+ }
+ }
+ }
+ }
+
+ return contents;
+}
+
+const std::list<const RBASize*>&
+RBAAreaImpl::getSizes() const
+{
+ return externSizes_;
+}
+
+RBAArbitrationPolicy
+RBAAreaImpl::getArbitrationPolicy() const
+{
+ return getAllocatableArbitrationPolicy();
+}
+
+void
+RBAAreaImpl::clearStatus()
+{
+ RBAAllocatable::clearStatus();
+ resetCoordinate();
+}
+
+bool
+RBAAreaImpl::isArea() const
+{
+ return true;
+}
+
+void
+RBAAreaImpl::setZorder(const std::int32_t newZorder)
+{
+ zorder_ = newZorder;
+}
+
+void
+RBAAreaImpl::setDefaultX(const std::int32_t defaultX)
+{
+ defaultX_ = defaultX;
+ x_ = defaultX;
+}
+
+void
+RBAAreaImpl::setDefaultY(const std::int32_t defaultY)
+{
+ defaultY_ = defaultY;
+ y_ = defaultY;
+}
+
+void
+RBAAreaImpl::setOffsetX(const std::int32_t offsetX)
+{
+ x_ = defaultX_ + offsetX;
+}
+
+void
+RBAAreaImpl::setOffsetY(const std::int32_t offsetY)
+{
+ y_ = defaultY_ + offsetY;
+}
+
+void
+RBAAreaImpl::addSize(const RBASizeImpl* size)
+{
+ externSizes_.push_back(size);
+}
+
+void
+RBAAreaImpl::addContent(const RBAViewContentImpl* const content)
+{
+ RBAAbstractAllocatable::addContent(content);
+}
+
+void
+RBAAreaImpl::resetCoordinate()
+{
+ x_ = defaultX_;
+ y_ = defaultY_;
+}
+
+RBAModelElementType
+RBAAreaImpl::getModelElementType() const
+{
+ return RBAModelElementType::Area;
+}
+
+#ifdef RBA_USE_LOG
+std::string
+RBAAreaImpl::getSymbol() const
+{
+ return "Area";
+}
+
+std::string
+RBAAreaImpl::getHiddenSymbol() const
+{
+ return "hidden";
+}
+#endif
+
+}
diff --git a/src/view/RBAAreaImpl.hpp b/src/view/RBAAreaImpl.hpp
new file mode 100644
index 0000000..d5998ee
--- /dev/null
+++ b/src/view/RBAAreaImpl.hpp
@@ -0,0 +1,96 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Area imeplementation class header
+ */
+
+#ifndef RBAAREAIMPL_HPP
+#define RBAAREAIMPL_HPP
+
+#include <cstdint>
+#include <string>
+#include "RBAArea.hpp"
+#include "RBAAllocatable.hpp"
+
+namespace rba
+{
+
+class RBASize;
+class RBASizeImpl;
+class RBAViewContent;
+class RBAViewContentImpl;
+
+class DLL_EXPORT RBAAreaImpl : public RBAArea, public RBAAllocatable
+{
+public:
+ explicit RBAAreaImpl(const std::string& name="");
+ RBAAreaImpl(const RBAAreaImpl&)=delete;
+ RBAAreaImpl(const RBAAreaImpl&&)=delete;
+ RBAAreaImpl& operator=(const RBAAreaImpl&)=delete;
+ RBAAreaImpl& operator=(const RBAAreaImpl&&)=delete;
+
+public:
+ std::string getName() const override;
+ std::int32_t getX() const override;
+ std::int32_t getY() const override;
+ std::int32_t getZorder() const override;
+ const std::list<const RBAViewContent*>& getContents() const override;
+ const std::list<const RBASize*>& getSizes() const override;
+ RBAArbitrationPolicy getArbitrationPolicy() const override;
+
+ void clearStatus() final;
+ bool isArea() const override;
+
+ void setZorder(const std::int32_t newZorder);
+ void setDefaultX(const std::int32_t defaultX);
+ void setDefaultY(const std::int32_t defaultY);
+ void setOffsetX(const std::int32_t offsetX);
+ void setOffsetY(const std::int32_t offsetY);
+ void addSize(const RBASizeImpl* size);
+ void addContent(const RBAViewContentImpl* const content);
+ void resetCoordinate();
+ RBAModelElementType getModelElementType() const override;
+ const std::list<const RBAViewContent*>& getAllViewContents() const;
+ const std::list<const RBAViewContent*> getAllViewContentsRecursive(const RBAAllocatable* const alloc) const;
+
+ // Log
+#ifdef RBA_USE_LOG
+ std::string getSymbol() const override;
+ std::string getHiddenSymbol() const override;
+#endif
+
+private:
+ std::int32_t x_ {0};
+ std::int32_t y_ {0};
+ std::int32_t defaultX_ {0};
+ std::int32_t defaultY_ {0};
+ std::int32_t zorder_ {0};
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<const RBASize*> externSizes_;
+ mutable std::list<const RBAViewContent*> externContents_;
+ mutable std::list<const RBAViewContent*> externAllContents_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAAreaMaker.cpp b/src/view/RBAAreaMaker.cpp
new file mode 100644
index 0000000..3b33572
--- /dev/null
+++ b/src/view/RBAAreaMaker.cpp
@@ -0,0 +1,90 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAAreaMaker.cpp
+/// @brief Area object generation class
+
+#include <iostream>
+#include "RBAAreaMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAAreaImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBASizeMaker.hpp"
+
+namespace rba
+{
+
+RBAAreaMaker::RBAAreaMaker()
+ : RBARuleObjectMaker{"areas"},
+ RBAAllocatableMaker()
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAAreaMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAAreaImpl>(name);
+}
+
+RBAModelElement*
+RBAAreaMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ element = RBAAllocatableMaker::setProperty(element, jsonElem, model, owner);
+ if (element == nullptr) {
+ return nullptr;
+ }
+
+ RBAAreaImpl* const area {dynamic_cast<RBAAreaImpl*>(element)};
+
+ // Set default X and Y
+ std::int32_t x{-1};
+ std::int32_t y{-1};
+ const RBAJsonElement* const elemX {jsonElem->findChildren("x")};
+ const RBAJsonElement* const elemY {jsonElem->findChildren("y")};
+ if(elemX != nullptr) {
+ x = elemX->getInt();
+ }
+ if(elemY != nullptr) {
+ y = elemY->getInt();
+ }
+ area->setDefaultX(x);
+ area->setDefaultY(y);
+
+ // Set zorder
+ const RBAJsonElement* const zorder {jsonElem->findChildren("zorder")};
+ if(zorder == nullptr) {
+ std::cerr << area->getElementName()
+ << ": zorder not found" << &std::endl;
+ return nullptr;
+ }
+ area->setZorder(zorder->getInt());
+
+ // Size
+ RBASizeMaker szMaker;
+ szMaker.setFactory(getFactory());
+ for(const auto& size : jsonElem->findChildren("size")->getChildren()) {
+ const auto sizeInst = szMaker.create(size.get(), model, area);
+ area->addSize(dynamic_cast<RBASizeImpl*>(sizeInst));
+ }
+
+ return area;
+}
+
+}
diff --git a/src/view/RBAAreaMaker.hpp b/src/view/RBAAreaMaker.hpp
new file mode 100644
index 0000000..291e91b
--- /dev/null
+++ b/src/view/RBAAreaMaker.hpp
@@ -0,0 +1,58 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAAreaMaker.hpp
+/// @brief Area object generation class header
+
+#ifndef RBAAREAMAKER_HPP
+#define RBAAREAMAKER_HPP
+
+#include "RBAAllocatableMaker.hpp"
+
+namespace rba
+{
+
+/// @brief Area object generation class
+class RBAAreaMaker : public RBAAllocatableMaker
+{
+public:
+ RBAAreaMaker();
+ RBAAreaMaker(const RBAAreaMaker&)=default;
+ RBAAreaMaker& operator=(const RBAAreaMaker&)=default;
+ // move削除
+ RBAAreaMaker(const RBAAreaMaker&&)=delete;
+ RBAAreaMaker& operator=(const RBAAreaMaker&&)=delete;
+ virtual ~RBAAreaMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] JSON element of jsonElem ModelElement
+ /// @param[in] model Model to save the generated object
+ /// @param[in,out] owner Parent object (unused)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAAreaOperator.cpp b/src/view/RBAAreaOperator.cpp
new file mode 100644
index 0000000..58ab1ac
--- /dev/null
+++ b/src/view/RBAAreaOperator.cpp
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Area oeprator class
+ */
+
+#include "RBAAreaOperator.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/view/RBAAreaOperator.hpp b/src/view/RBAAreaOperator.hpp
new file mode 100644
index 0000000..d17f470
--- /dev/null
+++ b/src/view/RBAAreaOperator.hpp
@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Area oeprator class header
+ */
+
+#ifndef RBAAREAOPERATOR_HPP
+#define RBAAREAOPERATOR_HPP
+
+#include "RBAAllocatableOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAAreaOperator : public RBAAllocatableOperator
+{
+public:
+ RBAAreaOperator()=default;
+ RBAAreaOperator(const RBAAreaOperator&)=delete;
+ RBAAreaOperator(const RBAAreaOperator&&)=delete;
+ RBAAreaOperator& operator=(const RBAAreaOperator&)=delete;
+ RBAAreaOperator& operator=(const RBAAreaOperator&&)=delete;
+ ~RBAAreaOperator()=default;
+};
+
+}
+
+#endif
diff --git a/src/view/RBAAreaSet.cpp b/src/view/RBAAreaSet.cpp
new file mode 100644
index 0000000..5ef8bee
--- /dev/null
+++ b/src/view/RBAAreaSet.cpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * AreaSet class
+ */
+
+#include "RBAAreaSet.hpp"
+#include "RBAArea.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBAAreaSet::RBAAreaSet(const std::string& name)
+ : RBARuleObject{name},
+ RBAAllocatableSet{name}
+{
+}
+
+const std::list<const RBAArea*>&
+RBAAreaSet::getTargets() const
+{
+ return externAreas_;
+}
+
+void
+RBAAreaSet::addTarget(const RBAAllocatable* alloc)
+{
+ RBAAllocatableSet::addTarget(alloc);
+ externAreas_.push_back(dynamic_cast<const RBAArea*>(alloc));
+}
+
+void
+RBAAreaSet::clear()
+{
+ RBAAllocatableSet::clear();
+ externAreas_.clear();
+}
+
+RBAModelElementType
+RBAAreaSet::getModelElementType() const
+{
+ return RBAModelElementType::AreaSet;
+}
+
+}
diff --git a/src/view/RBAAreaSet.hpp b/src/view/RBAAreaSet.hpp
new file mode 100644
index 0000000..33b9d6b
--- /dev/null
+++ b/src/view/RBAAreaSet.hpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * AreaSet class header
+ */
+
+#ifndef RBAAREASET_HPP
+#define RBAAREASET_HPP
+
+#include "RBAAllocatableSet.hpp"
+
+namespace rba
+{
+
+class RBAArea;
+class RBAAreaImpl;
+
+class DLL_EXPORT RBAAreaSet : public RBAAllocatableSet
+{
+public:
+ explicit RBAAreaSet(const std::string& name="");
+ RBAAreaSet(const RBAAreaSet&)=delete;
+ RBAAreaSet(const RBAAreaSet&&)=delete;
+ RBAAreaSet& operator=(const RBAAreaSet&)=delete;
+ RBAAreaSet& operator=(const RBAAreaSet&&)=delete;
+ virtual ~RBAAreaSet()=default;
+
+public:
+ const std::list<const RBAArea*>& getTargets() const;
+ void addTarget(const RBAAllocatable* alloc) override;
+ void clear() override;
+ RBAModelElementType getModelElementType() const override;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<const RBAArea*> externAreas_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAAreaSetMaker.cpp b/src/view/RBAAreaSetMaker.cpp
new file mode 100644
index 0000000..f1fdfa6
--- /dev/null
+++ b/src/view/RBAAreaSetMaker.cpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAAreaSetMaker.cpp
+/// @brief AreaSet object generation class
+
+#include "RBAAreaSetMaker.hpp"
+#include "RBAAreaSet.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAAreaSetMaker::RBAAreaSetMaker()
+ : RBARuleObjectMaker{"areasets"},
+ RBAAllocatableSetMaker()
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAAreaSetMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAAreaSet>(name);
+}
+
+RBAModelElement*
+RBAAreaSetMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBAAllocatableSetMaker::setProperty(element, jsonElem, model, owner));
+
+ RBAAreaSet* const areaSet {dynamic_cast<RBAAreaSet*>(element)};
+
+ model->addAreaSet(areaSet);
+
+ return areaSet;
+}
+
+}
diff --git a/src/view/RBAAreaSetMaker.hpp b/src/view/RBAAreaSetMaker.hpp
new file mode 100644
index 0000000..0d9e57a
--- /dev/null
+++ b/src/view/RBAAreaSetMaker.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAAreaSetMaker.hpp
+/// @brief AreaSet object generation class header
+
+#ifndef RBAAREASETMAKER_HPP
+#define RBAAREASETMAKER_HPP
+
+#include "RBAAllocatableSetMaker.hpp"
+
+namespace rba
+{
+
+/// @brief AreaSet object generation class
+class RBAAreaSetMaker : public RBAAllocatableSetMaker
+{
+public:
+ RBAAreaSetMaker();
+ RBAAreaSetMaker(const RBAAreaSetMaker&)=delete;
+ RBAAreaSetMaker(const RBAAreaSetMaker&&)=delete;
+ RBAAreaSetMaker& operator=(const RBAAreaSetMaker&)=delete;
+ RBAAreaSetMaker& operator=(const RBAAreaSetMaker&&)=delete;
+ virtual ~RBAAreaSetMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] JSON element of jsonElem ModelElement
+ /// @param[in] model Model to save the generated object
+ /// @param[in,out] owner Parent object (unused)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBADisplayImpl.cpp b/src/view/RBADisplayImpl.cpp
new file mode 100644
index 0000000..0fe6f5b
--- /dev/null
+++ b/src/view/RBADisplayImpl.cpp
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Display implmentation class
+ */
+
+#include "RBADisplayImpl.hpp"
+#include "RBASizeImpl.hpp"
+#include "RBAAreaImpl.hpp"
+
+namespace rba
+{
+
+RBADisplayImpl::RBADisplayImpl(const std::string& name)
+ : RBADisplay(),
+ RBANamedElement{name}
+{
+}
+
+std::string
+RBADisplayImpl::getName() const
+{
+ return RBANamedElement::getElementName();
+}
+
+const RBASize*
+RBADisplayImpl::getSize() const
+{
+ return size_;
+}
+
+const std::list<const RBAArea*>&
+RBADisplayImpl::getAreas() const
+{
+ return getAreaImpls();
+}
+
+void
+RBADisplayImpl::setSize(const RBASizeImpl* const newSize)
+{
+ size_ = newSize;
+}
+
+void
+RBADisplayImpl::addArea(const RBAAreaImpl* area)
+{
+ areas_.push_back(area);
+}
+
+const std::list<const RBAArea*>&
+RBADisplayImpl::getAreaImpls() const
+{
+ return areas_;
+}
+
+}
diff --git a/src/view/RBADisplayImpl.hpp b/src/view/RBADisplayImpl.hpp
new file mode 100644
index 0000000..383ab4d
--- /dev/null
+++ b/src/view/RBADisplayImpl.hpp
@@ -0,0 +1,59 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Display implmentation class header
+ */
+
+#ifndef RBADISPLAYIMPL_HPP
+#define RBADISPLAYIMPL_HPP
+
+#include "RBADisplay.hpp"
+#include "RBANamedElement.hpp"
+
+namespace rba
+{
+
+class RBASizeImpl;
+class RBAAreaImpl;
+
+class RBADisplayImpl : public RBADisplay, public RBANamedElement
+{
+public:
+ explicit RBADisplayImpl(const std::string& name);
+ RBADisplayImpl(const RBADisplayImpl&)=delete;
+ RBADisplayImpl(const RBADisplayImpl&&)=delete;
+ RBADisplayImpl& operator=(const RBADisplayImpl&)=delete;
+ RBADisplayImpl& operator=(const RBADisplayImpl&&)=delete;
+ virtual ~RBADisplayImpl()=default;
+
+public:
+ std::string getName() const override;
+ const RBASize* getSize() const override;
+ const std::list<const RBAArea*>& getAreas() const override;
+
+ void setSize(const RBASizeImpl* const newSize);
+ void addArea(const RBAAreaImpl* area);
+ const std::list<const RBAArea*>& getAreaImpls() const;
+
+private:
+ std::list<const RBAArea*> areas_;
+ const RBASizeImpl* size_ {nullptr};
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBADisplayMaker.cpp b/src/view/RBADisplayMaker.cpp
new file mode 100644
index 0000000..b7e1206
--- /dev/null
+++ b/src/view/RBADisplayMaker.cpp
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBADisplayMaker.cpp
+/// @brief Display object generation class
+
+#include "RBADisplayMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBADisplayImpl.hpp"
+#include "RBASizeMaker.hpp"
+#include "RBAPositionContainerMaker.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBADisplayMaker::RBADisplayMaker()
+ : RBAModelElementMaker::RBAModelElementMaker{"displays"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBADisplayMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBADisplayImpl>(name);
+}
+
+RBAModelElement*
+RBADisplayMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBADisplayImpl* const display {dynamic_cast<RBADisplayImpl*>(element)};
+
+ // Set size
+ RBASizeMaker sizeMaker;
+ sizeMaker.setFactory(getFactory());
+ const RBAModelElement* const size {sizeMaker.create(jsonElem->findChildren("size"), model,
+ display)};
+ display->setSize(dynamic_cast<const RBASizeImpl*>(size));
+
+ // Set position container
+ const RBAJsonElement* const jsonPosConts {jsonElem->findChildren("PositionContainer")};
+ if(jsonPosConts != nullptr) {
+ RBAPositionContainerMaker pcMaker;
+ pcMaker.setFactory(getFactory());
+ for(const auto& jsonPosCont : jsonPosConts->getChildren()) {
+ static_cast<void>(pcMaker.create(jsonPosCont.get(), model, display));
+ }
+ }
+
+ model->addDisplay(display);
+
+ return display;
+}
+
+}
diff --git a/src/view/RBADisplayMaker.hpp b/src/view/RBADisplayMaker.hpp
new file mode 100644
index 0000000..ee6b5ed
--- /dev/null
+++ b/src/view/RBADisplayMaker.hpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBADisplayMaker.hpp
+/// @brief Display object generation class header
+
+#ifndef RBADISPLAYMAKER_HPP
+#define RBADISPLAYMAKER_HPP
+
+#include "RBAModelElementMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief Display object generation class
+class RBADisplayMaker : public RBAModelElementMaker
+{
+public:
+ RBADisplayMaker();
+ RBADisplayMaker(const RBADisplayMaker&)=delete;
+ RBADisplayMaker(const RBADisplayMaker&&)=delete;
+ RBADisplayMaker& operator=(const RBADisplayMaker&)=delete;
+ RBADisplayMaker& operator=(const RBADisplayMaker&&)=delete;
+ virtual ~RBADisplayMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] JSON element of jsonElem ModelElement
+ /// @param[in] model Model to save the generated object
+ /// @param[in,out] owner Parent object (unused)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBADisplayingContent.cpp b/src/view/RBADisplayingContent.cpp
new file mode 100644
index 0000000..003e3c3
--- /dev/null
+++ b/src/view/RBADisplayingContent.cpp
@@ -0,0 +1,138 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Displaying content class
+ */
+
+#include "RBADisplayingContent.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentState.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAResultImpl.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void
+RBADisplayingContent::accept(RBAExpressionVisitor& visitor)
+{
+ // RBASceneAllocatableCollector, the only existing visitor at this time,
+ // does not accept Content, so it does not pass this path.
+ // This is implemented because another visitor may accept it in the future.
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBADisplayingContent::getModelElementType() const
+{
+ return RBAModelElementType::DisplayingContent;
+}
+
+const RBARuleObject*
+RBADisplayingContent::getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ const RBARuleObject* object {nullptr};
+ const auto leftInfo = info->getChild(0U);
+ const auto ruleObj = getLhsOperand()->getReferenceObject(leftInfo, arb);
+ if (!leftInfo->isExceptionBeforeArbitrate()) {
+ if (ruleObj != nullptr) {
+ const RBAAllocatable* const alloc {dynamic_cast<const RBAAllocatable*>(ruleObj->getRawObject())};
+ if (ruleObj->isPrevious()) {
+ if (!arb->getResult()->isPreHidden(alloc)) {
+ const auto contentState = arb->getResult()->getDirectPreContentState(alloc);
+ if (contentState != nullptr) {
+ object = contentState->getOwner();
+ }
+ }
+ } else {
+ if (!alloc->isChecked()) {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ // When "Hidden" judgment is not executed, or when "Hidden" is already
+ // judged and "Hidden" is false, contentState assigned to allocatable
+ // is acquired.
+ else if (!alloc->isHiddenChecked() || !alloc->isHidden()) {
+ const auto contentState = alloc->getState();
+ if (contentState != nullptr) {
+ object = contentState->getOwner();
+ }
+ // At this point, it is unknown whether the constraint expression
+ // will be False or True, so put it in both.
+ info->addFalseAllocatable(alloc);
+ info->addTrueAllocatable(alloc);
+ } else {
+ ;
+ }
+ }
+ }
+ } else {
+ info->setExceptionBeforeArbitrate(true);
+ }
+#ifdef RBA_USE_LOG
+ bool pre = false;
+ std::string operandName;
+ std::string resultText;
+ if (ruleObj == nullptr) {
+ operandName = "NULL";
+ } else {
+ pre = ruleObj->isPrevious();
+ operandName = ruleObj->getElementName();
+ }
+ if (leftInfo->isExceptionBeforeArbitrate()) {
+ resultText = "is before arbitrate skip";
+ } else if (object == nullptr) {
+ if((ruleObj != nullptr) && dynamic_cast<const RBAAllocatable*>(ruleObj->getRawObject())->isChecked()) {
+ resultText = "has no Displayed Content";
+ } else {
+ resultText = "is before arbitrate skip";
+ }
+ } else {
+ resultText = "has Displayed Content[" + object->getElementName() + "]";
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(pre) + "Area[" + operandName + "] " + resultText);
+#endif
+ return object;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBADisplayingContent::getSymbol() const
+{
+ return ".displayingContent()";
+}
+
+void
+RBADisplayingContent::createHierarchy()
+{
+ getLhsOperand()->createHierarchy();
+}
+
+RBAExpressionType
+RBADisplayingContent::getUnderlyingType() const
+{
+ return RBAExpressionType::CONTENT;
+}
+#endif
+
+}
diff --git a/src/view/RBADisplayingContent.hpp b/src/view/RBADisplayingContent.hpp
new file mode 100644
index 0000000..0bcbf5a
--- /dev/null
+++ b/src/view/RBADisplayingContent.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Displaying content class header
+ */
+
+#ifndef RBADISPLAYINGCONTENT_HPP
+#define RBADISPLAYINGCONTENT_HPP
+
+#include <string>
+#include "RBAAreaOperator.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBADisplayingContent : public RBAAreaOperator
+{
+public:
+ RBADisplayingContent()=default;
+ RBADisplayingContent(const RBADisplayingContent&)=delete;
+ RBADisplayingContent(const RBADisplayingContent&&)=delete;
+ RBADisplayingContent& operator=(const RBADisplayingContent&)=delete;
+ RBADisplayingContent& operator=(const RBADisplayingContent&&)=delete;
+ virtual ~RBADisplayingContent()=default;
+
+ public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ const RBARuleObject* getReferenceObjectCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ void createHierarchy() override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBADisplayingContentMaker.cpp b/src/view/RBADisplayingContentMaker.cpp
new file mode 100644
index 0000000..0606263
--- /dev/null
+++ b/src/view/RBADisplayingContentMaker.cpp
@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBADisplayingContentMaker.cpp
+/// @brief DisplayingContent object generation class
+
+#include <iostream>
+#include "RBADisplayingContentMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBADisplayingContent.hpp"
+
+namespace rba
+{
+
+RBADisplayingContentMaker::RBADisplayingContentMaker()
+ : RBAOperatorMaker{"DisplayingContent"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBADisplayingContentMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBADisplayingContent>();
+}
+
+}
diff --git a/src/view/RBADisplayingContentMaker.hpp b/src/view/RBADisplayingContentMaker.hpp
new file mode 100644
index 0000000..4624651
--- /dev/null
+++ b/src/view/RBADisplayingContentMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBADisplayingContentMaker.hpp
+/// @brief DisplayingContent object generation class header
+
+#ifndef RBADISPLAYINGCONTENTMAKER_HPP
+#define RBADISPLAYINGCONTENTMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief DisplayingContent object generation class
+class RBADisplayingContentMaker : public RBAOperatorMaker
+{
+public:
+ RBADisplayingContentMaker();
+ RBADisplayingContentMaker(const RBADisplayingContentMaker&)=delete;
+ RBADisplayingContentMaker(const RBADisplayingContentMaker&&)=delete;
+ RBADisplayingContentMaker& operator=(const RBADisplayingContentMaker&)=delete;
+ RBADisplayingContentMaker& operator=(const RBADisplayingContentMaker&&)=delete;
+ virtual ~RBADisplayingContentMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAIsDisplayed.cpp b/src/view/RBAIsDisplayed.cpp
new file mode 100644
index 0000000..34a445d
--- /dev/null
+++ b/src/view/RBAIsDisplayed.cpp
@@ -0,0 +1,146 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// IsDisplayed class
+
+#include "RBAIsDisplayed.hpp"
+
+#include "RBAExpression.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBARuleObject.hpp"
+#include "RBAContentState.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAResultImpl.hpp"
+#include "RBAContent.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void RBAIsDisplayed::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsDisplayed::getModelElementType() const
+{
+ return RBAModelElementType::IsDisplayed;
+}
+
+bool
+RBAIsDisplayed::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to the constraint hierarchy for coverage.
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj {getLhsOperand()->getReferenceObject(leftInfo,
+ arb)};
+ if ((leftInfo->isExceptionBeforeArbitrate()) || (ruleObj == nullptr)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ const RBAAllocatable* const allocatable {dynamic_cast<const RBAAllocatable*>(ruleObj->getRawObject())};
+ info->addOperandAllocatable(allocatable);
+ if (ruleObj->isPrevious() == true) {
+ if ((arb->getResult()->isPreHidden(allocatable) == false)
+ && (arb->getResult()->getPreAllocatedContentState(allocatable)
+ != nullptr)) {
+ isPassed = true;
+ }
+ } else {
+ if ((allocatable->isHiddenChecked() == true)
+ && (allocatable->isHidden() == true)) {
+ info->addFalseAllocatable(allocatable);
+ } else {
+ if (allocatable->isChecked() == true) {
+ if (allocatable->getState() != nullptr) {
+ info->addTrueAllocatable(allocatable);
+ isPassed = true;
+ } else {
+ info->addFalseAllocatable(allocatable);
+ }
+ } else {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ }
+ }
+ }
+#ifdef RBA_USE_LOG
+ std::string lhsName;
+ const RBAAllocatable* allocatable = nullptr;
+ if (ruleObj == nullptr) {
+ // At the moment, there is no expression that returns null as Allocatable,
+ // so it will not go through this path.
+ // but in the future, an expression that returns null may be added
+ // so this is implemented.
+ lhsName = "NULL";
+ } else {
+ allocatable = dynamic_cast<const RBAAllocatable*>(ruleObj->getRawObject());
+ lhsName = allocatable->getElementName();
+ }
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Area[" + lhsName
+ + "] is before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ const RBAContentState* contentState;
+ if (ruleObj->isPrevious() == true) {
+ contentState = arb->getResult()->getPreAllocatedContentState(allocatable);
+ } else {
+ contentState = allocatable->getState();
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Area[" + lhsName
+ + "] is Displayed Content["
+ + contentState->getOwner()->getElementName()
+ + "::" + contentState->getElementName() + "]");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Area[" + lhsName
+ + "] is not Displayed");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from the constraint hierarchy for coverage.
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsDisplayed::getSymbol() const
+{
+ return ".isDisplayed()";
+}
+
+RBAExpressionType
+RBAIsDisplayed::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/view/RBAIsDisplayed.hpp b/src/view/RBAIsDisplayed.hpp
new file mode 100644
index 0000000..a991588
--- /dev/null
+++ b/src/view/RBAIsDisplayed.hpp
@@ -0,0 +1,53 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// IsDisplayed class header
+
+#ifndef RBAISDISPLAYED_HPP
+#define RBAISDISPLAYED_HPP
+
+#include "RBAAreaOperator.hpp"
+
+namespace rba
+{
+
+class RBAExpression;
+
+class DLL_EXPORT RBAIsDisplayed : public RBAAreaOperator
+{
+public:
+ RBAIsDisplayed()=default;
+ RBAIsDisplayed(const RBAIsDisplayed&)=delete;
+ RBAIsDisplayed(const RBAIsDisplayed&&)=delete;
+ RBAIsDisplayed& operator=(const RBAIsDisplayed&)=delete;
+ RBAIsDisplayed& operator=(const RBAIsDisplayed&&)=delete;
+ virtual ~RBAIsDisplayed()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAIsDisplayedMaker.cpp b/src/view/RBAIsDisplayedMaker.cpp
new file mode 100644
index 0000000..a47b97f
--- /dev/null
+++ b/src/view/RBAIsDisplayedMaker.cpp
@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsDisplayedMaker.cpp
+/// @brief IsDisplayed object generation class
+
+#include <iostream>
+#include "RBAIsDisplayedMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAIsDisplayed.hpp"
+
+namespace rba
+{
+
+RBAIsDisplayedMaker::RBAIsDisplayedMaker()
+ : RBAOperatorMaker{"IsDisplayed"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsDisplayedMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsDisplayed>();
+}
+
+}
diff --git a/src/view/RBAIsDisplayedMaker.hpp b/src/view/RBAIsDisplayedMaker.hpp
new file mode 100644
index 0000000..836602b
--- /dev/null
+++ b/src/view/RBAIsDisplayedMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsDisplayedMaker.hpp
+/// @brief IsDisplayed object generation class header
+
+#ifndef RBAISDISPLAYEDMAKER_HPP
+#define RBAISDISPLAYEDMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief IsDisplayed object generation class
+class RBAIsDisplayedMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsDisplayedMaker();
+ RBAIsDisplayedMaker(const RBAIsDisplayedMaker&)=delete;
+ RBAIsDisplayedMaker(const RBAIsDisplayedMaker&&)=delete;
+ RBAIsDisplayedMaker& operator=(const RBAIsDisplayedMaker&)=delete;
+ RBAIsDisplayedMaker& operator=(const RBAIsDisplayedMaker&&)=delete;
+ virtual ~RBAIsDisplayedMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAIsHidden.cpp b/src/view/RBAIsHidden.cpp
new file mode 100644
index 0000000..f33c3ed
--- /dev/null
+++ b/src/view/RBAIsHidden.cpp
@@ -0,0 +1,124 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// IsHidden class
+
+#include "RBAIsHidden.hpp"
+
+#include "RBAArbitrator.hpp"
+#include "RBAAllocatable.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAResultImpl.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAConstraintInfo.hpp"
+
+namespace rba
+{
+
+void RBAIsHidden::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsHidden::getModelElementType() const
+{
+ return RBAModelElementType::IsHidden;
+}
+
+bool
+RBAIsHidden::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to the constraint hierarchy for coverage.
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj {getLhsOperand()->getReferenceObject(leftInfo,
+ arb)};
+ if ((leftInfo->isExceptionBeforeArbitrate()) || (ruleObj == nullptr)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else {
+ const RBAAllocatable* const area {dynamic_cast<const RBAAllocatable*>(ruleObj->getRawObject())};
+ info->addOperandAllocatable(area);
+ if (ruleObj->isPrevious() == false) {
+ if (area->isHiddenChecked() == false) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (area->isHidden() == true) {
+ isPassed = true;
+ info->addTrueAllocatable(area);
+ } else {
+ info->addFalseAllocatable(area);
+ }
+ } else {
+ isPassed = arb->getResult()->isPreHidden(area);
+ }
+ }
+#ifdef RBA_USE_LOG
+ if (ruleObj != nullptr) {
+ const RBAAllocatable* area = dynamic_cast<const RBAAllocatable*>(ruleObj
+ ->getRawObject());
+ if (info->isExceptionBeforeArbitrate() == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + area->getElementName() + getSymbol()
+ + "] before arbitrate skip");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + getPreMsg(ruleObj->isPrevious()) + area->getElementName()
+ + getSymbol() + "] true");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " [" + getPreMsg(ruleObj->isPrevious()) + area->getElementName()
+ + getSymbol() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+ } else {
+ // At the moment, there is no expression that returns null as Allocatable,
+ // so it will not go through this path.
+ // but in the future, an expression that returns null may be added
+ // so this is implemented.
+ LOG_arbitrateConstraintLogicLogLine(
+ " [NULL" + getSymbol() + "] false");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from the constraint hierarchy for coverage.
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsHidden::getSymbol() const
+{
+ return ".isHidden()";
+}
+
+RBAExpressionType
+RBAIsHidden::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/view/RBAIsHidden.hpp b/src/view/RBAIsHidden.hpp
new file mode 100644
index 0000000..ab33826
--- /dev/null
+++ b/src/view/RBAIsHidden.hpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// IsHidden class header
+
+#ifndef RBAISHIDDEN_HPP
+#define RBAISHIDDEN_HPP
+
+#include <string>
+#include "RBAAreaOperator.hpp"
+
+namespace rba
+{
+
+class RBAExpression;
+
+class DLL_EXPORT RBAIsHidden : public RBAAreaOperator
+{
+public:
+ RBAIsHidden()=default;
+ RBAIsHidden(const RBAIsHidden&)=delete;
+ RBAIsHidden(const RBAIsHidden&&)=delete;
+ RBAIsHidden& operator=(const RBAIsHidden&)=delete;
+ RBAIsHidden& operator=(const RBAIsHidden&&)=delete;
+ virtual ~RBAIsHidden()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAIsHiddenMaker.cpp b/src/view/RBAIsHiddenMaker.cpp
new file mode 100644
index 0000000..398074a
--- /dev/null
+++ b/src/view/RBAIsHiddenMaker.cpp
@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsHiddenMaker.cpp
+/// @brief IsHidden object generation class
+
+#include <iostream>
+#include "RBAIsHiddenMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAIsHidden.hpp"
+
+namespace rba
+{
+
+RBAIsHiddenMaker::RBAIsHiddenMaker()
+ : RBAOperatorMaker{"IsHidden"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsHiddenMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsHidden>();
+}
+
+}
diff --git a/src/view/RBAIsHiddenMaker.hpp b/src/view/RBAIsHiddenMaker.hpp
new file mode 100644
index 0000000..c782674
--- /dev/null
+++ b/src/view/RBAIsHiddenMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsHiddenMaker.hpp
+/// @brief IsHidden object generation class header
+
+#ifndef RBAISHIDDENMAKER_HPP
+#define RBAISHIDDENMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief IsHidden object generation class
+class RBAIsHiddenMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsHiddenMaker();
+ RBAIsHiddenMaker(const RBAIsHiddenMaker&)=delete;
+ RBAIsHiddenMaker(const RBAIsHiddenMaker&&)=delete;
+ RBAIsHiddenMaker& operator=(const RBAIsHiddenMaker&)=delete;
+ RBAIsHiddenMaker& operator=(const RBAIsHiddenMaker&&)=delete;
+ virtual ~RBAIsHiddenMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAIsVisible.cpp b/src/view/RBAIsVisible.cpp
new file mode 100644
index 0000000..8ebfac7
--- /dev/null
+++ b/src/view/RBAIsVisible.cpp
@@ -0,0 +1,157 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// IsVisible class
+
+#include "RBAAllocatable.hpp"
+#include "RBAArbitrator.hpp"
+#include "RBAConstraintInfo.hpp"
+#include "RBAContent.hpp"
+#include "RBAContentState.hpp"
+#include "RBAExecuteResult.hpp"
+#include "RBAExpressionType.hpp"
+#include "RBAExpressionVisitor.hpp"
+#include "RBAIsVisible.hpp"
+#include "RBALogManager.hpp"
+#include "RBAModelElementType.hpp"
+#include "RBAResultImpl.hpp"
+
+namespace rba
+{
+
+void RBAIsVisible::accept(RBAExpressionVisitor& visitor)
+{
+ visitor.visit(*this);
+}
+
+RBAModelElementType
+RBAIsVisible::getModelElementType() const
+{
+ return RBAModelElementType::IsVisible;
+}
+
+bool
+RBAIsVisible::executeCore(RBAConstraintInfo* info,
+ RBAArbitrator* arb) const
+{
+ bool isPassed {false};
+ // Add itself to the constraint hierarchy for coverage.
+ LOG_addHierarchy(LOG_getSymbol());
+ RBAConstraintInfo* const leftInfo {info->getChild(0U)};
+ const RBARuleObject* const ruleObj
+ {getLhsOperand()->getReferenceObject(leftInfo, arb)};
+ const RBAContent* content {nullptr};
+ if (ruleObj != nullptr) {
+ content = dynamic_cast<const RBAContent*>(ruleObj->getRawObject());
+ }
+ if (leftInfo->isExceptionBeforeArbitrate() || (content == nullptr)) {
+ info->setExceptionBeforeArbitrate(true);
+ } else if (ruleObj->isPrevious() == false) {
+ const RBAContentState* const contentState
+ {arb->getResult()->getActiveState(content)};
+ if (contentState != nullptr) {
+ for(const RBAAllocatable* const allocatable : content->getAllocatables()) {
+ info->addOperandAllocatable(allocatable);
+ const RBAContentState* const allocateContentState {allocatable->getState()};
+ if (allocatable->isChecked() == true) {
+ if (contentState == allocateContentState) {
+ if ((allocatable->isHiddenChecked() == true)
+ && (allocatable->isHidden() == true)) {
+ info->addFalseAllocatable(allocatable);
+ } else {
+ info->setExceptionBeforeArbitrate(false);
+ info->clearFalseAllocatable();
+ info->addTrueAllocatable(allocatable);
+ isPassed = true;
+ break;
+ }
+ } else {
+ info->addFalseAllocatable(allocatable);
+ }
+ } else {
+ info->setExceptionBeforeArbitrate(true);
+ }
+ }
+ } else {
+ for (auto& a : content->getAllocatables()) {
+ info->addFalseAllocatable(a);
+ }
+ }
+ } else {
+ const RBAContentState* const contentState {arb->getResult()->getPreActiveState(content)};
+ if (contentState != nullptr) {
+ for(const RBAAllocatable* const allocatable : content->getAllocatables()) {
+ info->addOperandAllocatable(allocatable);
+ const RBAContentState* const allocateContentState {arb->getResult()->getPreAllocatedContentState(allocatable)};
+ if ((contentState == allocateContentState)
+ && (arb->getResult()->isPreHidden(allocatable) == false)) {
+ isPassed = true;
+ }
+ }
+ }
+ }
+#ifdef RBA_USE_LOG
+ if (info->isExceptionBeforeArbitrate() == true) {
+ if(content == nullptr) {
+ LOG_arbitrateConstraintLogicLogLine(
+ " Content[NULL] is not Visible");
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Content["
+ + content->getElementName() + "] is before arbitrate skip");
+ }
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::SKIP);
+ } else if (isPassed == true) {
+ const RBAContentState* contentState;
+ if (ruleObj->isPrevious() == true) {
+ contentState = arb->getResult()->getPreActiveState(content);
+ } else {
+ contentState = arb->getResult()->getActiveState(content);
+ }
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Content["
+ + content->getElementName() + "::" + contentState->getElementName()
+ + "] is Visible");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::TRUE);
+ } else {
+ LOG_arbitrateConstraintLogicLogLine(
+ " " + getPreMsg(ruleObj->isPrevious()) + "Content["
+ + content->getElementName() + "] is not Visible");
+ LOG_coverageConstraintExpressionLog(LOG_getCoverageExpressionText(),
+ RBAExecuteResult::FALSE);
+ }
+#endif
+ // Remove itself from the constraint hierarchy for coverage.
+ LOG_removeHierarchy();
+ return isPassed;
+}
+
+#ifdef RBA_USE_LOG
+const std::string
+RBAIsVisible::getSymbol() const
+{
+ return ".isVisible()";
+}
+
+RBAExpressionType
+RBAIsVisible::getUnderlyingType() const
+{
+ return RBAExpressionType::BOOLEAN;
+}
+#endif
+
+}
diff --git a/src/view/RBAIsVisible.hpp b/src/view/RBAIsVisible.hpp
new file mode 100644
index 0000000..a919519
--- /dev/null
+++ b/src/view/RBAIsVisible.hpp
@@ -0,0 +1,54 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// IsVisible class header
+
+#ifndef RBAISVISIBLE_HPP
+#define RBAISVISIBLE_HPP
+
+#include <string>
+#include "RBAViewContentOperator.hpp"
+
+namespace rba
+{
+
+class RBAViewContentImpl;
+
+class DLL_EXPORT RBAIsVisible : public RBAViewContentOperator
+{
+public:
+ RBAIsVisible()=default;
+ RBAIsVisible(const RBAIsVisible&)=delete;
+ RBAIsVisible(const RBAIsVisible&&)=delete;
+ RBAIsVisible& operator=(const RBAIsVisible&)=delete;
+ RBAIsVisible& operator=(const RBAIsVisible&&)=delete;
+ virtual ~RBAIsVisible()=default;
+
+public:
+ void accept(RBAExpressionVisitor& visitor) override;
+ RBAModelElementType getModelElementType() const override;
+ bool executeCore(RBAConstraintInfo* info, RBAArbitrator * arb) const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ const std::string getSymbol() const override;
+ RBAExpressionType getUnderlyingType() const override;
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAIsVisibleMaker.cpp b/src/view/RBAIsVisibleMaker.cpp
new file mode 100644
index 0000000..5b42220
--- /dev/null
+++ b/src/view/RBAIsVisibleMaker.cpp
@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsVisibleMaker.cpp
+/// @brief IsVisible objct generation class
+
+#include <iostream>
+#include "RBAIsVisibleMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+#include "RBAIsVisible.hpp"
+
+namespace rba
+{
+
+RBAIsVisibleMaker::RBAIsVisibleMaker()
+ : RBAOperatorMaker{"IsVisible"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAIsVisibleMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAIsVisible>();
+}
+
+}
diff --git a/src/view/RBAIsVisibleMaker.hpp b/src/view/RBAIsVisibleMaker.hpp
new file mode 100644
index 0000000..81e0175
--- /dev/null
+++ b/src/view/RBAIsVisibleMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAIsVisibleMaker.hpp
+/// @brief IsVisible objct generation class header
+
+#ifndef RBAISVISIBLEMAKER_HPP
+#define RBAISVISIBLEMAKER_HPP
+
+#include "RBAOperatorMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief IsVisible objct generation class
+class RBAIsVisibleMaker : public RBAOperatorMaker
+{
+public:
+ RBAIsVisibleMaker();
+ RBAIsVisibleMaker(const RBAIsVisibleMaker&)=delete;
+ RBAIsVisibleMaker(const RBAIsVisibleMaker&&)=delete;
+ RBAIsVisibleMaker& operator=(const RBAIsVisibleMaker&)=delete;
+ RBAIsVisibleMaker& operator=(const RBAIsVisibleMaker&&)=delete;
+ virtual ~RBAIsVisibleMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAPositionContainerImpl.cpp b/src/view/RBAPositionContainerImpl.cpp
new file mode 100644
index 0000000..5343336
--- /dev/null
+++ b/src/view/RBAPositionContainerImpl.cpp
@@ -0,0 +1,103 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * PositionContainerImpl class
+ */
+
+#include "RBAPositionContainerImpl.hpp"
+#include "RBAAreaImpl.hpp"
+
+namespace rba
+{
+
+std::int32_t
+RBAPositionContainerImpl::getX() const
+{
+ return x_;
+}
+
+void
+RBAPositionContainerImpl::setX(const std::int32_t newX)
+{
+ x_ = newX;
+}
+
+std::int32_t
+RBAPositionContainerImpl::getY() const
+{
+ return y_;
+}
+
+void
+RBAPositionContainerImpl::setY(const std::int32_t newY)
+{
+ y_ = newY;
+}
+
+RBABasePoint
+RBAPositionContainerImpl::getBasePoint() const
+{
+ return basePoint_;
+}
+
+void
+RBAPositionContainerImpl::setBasePoint(const RBABasePoint newBasePoint)
+{
+ basePoint_ = newBasePoint;
+}
+
+const RBAArea*
+RBAPositionContainerImpl::getArea() const
+{
+ return getAreaImpl();
+}
+
+void
+RBAPositionContainerImpl::setArea(const RBAAreaImpl* const newArea)
+{
+ area_ = newArea;
+}
+
+const RBAAreaImpl*
+RBAPositionContainerImpl::getAreaImpl() const
+{
+ return area_;
+}
+
+void
+RBAPositionContainerImpl::addOffset(const std::string& sizeName,
+ std::int32_t offsetX, std::int32_t offsetY)
+{
+ sizeToOffset_[sizeName] = std::make_pair(offsetX, offsetY);
+}
+
+std::pair<std::int32_t, std::int32_t>
+RBAPositionContainerImpl::getOffset(const std::string& sizeName) const
+{
+ std::pair<std::int32_t, std::int32_t> offset;
+
+ auto it = sizeToOffset_.find(sizeName);
+ if(it != sizeToOffset_.end()) {
+ offset = it->second;
+ }
+ else {
+ offset = std::make_pair(0, 0);
+ }
+
+ return offset;
+}
+
+}
diff --git a/src/view/RBAPositionContainerImpl.hpp b/src/view/RBAPositionContainerImpl.hpp
new file mode 100644
index 0000000..1f37e17
--- /dev/null
+++ b/src/view/RBAPositionContainerImpl.hpp
@@ -0,0 +1,70 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * PositionContainerImpl class header
+ */
+
+#ifndef RBAPOSITIONCONTAINERIMPL_HPP
+#define RBAPOSITIONCONTAINERIMPL_HPP
+
+#include <string>
+#include <cstdint>
+#include <unordered_map>
+#include "RBAPositionContainer.hpp"
+#include "RBAModelElement.hpp"
+
+namespace rba
+{
+
+class RBAAreaImpl;
+
+class RBAPositionContainerImpl : public RBAPositionContainer,
+ public RBAModelElement
+{
+public:
+ RBAPositionContainerImpl()=default;
+ RBAPositionContainerImpl(const RBAPositionContainerImpl&)=delete;
+ RBAPositionContainerImpl(const RBAPositionContainerImpl&&)=delete;
+ RBAPositionContainerImpl& operator=(const RBAPositionContainerImpl&)=delete;
+ RBAPositionContainerImpl& operator=(const RBAPositionContainerImpl&&)=delete;
+ virtual ~RBAPositionContainerImpl()=default;
+
+public:
+ std::int32_t getX() const override;
+ std::int32_t getY() const override;
+ RBABasePoint getBasePoint() const override;
+ const RBAArea* getArea() const override;
+ void setX(const std::int32_t newX);
+ void setY(const std::int32_t newY);
+ void setBasePoint(const RBABasePoint newBasePoint);
+ void setArea(const RBAAreaImpl* const newArea);
+ const RBAAreaImpl* getAreaImpl() const;
+ void addOffset(const std::string& sizeName,
+ std::int32_t offsetX, std::int32_t offsetY);
+ std::pair<std::int32_t, std::int32_t> getOffset(const std::string& sizeName) const;
+
+private:
+ std::int32_t x_ {X_EDEFAULT};
+ std::int32_t y_ {Y_EDEFAULT};
+ RBABasePoint basePoint_ {BASE_POINT_EDEFAULT};
+ const RBAAreaImpl* area_{nullptr};
+ std::unordered_map<std::string, std::pair<std::int32_t, std::int32_t>> sizeToOffset_;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAPositionContainerMaker.cpp b/src/view/RBAPositionContainerMaker.cpp
new file mode 100644
index 0000000..c2dd6db
--- /dev/null
+++ b/src/view/RBAPositionContainerMaker.cpp
@@ -0,0 +1,125 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAPositionContainerMaker.cpp
+/// @brief PositionContainer object generation class
+
+#include "RBAPositionContainerMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAPositionContainerImpl.hpp"
+#include "RBASizeMaker.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAPositionContainerMaker::RBAPositionContainerMaker()
+ : RBAModelElementMaker::RBAModelElementMaker{"PositionContainer"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAPositionContainerMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAPositionContainerImpl>();
+}
+
+RBAModelElement*
+RBAPositionContainerMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBAPositionContainerImpl* const posCont
+ {dynamic_cast<RBAPositionContainerImpl*>(element)};
+
+ // Set areaReference and x,y
+ std::int32_t x {-1};
+ std::int32_t y {-1};
+ const RBAJsonElement* const areaRef {jsonElem->findChildren("areaReference")};
+ RBAAreaImpl* const area {const_cast<RBAAreaImpl*>(model->findAreaImpl(areaRef->getString()))};
+ //// set area to owner
+ RBADisplayImpl* const display {dynamic_cast<RBADisplayImpl*>(owner)};
+ display->addArea(area);
+ //// set default x,y to area
+ const RBAJsonElement* const elemX {jsonElem->findChildren("x")};
+ if(elemX != nullptr) {
+ x = elemX->getInt();
+ area->setDefaultX(x);
+ }
+ const RBAJsonElement* const elemY {jsonElem->findChildren("y")};
+ if(elemY != nullptr) {
+ y = elemY->getInt();
+ area->setDefaultY(y);
+ }
+ posCont->setArea(area);
+ posCont->setX(x);
+ posCont->setY(y);
+
+ // Set basePoint
+ const std::string basePoint {jsonElem->findChildren("basePoint")->getString()};
+ RBABasePoint basePointVal{RBAPositionContainer::BASE_POINT_EDEFAULT};
+ if(basePoint == "LEFT_TOP") {
+ basePointVal = RBABasePoint::LEFT_TOP;
+ } else if(basePoint == "LEFT_MIDDLE") {
+ basePointVal = RBABasePoint::LEFT_MIDDLE;
+ } else if(basePoint == "LEFT_BOTTOM") {
+ basePointVal = RBABasePoint::LEFT_BOTTOM;
+ } else if(basePoint == "RIGHT_TOP") {
+ basePointVal = RBABasePoint::RIGHT_TOP;
+ } else if(basePoint == "RIGHT_MIDDLE") {
+ basePointVal = RBABasePoint::RIGHT_MIDDLE;
+ } else if(basePoint == "RIGHT_BOTTOM") {
+ basePointVal = RBABasePoint::RIGHT_BOTTOM;
+ } else if(basePoint == "CENTER_TOP") {
+ basePointVal = RBABasePoint::CENTER_TOP;
+ } else if(basePoint == "CENTER_MIDDLE") {
+ basePointVal = RBABasePoint::CENTER_MIDDLE;
+ } else if(basePoint == "CENTER_BOTTOM") {
+ basePointVal = RBABasePoint::CENTER_BOTTOM;
+ } else {
+ ;
+ }
+ posCont->setBasePoint(basePointVal);
+
+ // Set offset
+ const RBAJsonElement* const offsets {jsonElem->findChildren("Offset")};
+ if(offsets != nullptr) {
+ for(const auto& offset : offsets->getChildren()) {
+ const RBAJsonElement* const elemSizeRef {offset->findChildren("sizeReference")};
+ if(elemSizeRef != nullptr) {
+ std::int32_t offsetX {-1};
+ const RBAJsonElement* const elemOffsetX {offset->findChildren("x")};
+ if(elemOffsetX != nullptr) {
+ offsetX = elemOffsetX->getInt();
+ }
+ std::int32_t offsetY {-1};
+ const RBAJsonElement* const elemOffsetY {offset->findChildren("y")};
+ if(elemOffsetY != nullptr) {
+ offsetY = elemOffsetY->getInt();
+ }
+ posCont->addOffset(elemSizeRef->getString(), offsetX, offsetY);
+ }
+ }
+ }
+
+ model->addPositionContainer(posCont);
+
+ return posCont;
+}
+
+}
diff --git a/src/view/RBAPositionContainerMaker.hpp b/src/view/RBAPositionContainerMaker.hpp
new file mode 100644
index 0000000..3cfad0b
--- /dev/null
+++ b/src/view/RBAPositionContainerMaker.hpp
@@ -0,0 +1,61 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAPositionContainerMaker.hpp
+/// @brief PositionContainer object generation class header
+
+#ifndef RBAPOSITIONCONTAINERMAKER_HPP
+#define RBAPOSITIONCONTAINERMAKER_HPP
+
+#include "RBAModelElementMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief PositionContainer object generation class
+class RBAPositionContainerMaker : public RBAModelElementMaker
+{
+public:
+ RBAPositionContainerMaker();
+ RBAPositionContainerMaker(const RBAPositionContainerMaker&)=delete;
+ RBAPositionContainerMaker(const RBAPositionContainerMaker&&)=delete;
+ RBAPositionContainerMaker& operator=(const RBAPositionContainerMaker&)=delete;
+ RBAPositionContainerMaker& operator=(const RBAPositionContainerMaker&&)=delete;
+ virtual ~RBAPositionContainerMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] JSON element of jsonElem ModelElement
+ /// @param[in] model Model to save the generated object
+ /// @param[in,out] owner Parent object (unused)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBASizeImpl.cpp b/src/view/RBASizeImpl.cpp
new file mode 100644
index 0000000..d57b5ef
--- /dev/null
+++ b/src/view/RBASizeImpl.cpp
@@ -0,0 +1,76 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Size information implementation class
+ */
+
+#include "RBASizeImpl.hpp"
+
+namespace rba
+{
+
+RBASizeImpl::RBASizeImpl(const std::string& name)
+ : RBASize(),
+ RBANamedElement{name}
+{
+}
+
+std::string
+RBASizeImpl::getName() const
+{
+ return RBANamedElement::getElementName();
+}
+
+std::int32_t
+RBASizeImpl::getWidth() const
+{
+ return width_;
+}
+
+std::int32_t
+RBASizeImpl::getHeight() const
+{
+ return height_;
+}
+
+void
+RBASizeImpl::setWidth(const std::int32_t newWidth)
+{
+ width_ = newWidth;
+}
+
+void
+RBASizeImpl::setHeight(const std::int32_t newHeight)
+{
+ height_ = newHeight;
+}
+
+std::int32_t
+RBASizeImpl::diff(const RBASizeImpl* const size) const
+{
+ std::int32_t w {width_ - size->getWidth()};
+ if(w < 0) {
+ w = -w;
+ }
+ std::int32_t h {height_ - size->getHeight()};
+ if(h < 0) {
+ h = -h;
+ }
+
+ return w + h;
+}
+
+}
diff --git a/src/view/RBASizeImpl.hpp b/src/view/RBASizeImpl.hpp
new file mode 100644
index 0000000..e5d46e0
--- /dev/null
+++ b/src/view/RBASizeImpl.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * Size information implementation class header
+ */
+
+#ifndef RBASIZEIMPL_HPP
+#define RBASIZEIMPL_HPP
+
+#include "RBASize.hpp"
+#include "RBANamedElement.hpp"
+
+namespace rba
+{
+
+class RBASizeImpl : public RBASize, public RBANamedElement
+{
+public:
+ explicit RBASizeImpl(const std::string& name="");
+ RBASizeImpl(const RBASizeImpl&)=default;
+ RBASizeImpl(RBASizeImpl&&)=default;
+ RBASizeImpl& operator=(const RBASizeImpl&)=default;
+ RBASizeImpl& operator=(RBASizeImpl&&)=default;
+ virtual ~RBASizeImpl()=default;
+
+public:
+ std::string getName() const override;
+ std::int32_t getWidth() const override;
+ std::int32_t getHeight() const override;
+
+ void setWidth(const std::int32_t newWidth);
+ void setHeight(const std::int32_t newHeight);
+
+ std::int32_t diff(const RBASizeImpl* const size) const;
+
+private:
+ std::int32_t width_ {WIDTH_EDEFAULT};
+ std::int32_t height_ {HEIGHT_EDEFAULT};
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBASizeMaker.cpp b/src/view/RBASizeMaker.cpp
new file mode 100644
index 0000000..0cf38f1
--- /dev/null
+++ b/src/view/RBASizeMaker.cpp
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASizeMaker.cpp
+/// @brief Size information object generation class
+
+#include "RBASizeMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBASizeImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBASizeMaker::RBASizeMaker()
+ : RBAModelElementMaker::RBAModelElementMaker{"Size"}
+{
+}
+
+RBAModelElement*
+RBASizeMaker::create(const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ std::unique_ptr<RBAModelElement> inst
+ {createInstance(jsonElem->findChildren("name")->getString())};
+ const auto element = inst.get();
+ static_cast<void>(model->addSizeInstance(dynamic_cast<RBANamedElement*>(owner)->getElementName(), std::move(inst)));
+
+ return setProperty(element, jsonElem, model, owner);
+}
+
+std::unique_ptr<RBAModelElement>
+RBASizeMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBASizeImpl>(name);
+}
+
+RBAModelElement*
+RBASizeMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ RBASizeImpl* const size {dynamic_cast<RBASizeImpl*>(element)};
+
+ // Set width
+ size->setWidth(jsonElem->findChildren("width")->getInt());
+ // Set height
+ size->setHeight(jsonElem->findChildren("height")->getInt());
+
+ return size;
+}
+
+}
diff --git a/src/view/RBASizeMaker.hpp b/src/view/RBASizeMaker.hpp
new file mode 100644
index 0000000..58ba99b
--- /dev/null
+++ b/src/view/RBASizeMaker.hpp
@@ -0,0 +1,72 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBASizeMaker.hpp
+/// @brief Size information object generation class header
+
+#ifndef RBASIZEMAKER_HPP
+#define RBASIZEMAKER_HPP
+
+#include "RBAModelElementMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief Size information object generation class
+class RBASizeMaker : public RBAModelElementMaker
+{
+public:
+ RBASizeMaker();
+ RBASizeMaker(const RBASizeMaker&)=delete;
+ RBASizeMaker(const RBASizeMaker&&)=delete;
+ RBASizeMaker& operator=(const RBASizeMaker&)=delete;
+ RBASizeMaker& operator=(const RBASizeMaker&&)=delete;
+ virtual ~RBASizeMaker()=default;
+
+public:
+ /// @brief Create ModelElement object
+ /// @details Create ModelElement object and register unique_ptr to model.
+ /// @param[in] jsonElem JSON element of ModelElement
+ /// @param[in] model The model to store generated object
+ /// @param[in,out] owner Parent object (Not in use)
+ /// @return ModelElement object
+ RBAModelElement* create(const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] JSON element of jsonElem ModelElement
+ /// @param[in] model Model to save the generated object
+ /// @param[in,out] owner Parent object (unused)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAViewContent.cpp b/src/view/RBAViewContent.cpp
new file mode 100644
index 0000000..f32960e
--- /dev/null
+++ b/src/view/RBAViewContent.cpp
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ViewContent class
+ */
+
+#include "RBAViewContent.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/view/RBAViewContentImpl.cpp b/src/view/RBAViewContentImpl.cpp
new file mode 100644
index 0000000..8437dd5
--- /dev/null
+++ b/src/view/RBAViewContentImpl.cpp
@@ -0,0 +1,112 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * View Content implmentation class
+ */
+
+#include "RBAViewContentImpl.hpp"
+
+#include "RBAAreaImpl.hpp"
+#include "RBASizeImpl.hpp"
+#include "RBAViewContentStateImpl.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBAViewContentImpl::RBAViewContentImpl(const std::string& name)
+ : RBARuleObject{name},
+ RBAViewContent(),
+ RBAContent{name}
+{
+}
+
+/**
+ * Return true if RBAViewContent
+ */
+bool
+RBAViewContentImpl::isViewContent() const
+{
+ return true;
+}
+
+std::string
+RBAViewContentImpl::getName() const
+{
+ return RBANamedElement::getElementName();
+}
+
+const std::list<const RBAViewContentState*>&
+RBAViewContentImpl::getContentStates() const
+{
+ if(externStates_.size() == 0U) {
+ for(const RBAContentState* state : getStates()) {
+ externStates_.push_back(dynamic_cast<const RBAViewContentStateImpl*>(state));
+ }
+ }
+ return externStates_;
+}
+
+const std::list<const RBAArea*>&
+RBAViewContentImpl::getAreas() const
+{
+ if(externAreas_.size() == 0U) {
+ for(const RBAAllocatable* allocatable : getAllocatables()) {
+ externAreas_.push_back(dynamic_cast<const RBAAreaImpl*>(allocatable));
+ }
+ }
+ return externAreas_;
+}
+
+const std::list<const RBASize*>&
+RBAViewContentImpl::getSizes() const
+{
+ return externSizes_;
+}
+
+RBAContentLoserType
+RBAViewContentImpl::getLoserType() const
+{
+ return getContentLoserType();
+}
+
+void
+RBAViewContentImpl::addSize(const RBASizeImpl* size)
+{
+ externSizes_.push_back(size);
+}
+
+RBAModelElementType
+RBAViewContentImpl::getModelElementType() const
+{
+ return RBAModelElementType::ViewContent;
+}
+
+#ifdef RBA_USE_LOG
+std::string
+RBAViewContentImpl::getSymbol() const
+{
+ return "ViewContent";
+}
+
+std::string
+RBAViewContentImpl::getVisibleSymbol() const
+{
+ return "visible";
+}
+#endif
+
+}
diff --git a/src/view/RBAViewContentImpl.hpp b/src/view/RBAViewContentImpl.hpp
new file mode 100644
index 0000000..d3df5cd
--- /dev/null
+++ b/src/view/RBAViewContentImpl.hpp
@@ -0,0 +1,78 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * View Content implmentation class header
+ */
+
+#ifndef RBAVIEWCONTENTIMPL_HPP
+#define RBAVIEWCONTENTIMPL_HPP
+
+#include <string>
+#include "RBAViewContent.hpp"
+#include "RBAContent.hpp"
+
+namespace rba
+{
+
+class RBAViewContentState;
+class RBAArea;
+class RBASize;
+class RBASizeImpl;
+
+class DLL_EXPORT RBAViewContentImpl : public RBAViewContent, public RBAContent
+{
+public:
+ explicit RBAViewContentImpl(const std::string& name="");
+ RBAViewContentImpl(const RBAViewContentImpl&)=delete;
+ RBAViewContentImpl(const RBAViewContentImpl&&)=delete;
+ RBAViewContentImpl& operator=(const RBAViewContentImpl&)=delete;
+ RBAViewContentImpl& operator=(const RBAViewContentImpl&&)=delete;
+ virtual ~RBAViewContentImpl()=default;
+
+public:
+ bool isViewContent() const override;
+ std::string getName() const override;
+ const std::list<const RBAViewContentState*>& getContentStates() const override;
+ const std::list<const RBAArea*>& getAreas() const override;
+ const std::list<const RBASize*>& getSizes() const override;
+ RBAContentLoserType getLoserType() const override;
+
+ void addSize(const RBASizeImpl* size);
+ RBAModelElementType getModelElementType() const override;
+
+ // Log
+#ifdef RBA_USE_LOG
+ std::string getSymbol() const override;
+ std::string getVisibleSymbol() const override;
+#endif
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ mutable std::list<const RBAArea*> externAreas_;
+ mutable std::list<const RBASize*> externSizes_;
+ mutable std::list<const RBAViewContentState*> externStates_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAViewContentMaker.cpp b/src/view/RBAViewContentMaker.cpp
new file mode 100644
index 0000000..5a3cc87
--- /dev/null
+++ b/src/view/RBAViewContentMaker.cpp
@@ -0,0 +1,67 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAViewContentMaker.cpp
+/// @brief ViewContent object generation class
+
+#include "RBAViewContentMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAViewContentImpl.hpp"
+#include "RBASizeMaker.hpp"
+#include "RBAViewContentStateMaker.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAViewContentMaker::RBAViewContentMaker()
+ : RBARuleObjectMaker{"viewcontents"},
+ RBAContentMaker()
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAViewContentMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAViewContentImpl>(name);
+}
+
+RBAModelElement*
+RBAViewContentMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ element = RBAContentMaker::setProperty(element, jsonElem, model, owner);
+ if(element == nullptr) {
+ return nullptr;
+ }
+
+ RBAViewContentImpl* const content {dynamic_cast<RBAViewContentImpl*>(element)};
+
+ // size
+ RBASizeMaker szMaker;
+ szMaker.setFactory(getFactory());
+ for(auto& size : jsonElem->findChildren("size")->getChildren()) {
+ const auto sizeInst = szMaker.create(size.get(), model, content);
+ content->addSize(dynamic_cast<RBASizeImpl*>(sizeInst));
+ }
+
+ return content;
+}
+
+}
diff --git a/src/view/RBAViewContentMaker.hpp b/src/view/RBAViewContentMaker.hpp
new file mode 100644
index 0000000..e5abe5f
--- /dev/null
+++ b/src/view/RBAViewContentMaker.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAViewContentMaker.hpp
+/// @brief ViewContent object generation class header
+
+#ifndef RBAVIEWCONTENTMAKER_HPP
+#define RBAVIEWCONTENTMAKER_HPP
+
+#include "RBAContentMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ViewContent object generation class
+class RBAViewContentMaker : public RBAContentMaker
+{
+public:
+ RBAViewContentMaker();
+ RBAViewContentMaker(const RBAViewContentMaker&)=delete;
+ RBAViewContentMaker(const RBAViewContentMaker&&)=delete;
+ RBAViewContentMaker& operator=(const RBAViewContentMaker&)=delete;
+ RBAViewContentMaker& operator=(const RBAViewContentMaker&&)=delete;
+ virtual ~RBAViewContentMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] JSON element of jsonElem ModelElement
+ /// @param[in] model Model to save the generated object
+ /// @param[in,out] owner Parent object (unused)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAViewContentOperator.cpp b/src/view/RBAViewContentOperator.cpp
new file mode 100644
index 0000000..82813e9
--- /dev/null
+++ b/src/view/RBAViewContentOperator.cpp
@@ -0,0 +1,26 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ViewContentOperator class
+ */
+
+#include "RBAViewContentOperator.hpp"
+#include "RBAViewContentImpl.hpp"
+
+namespace rba
+{
+
+}
diff --git a/src/view/RBAViewContentOperator.hpp b/src/view/RBAViewContentOperator.hpp
new file mode 100644
index 0000000..04aabd0
--- /dev/null
+++ b/src/view/RBAViewContentOperator.hpp
@@ -0,0 +1,45 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ViewContentOperator class header
+ */
+
+#ifndef RBAVIEWCONTENTOPERATOR_HPP
+#define RBAVIEWCONTENTOPERATOR_HPP
+
+#include "RBAContentOperator.hpp"
+
+namespace rba
+{
+
+class RBAViewContentImpl;
+
+class DLL_EXPORT RBAViewContentOperator : public RBAContentOperator
+{
+protected:
+ RBAViewContentOperator()=default;
+ RBAViewContentOperator(const RBAViewContentOperator&)=delete;
+ RBAViewContentOperator(const RBAViewContentOperator&&)=delete;
+ RBAViewContentOperator& operator=(const RBAViewContentOperator&)=delete;
+ RBAViewContentOperator& operator=(const RBAViewContentOperator&&)=delete;
+
+public:
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAViewContentSet.cpp b/src/view/RBAViewContentSet.cpp
new file mode 100644
index 0000000..4ea135d
--- /dev/null
+++ b/src/view/RBAViewContentSet.cpp
@@ -0,0 +1,60 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ViewContentSet class
+ */
+
+#include "RBAViewContentSet.hpp"
+#include "RBAViewContent.hpp"
+#include "RBAContent.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBAViewContentSet::RBAViewContentSet(const std::string& name)
+ : RBARuleObject{name},
+ RBAContentSet{name}
+{
+}
+
+const std::list<const RBAViewContent*>&
+RBAViewContentSet::getTargets() const
+{
+ return externalContents_;
+}
+
+void
+RBAViewContentSet::addTarget(const RBAContent* content)
+{
+ RBAContentSet::addTarget(content);
+ externalContents_.push_back(dynamic_cast<const RBAViewContent*>(content));
+}
+
+void
+RBAViewContentSet::clear()
+{
+ RBAContentSet::clear();
+ externalContents_.clear();
+}
+
+RBAModelElementType
+RBAViewContentSet::getModelElementType() const
+{
+ return RBAModelElementType::ViewContentSet;
+}
+
+}
diff --git a/src/view/RBAViewContentSet.hpp b/src/view/RBAViewContentSet.hpp
new file mode 100644
index 0000000..61dcba4
--- /dev/null
+++ b/src/view/RBAViewContentSet.hpp
@@ -0,0 +1,62 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * ViewContentSet class header
+ */
+
+#ifndef RBAVIEWCONTENTSET_HPP
+#define RBAVIEWCONTENTSET_HPP
+
+#include "RBAContentSet.hpp"
+#include "RBADllExport.hpp"
+
+namespace rba
+{
+
+class RBAViewContent;
+class RBAViewContentImpl;
+
+class DLL_EXPORT RBAViewContentSet : public RBAContentSet
+{
+public:
+ explicit RBAViewContentSet(const std::string& name="");
+ RBAViewContentSet(const RBAViewContentSet&)=delete;
+ RBAViewContentSet(const RBAViewContentSet&&)=delete;
+ RBAViewContentSet& operator=(const RBAViewContentSet&)=delete;
+ RBAViewContentSet& operator=(const RBAViewContentSet&&)=delete;
+ virtual ~RBAViewContentSet()=default;
+
+public:
+ const std::list<const RBAViewContent*>& getTargets() const;
+ void addTarget(const RBAContent* content) override;
+ void clear() override;
+ RBAModelElementType getModelElementType() const override;
+
+private:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<const RBAViewContent*> externalContents_;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAViewContentSetMaker.cpp b/src/view/RBAViewContentSetMaker.cpp
new file mode 100644
index 0000000..8a49520
--- /dev/null
+++ b/src/view/RBAViewContentSetMaker.cpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAViewContentSetMaker.cpp
+/// @brief ViewContentSet object geneation class
+
+#include "RBAViewContentSetMaker.hpp"
+#include "RBAViewContentSet.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAViewContentSetMaker::RBAViewContentSetMaker()
+ : RBARuleObjectMaker{"viewcontentsets"},
+ RBAContentSetMaker()
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAViewContentSetMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAViewContentSet>(name);
+}
+
+RBAModelElement*
+RBAViewContentSetMaker::setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner)
+{
+ static_cast<void>(RBAContentSetMaker::setProperty(element, jsonElem, model, owner));
+
+ const auto contentSet = dynamic_cast<RBAViewContentSet*>(element);
+
+ model->addViewContentSet(contentSet);
+
+ return contentSet;
+}
+
+}
diff --git a/src/view/RBAViewContentSetMaker.hpp b/src/view/RBAViewContentSetMaker.hpp
new file mode 100644
index 0000000..e731cc9
--- /dev/null
+++ b/src/view/RBAViewContentSetMaker.hpp
@@ -0,0 +1,57 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAViewContentSetMaker.hpp
+/// @brief ViewContentSet object geneation class header
+
+#ifndef RBAVIEWCONTENTSETMAKER_HPP
+#define RBAVIEWCONTENTSETMAKER_HPP
+
+#include "RBAContentSetMaker.hpp"
+
+namespace rba
+{
+
+/// @brief ViewContentSet object geneation class
+class RBAViewContentSetMaker : public RBAContentSetMaker
+{
+public:
+ RBAViewContentSetMaker();
+ RBAViewContentSetMaker(const RBAViewContentSetMaker&)=delete;
+ RBAViewContentSetMaker(const RBAViewContentSetMaker&&)=delete;
+ RBAViewContentSetMaker& operator=(const RBAViewContentSetMaker&)=delete;
+ RBAViewContentSetMaker& operator=(const RBAViewContentSetMaker&&)=delete;
+ virtual ~RBAViewContentSetMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+ /// @brief Set model element attributes for each derived class
+ /// @param[in] JSON element of jsonElem ModelElement
+ /// @param[in] model Model to save the generated object
+ /// @param[in,out] owner Parent object (unused)
+ RBAModelElement* setProperty(RBAModelElement* element,
+ const RBAJsonElement* jsonElem,
+ RBAModelImpl* model,
+ RBAModelElement* owner=nullptr) override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAViewContentState.cpp b/src/view/RBAViewContentState.cpp
new file mode 100644
index 0000000..7d29e4d
--- /dev/null
+++ b/src/view/RBAViewContentState.cpp
@@ -0,0 +1,50 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * View Content state class
+ */
+
+#include "RBAViewContentState.hpp"
+
+namespace rba
+{
+
+std::string
+RBAViewContentState::getContentNameByContext(const std::string& context)
+{
+ return context.substr(0U, context.find(CONTEXT_SEPARATER));
+}
+
+std::string
+RBAViewContentState::getContentStateNameByContext(const std::string& context)
+{
+ const std::string::size_type pos {context.find(CONTEXT_SEPARATER)};
+ if(pos == std::string::npos) {
+ // Returns a null string if it does not contain a separator character.
+ return "";
+ }
+ else {
+ return context.substr(pos+1U, context.length()-1U);
+ }
+}
+
+bool
+RBAViewContentState::isUniqueName(const std::string& context)
+{
+ return (context.find(CONTEXT_SEPARATER) != std::string::npos);
+}
+
+}
diff --git a/src/view/RBAViewContentStateImpl.cpp b/src/view/RBAViewContentStateImpl.cpp
new file mode 100644
index 0000000..8a8de3f
--- /dev/null
+++ b/src/view/RBAViewContentStateImpl.cpp
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * View Content state implementation class
+ */
+
+#include "RBAViewContentImpl.hpp"
+#include "RBAViewContentStateImpl.hpp"
+#include "RBAModelElementType.hpp"
+
+namespace rba
+{
+
+RBAViewContentStateImpl::RBAViewContentStateImpl(const std::string& name)
+ : RBAViewContentState(),
+ RBAContentState{name}
+{
+}
+
+std::string
+RBAViewContentStateImpl::getName() const
+{
+ return RBANamedElement::getElementName();
+}
+
+std::int32_t
+RBAViewContentStateImpl::getPriority() const
+{
+ return getContentStatePriority();
+}
+
+const RBAViewContent*
+RBAViewContentStateImpl::getOwner() const
+{
+ return dynamic_cast<const RBAViewContent*>(RBARuleObject::getOwner());
+}
+
+std::int32_t
+RBAViewContentStateImpl::getOrder() const
+{
+ return getContentStateOrder();
+}
+
+std::string
+RBAViewContentStateImpl::getUniqueName() const
+{
+ return RBARuleObject::getOwner()->getUniqueName() + CONTEXT_SEPARATER + getName();
+}
+
+bool
+RBAViewContentStateImpl::isViewContentState() const
+{
+ return true;
+}
+
+RBAModelElementType
+RBAViewContentStateImpl::getModelElementType() const
+{
+ return RBAModelElementType::ViewContentState;
+}
+
+}
diff --git a/src/view/RBAViewContentStateImpl.hpp b/src/view/RBAViewContentStateImpl.hpp
new file mode 100644
index 0000000..5ad601d
--- /dev/null
+++ b/src/view/RBAViewContentStateImpl.hpp
@@ -0,0 +1,56 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * View Content state implementation class header
+ */
+
+#ifndef RBAVIEWCONTENTSTATEIMPL_HPP
+#define RBAVIEWCONTENTSTATEIMPL_HPP
+
+#include <cstdint>
+#include "RBAViewContentState.hpp"
+#include "RBAContentState.hpp"
+
+namespace rba
+{
+
+class RBAViewContentImpl;
+
+class RBAViewContentStateImpl : public RBAViewContentState,
+ public RBAContentState
+{
+public:
+ explicit RBAViewContentStateImpl(const std::string& name="");
+ RBAViewContentStateImpl(const RBAViewContentStateImpl&)=delete;
+ RBAViewContentStateImpl(const RBAViewContentStateImpl&&)=delete;
+ RBAViewContentStateImpl& operator=(const RBAViewContentStateImpl&)=delete;
+ RBAViewContentStateImpl& operator=(const RBAViewContentStateImpl&&)=delete;
+ virtual ~RBAViewContentStateImpl()=default;
+
+public:
+ std::string getName() const override;
+ std::int32_t getPriority() const override;
+ const RBAViewContent* getOwner() const override;
+ std::int32_t getOrder() const override;
+ std::string getUniqueName() const override;
+ bool isViewContentState() const override;
+ RBAModelElementType getModelElementType() const override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAViewContentStateMaker.cpp b/src/view/RBAViewContentStateMaker.cpp
new file mode 100644
index 0000000..7877c55
--- /dev/null
+++ b/src/view/RBAViewContentStateMaker.cpp
@@ -0,0 +1,41 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAViewContentStateMaker.cpp
+/// @brief ViewContentState object generation class
+
+#include "RBAViewContentStateMaker.hpp"
+#include "RBAJsonElement.hpp"
+#include "RBAModelElement.hpp"
+#include "RBAModelImpl.hpp"
+#include "RBAViewContentStateImpl.hpp"
+#include "RBAModelFactory.hpp"
+
+namespace rba
+{
+
+RBAViewContentStateMaker::RBAViewContentStateMaker()
+ : RBAContentStateMaker{"ViewContentState"}
+{
+}
+
+std::unique_ptr<RBAModelElement>
+RBAViewContentStateMaker::createInstance(const std::string& name)
+{
+ return std::make_unique<RBAViewContentStateImpl>(name);
+}
+
+}
+
diff --git a/src/view/RBAViewContentStateMaker.hpp b/src/view/RBAViewContentStateMaker.hpp
new file mode 100644
index 0000000..c3a666f
--- /dev/null
+++ b/src/view/RBAViewContentStateMaker.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAViewContentStateMaker.hpp
+/// @brief ViewContentState object generation class header
+
+#ifndef RBAVIEWCONTENTSTATEMAKER_HPP
+#define RBAVIEWCONTENTSTATEMAKER_HPP
+
+#include "RBAContentStateMaker.hpp"
+
+namespace rba
+{
+
+class RBAModelElement;
+class RBAJsonElement;
+class RBAModelImpl;
+
+/// @brief ViewContentState object generation class
+class RBAViewContentStateMaker : public RBAContentStateMaker
+{
+public:
+ RBAViewContentStateMaker();
+ RBAViewContentStateMaker(const RBAViewContentStateMaker&)=delete;
+ RBAViewContentStateMaker(const RBAViewContentStateMaker&&)=delete;
+ RBAViewContentStateMaker& operator=(const RBAViewContentStateMaker&)=delete;
+ RBAViewContentStateMaker& operator=(RBAViewContentStateMaker&&)=delete;
+ virtual ~RBAViewContentStateMaker()=default;
+
+protected:
+ /// @brief create empty instance
+ /// @details Create an empty instance of unique_ptr in your derived class.
+ /// @return unique_ptr for instance
+ std::unique_ptr<RBAModelElement> createInstance(const std::string& name="") override;
+
+};
+
+}
+
+#endif
diff --git a/src/view/RBAViewMakerTable.cpp b/src/view/RBAViewMakerTable.cpp
new file mode 100644
index 0000000..dcd3aec
--- /dev/null
+++ b/src/view/RBAViewMakerTable.cpp
@@ -0,0 +1,75 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAViewMakerTable.cpp
+/// @brief ViewMakerTable class
+
+#include "RBAViewMakerTable.hpp"
+#include "RBAAllInstanceOfAreaMaker.hpp"
+#include "RBAAllInstanceOfViewContentMaker.hpp"
+#include "RBAAreaMaker.hpp"
+#include "RBAAreaSetMaker.hpp"
+#include "RBADisplayMaker.hpp"
+#include "RBADisplayingContentMaker.hpp"
+#include "RBAIsDisplayedMaker.hpp"
+#include "RBAIsHiddenMaker.hpp"
+#include "RBAIsVisibleMaker.hpp"
+#include "RBAPositionContainerMaker.hpp"
+#include "RBASizeMaker.hpp"
+#include "RBAViewContentMaker.hpp"
+#include "RBAViewContentSetMaker.hpp"
+#include "RBAViewContentStateMaker.hpp"
+
+namespace rba
+{
+
+RBAViewMakerTable::RBAViewMakerTable()
+ : RBAAbstractMakerTable{}
+{
+ addTag("areas");
+ addTag("areasets");
+ addTag("viewcontents");
+ addTag("viewcontentsets");
+ addTag("displays");
+}
+
+std::list<std::unique_ptr<RBAModelElementMaker>>
+RBAViewMakerTable::getMakers() const
+{
+ std::list<std::unique_ptr<RBAModelElementMaker>> makers;
+ makers.push_back(std::make_unique<RBAAllInstanceOfAreaMaker>());
+ makers.push_back(std::make_unique<RBAAllInstanceOfViewContentMaker>());
+ makers.push_back(std::make_unique<RBAAreaMaker>());
+ RBAModelElementMaker::addMaker("AREA", std::make_unique<RBAAreaMaker>());
+ makers.push_back(std::make_unique<RBAAreaSetMaker>());
+ RBAModelElementMaker::addMaker("SET_OF_AREA", std::make_unique<RBAAreaSetMaker>());
+ makers.push_back(std::make_unique<RBADisplayMaker>());
+ makers.push_back(std::make_unique<RBADisplayingContentMaker>());
+ makers.push_back(std::make_unique<RBAIsDisplayedMaker>());
+ makers.push_back(std::make_unique<RBAIsHiddenMaker>());
+ makers.push_back(std::make_unique<RBAIsVisibleMaker>());
+ makers.push_back(std::make_unique<RBAPositionContainerMaker>());
+ makers.push_back(std::make_unique<RBASizeMaker>());
+ makers.push_back(std::make_unique<RBAViewContentMaker>());
+ RBAModelElementMaker::addMaker("CONTENT", std::make_unique<RBAViewContentMaker>());
+ RBAModelElementMaker::addMaker("ViewContent", std::make_unique<RBAViewContentMaker>());
+ makers.push_back(std::make_unique<RBAViewContentSetMaker>());
+ RBAModelElementMaker::addMaker("SET_OF_CONTENT", std::make_unique<RBAViewContentSetMaker>());
+ makers.push_back(std::make_unique<RBAViewContentStateMaker>());
+
+ return makers;
+}
+
+}
diff --git a/src/view/RBAViewMakerTable.hpp b/src/view/RBAViewMakerTable.hpp
new file mode 100644
index 0000000..19cd70f
--- /dev/null
+++ b/src/view/RBAViewMakerTable.hpp
@@ -0,0 +1,52 @@
+/**
+ * Copyright (c) 2019 DENSO CORPORATION.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/// @file RBAViewMakerTable.hpp
+/// @brief ViewMakerTable class header
+
+#ifndef RBAVIEWMAKERTABLE_HPP
+#define RBAVIEWMAKERTABLE_HPP
+
+#include <functional>
+#include "RBAAbstractMakerTable.hpp"
+
+namespace rba
+{
+
+class DLL_EXPORT RBAViewMakerTable : public RBAAbstractMakerTable
+{
+public:
+ RBAViewMakerTable();
+ RBAViewMakerTable(const RBAViewMakerTable&)=delete;
+ RBAViewMakerTable(const RBAViewMakerTable&&)=delete;
+ RBAViewMakerTable& operator=(const RBAViewMakerTable&)=delete;
+ RBAViewMakerTable& operator=(const RBAViewMakerTable&&)=delete;
+ virtual ~RBAViewMakerTable()=default;
+
+public:
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4251)
+#endif
+ std::list<std::unique_ptr<RBAModelElementMaker>> getMakers() const override;
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+};
+
+}
+
+#endif