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
var roots = DependableTrait.Get(construct).DependencyRoots;
// Definition
DependableTrait.Implement(construct, new Struct { get dependencyRoots() { return []; }
});

Initializers

using AlibabaCloud.SDK.ROS.CDK.Core;
new 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

using AlibabaCloud.SDK.ROS.CDK.Core;
DependableTrait.Get(IDependable Instance);

Return the matching DependableTrait for the given class instance.

InstanceRequired


Implement

using AlibabaCloud.SDK.ROS.CDK.Core;
DependableTrait.Implement(IDependable Instance, DependableTrait Trait);

Register instance to have the given DependableTrait.

Should be called in the class constructor.

InstanceRequired


TraitRequired


Properties

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

DependencyRootsRequired

public IConstruct[] DependencyRoots { get; }

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

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