blob: 06b6dc2a20184550ef846c9475ea00dfbaa42962 [file]
// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include <memory>
class Node {
public:
Node(int value, int* destructorCounter);
~Node();
int getValue() const;
private:
int value_;
int* destructorCounter_;
};
class NodeManager {
public:
NodeManager();
int foo(Node* node);
Node* getNode(int value, int* destructorCounter);
Node* newNode(int value, int* destructorCounter);
Node* getSingletonNode(int value, int* destructorCounter);
int getValue(Node* node);
int takeNode(Node* node);
std::unique_ptr<Node> makeNode(int value, int* destructorCounter);
int consumeNode(std::unique_ptr<Node> node);
};
class NodeContainer {
public:
NodeContainer(std::unique_ptr<Node> node);
int getValue() const;
private:
std::unique_ptr<Node> node_;
};