Skip to content

getNodeAttributeBuffer

method

Back to Helios Network JS/WASM API

Kind
method
Source
src/js/HeliosNetwork.js:6123

Description

Retrieves a wrapper around the node attribute buffer.

Signature

getNodeAttributeBuffer(name) {

Parameters

NameTypeAttributesDefaultDescription
namestringAttribute identifier.

Returns

Wrapper providing type information and buffer helpers.

Type Object

Example

const net = await HeliosNetwork.create();
net.defineNodeAttribute('flag', AttributeType.Boolean);
const nodes = net.addNodes(1);
net.withBufferAccess(() => {
  const attribute = net.getNodeAttributeBuffer('flag');
  attribute.view[nodes[0]] = 1;
});