Search in sources :

Example 1 with SizeUnits

use of org.osate.aadl2.contrib.aadlproject.SizeUnits in project osate2 by osate.

the class MemoryProperties method getHeapSize.

public static Optional<IntegerWithUnits<SizeUnits>> getHeapSize(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getHeapSize_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(new IntegerWithUnits<>(resolved, SizeUnits.class));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : SizeUnits(org.osate.aadl2.contrib.aadlproject.SizeUnits) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 2 with SizeUnits

use of org.osate.aadl2.contrib.aadlproject.SizeUnits in project osate2 by osate.

the class MemoryProperties method getSourceHeapSize.

public static Optional<IntegerWithUnits<SizeUnits>> getSourceHeapSize(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getSourceHeapSize_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(new IntegerWithUnits<>(resolved, SizeUnits.class));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : SizeUnits(org.osate.aadl2.contrib.aadlproject.SizeUnits) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 3 with SizeUnits

use of org.osate.aadl2.contrib.aadlproject.SizeUnits in project osate2 by osate.

the class MemoryProperties method getDataSize.

public static Optional<IntegerWithUnits<SizeUnits>> getDataSize(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getDataSize_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(new IntegerWithUnits<>(resolved, SizeUnits.class));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : SizeUnits(org.osate.aadl2.contrib.aadlproject.SizeUnits) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 4 with SizeUnits

use of org.osate.aadl2.contrib.aadlproject.SizeUnits in project osate2 by osate.

the class MemoryProperties method getMemorySize.

public static Optional<IntegerWithUnits<SizeUnits>> getMemorySize(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getMemorySize_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(new IntegerWithUnits<>(resolved, SizeUnits.class));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : SizeUnits(org.osate.aadl2.contrib.aadlproject.SizeUnits) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 5 with SizeUnits

use of org.osate.aadl2.contrib.aadlproject.SizeUnits in project osate2 by osate.

the class MemoryProperties method getSourceStackSize.

public static Optional<IntegerWithUnits<SizeUnits>> getSourceStackSize(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getSourceStackSize_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(new IntegerWithUnits<>(resolved, SizeUnits.class));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : SizeUnits(org.osate.aadl2.contrib.aadlproject.SizeUnits) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Aggregations

PropertyExpression (org.osate.aadl2.PropertyExpression)18 Property (org.osate.aadl2.Property)17 SizeUnits (org.osate.aadl2.contrib.aadlproject.SizeUnits)17 PropertyNotPresentException (org.osate.aadl2.properties.PropertyNotPresentException)17 ComponentClassifier (org.osate.aadl2.ComponentClassifier)2 DataImplementation (org.osate.aadl2.DataImplementation)2 DataSubcomponent (org.osate.aadl2.DataSubcomponent)2 Classifier (org.osate.aadl2.Classifier)1 ComponentCategory (org.osate.aadl2.ComponentCategory)1 Feature (org.osate.aadl2.Feature)1 FeatureGroupType (org.osate.aadl2.FeatureGroupType)1 PropertyConstant (org.osate.aadl2.PropertyConstant)1 Subcomponent (org.osate.aadl2.Subcomponent)1 ComponentInstance (org.osate.aadl2.instance.ComponentInstance)1 FeatureInstance (org.osate.aadl2.instance.FeatureInstance)1 IntegerWithUnits (org.osate.pluginsupport.properties.IntegerWithUnits)1