use smart pointer when creating an object with an instance of the creator

This commit is contained in:
faraphel 2024-12-23 13:12:46 +01:00
parent a0060c8fa8
commit f1ee437f04
6 changed files with 12 additions and 10 deletions

View file

@ -1,5 +1,7 @@
#pragma once
#include <memory>
#include "GnsPort.hpp"
#include <string>
@ -18,7 +20,7 @@ class GnsProject;
*/
class GnsNode {
public:
GnsNode(const GnsProject* project, const std::string& uuid, const std::vector<GnsPort>& ports);
GnsNode(const std::shared_ptr<const GnsProject>& project, const std::string& uuid, const std::vector<GnsPort>& ports);
/**
* Get the base URL for the node API
@ -44,7 +46,7 @@ public:
void start() const;
private:
const GnsProject* project;
std::shared_ptr<const GnsProject> project;
std::string uuid;
std::vector<GnsPort> ports;
};