Initializing an object for codelet in start() scope and passing the object to the tick scope

In my custom codelet, how do I initialize an object in the start() scope and pass the object to the tick scope for use in every iteration?

Could you just define it in your header file as part of your codelet and initialise it at start then use it everywhere else?

For example below would be a simple tick counter which has a count variable that increases by one at every tick.

In the header file you would have something like this.

class TickCounter : public alice::Codelet {
  public:
  void start() override;
  void tick() override;
  int count;
}

And in your cpp file you would have something like this.

void TickCounter::start(){
  count = 0;
  tickPeriodically();
}

void TickCounter::tick(){
  std::cout << "Tick number " << count << "\n";
  count++;
}