Skip to content

DependableTrait

Trait for IDependable.

Traits are interfaces that are privately implemented by objects. Instead of showing up in the public interface of a class, they need to be queried explicitly. This is used to implement certain framework features that are not intended to be used by Construct consumers, and so should be hidden from accidental use.

Example

# Example automatically generated from non-compiling source. May contain errors.
# Usage
roots = DependableTrait.get(construct).dependency_roots
# Definition
DependableTrait.implement(construct, get dependencyRoots() { return []; }
)

Initializers

import ros_cdk_core
ros_cdk_core.DependableTrait()
Name Type Description

Static Functions

Name Description
get Return the matching DependableTrait for the given class instance.
implement Register instance to have the given DependableTrait.

get

import ros_cdk_core
ros_cdk_core.DependableTrait.get(
  instance: IDependable
)

Return the matching DependableTrait for the given class instance.

instanceRequired


implement

import ros_cdk_core
ros_cdk_core.DependableTrait.implement(
  instance: IDependable,
  trait: DependableTrait
)

Register instance to have the given DependableTrait.

Should be called in the class constructor.

instanceRequired


traitRequired


Properties

Name Type Description
dependency_roots typing.List[IConstruct] The set of constructs that form the root of this dependable.

dependency_rootsRequired

dependency_roots: typing.List[IConstruct]

The set of constructs that form the root of this dependable.

All resources under all returned constructs are included in the ordering dependency.