diff --git a/src/main/scala/onera/pmlanalyzer/pml/model/hardware/BaseHardwareNodeBuilder.scala b/src/main/scala/onera/pmlanalyzer/pml/model/hardware/BaseHardwareNodeBuilder.scala index 8362ed1..b62d7f4 100644 --- a/src/main/scala/onera/pmlanalyzer/pml/model/hardware/BaseHardwareNodeBuilder.scala +++ b/src/main/scala/onera/pmlanalyzer/pml/model/hardware/BaseHardwareNodeBuilder.scala @@ -150,4 +150,19 @@ trait BaseHardwareNodeBuilder[T <: Hardware] extends PMLNodeBuilder[T] { def apply(name: Symbol)(implicit p: ProvideRelation[Hardware, Service], owner: Owner): T = apply(name, Set.empty, true) + + + /** + * A physical component can be defined only its name, the services will be defined by default + * + * @group publicConstructor + * @param name the physical component name + * @param withDefaultServices add default Load/Store services on creation + * @param p implicitly retrieved relation linking components to their provided services + * @param owner implicitly retrieved name of the platform + * @return the physical component + */ + def apply(name: Symbol, withDefaultServices: Boolean)(implicit p: ProvideRelation[Hardware, Service], + owner: Owner): T = + apply(name, Set.empty, withDefaultServices) } diff --git a/src/test/scala/onera/pmlanalyzer/pml/model/hardware/HardwareTest.scala b/src/test/scala/onera/pmlanalyzer/pml/model/hardware/HardwareTest.scala index f46ff06..4161317 100644 --- a/src/test/scala/onera/pmlanalyzer/pml/model/hardware/HardwareTest.scala +++ b/src/test/scala/onera/pmlanalyzer/pml/model/hardware/HardwareTest.scala @@ -49,6 +49,9 @@ class HardwareTest extends AnyFlatSpec with should.Matchers { val i = Target(Set.empty, false) i.services.size shouldEqual 0 + + val j = Target(Symbol("j"), false) + j.services.size shouldEqual 0 } }