Count
Inputs: i1
Outputs: o1
Counts how many messages have passed through it.
The Count
operator does not hold a message buffer on i1
, so it emits a message containing the amount of messages it has received on i1
through o1
right after it receives a message on i1
.
Parameters
id: The id of the operator
Usage
- TypeScript
- Python
- C++
- YAML
- Json
import { Program, Count } from "@rtbot-dev/rtbot";
const id = "id";
const program = new Program();
program.addOperator(new Count(id));
import rtbot as rb
id = "id";
program = rb.Program()
program.addOperator(rb.Count(id))
#include "rtbot/Count.h"
auto id = "id";
auto op = Count<std::uint64_t, double>(id)
# minimal RtBot program
operators:
- type: Count
id: "id"
{
"operators": [
{ "type": "Count", "id": "id" }
]
}