feat: operator table transfer
This commit is contained in:
@@ -32,6 +32,7 @@ enzo::nt::NetworkManager* enzo::nt::NetworkManager::getInstance()
|
||||
|
||||
enzo::nt::GeometryOperator& enzo::nt::NetworkManager::getGeoOperator(nt::OpId opId)
|
||||
{
|
||||
std::cout << "gop size middle getter: " << gopStore_.size() <<"\n"; // <- size 0
|
||||
if(opId>gopStore_.size())
|
||||
{
|
||||
throw std::out_of_range("OpId: " + std::to_string(opId) + " > max opId: " + std::to_string(maxOpId_) + "\n");
|
||||
@@ -51,6 +52,7 @@ bool enzo::nt::NetworkManager::isValidOp(nt::OpId opId)
|
||||
|
||||
void enzo::nt::NetworkManager::setDisplayOp(OpId opId)
|
||||
{
|
||||
std::cout << "gop size before: " << gopStore_.size() <<"\n";
|
||||
displayOp_=opId;
|
||||
std::vector<enzo::nt::OpId> dependencyGraph = getDependencyGraph(opId);
|
||||
enzo::geo::Geometry prevGeometry;
|
||||
@@ -60,8 +62,10 @@ void enzo::nt::NetworkManager::setDisplayOp(OpId opId)
|
||||
{
|
||||
cookOp(dependencyOpId);
|
||||
}
|
||||
std::cout << "gop size middle: " << gopStore_.size() <<"\n"; // <- size: 1
|
||||
enzo::nt::GeometryOperator& displayOp = getGeoOperator(opId);
|
||||
updateDisplay(displayOp.getOutputGeo(0));
|
||||
getInstance()->updateDisplay(displayOp.getOutputGeo(0));
|
||||
std::cout << "gop size after: " << gopStore_.size() <<"\n";
|
||||
}
|
||||
|
||||
void enzo::nt::NetworkManager::cookOp(enzo::nt::OpId opId)
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
static std::optional<OpId> getDisplayOp();
|
||||
static bool isValidOp(nt::OpId opId);
|
||||
static GeometryOperator& getGeoOperator(nt::OpId opId);
|
||||
void setDisplayOp(OpId opId);
|
||||
static void setDisplayOp(OpId opId);
|
||||
|
||||
#ifdef UNIT_TEST
|
||||
static void _reset();
|
||||
|
||||
@@ -5,8 +5,12 @@
|
||||
void enzo::op::OperatorTable::addOperator(nt::opConstructor ctorFunc)
|
||||
{
|
||||
std::cout << "OPERATOR TABLE ADDED\n";
|
||||
// ctorFunc(5);
|
||||
ctorStore_.push_back(ctorFunc);
|
||||
}
|
||||
|
||||
enzo::nt::opConstructor enzo::op::OperatorTable::getOpConstructor(size_t pos)
|
||||
{
|
||||
return ctorStore_.at(pos);
|
||||
}
|
||||
|
||||
std::vector<enzo::nt::opConstructor> enzo::op::OperatorTable::ctorStore_;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include "Engine/Network/NetworkManager.h"
|
||||
#include "Engine/Operator/GeometryOpDef.h"
|
||||
|
||||
namespace enzo::op
|
||||
{
|
||||
@@ -9,6 +10,7 @@ class BOOST_SYMBOL_EXPORT OperatorTable
|
||||
{
|
||||
public:
|
||||
static void addOperator(nt::opConstructor ctorFunc);
|
||||
static nt::opConstructor getOpConstructor(size_t pos);
|
||||
private:
|
||||
static std::vector<nt::opConstructor> ctorStore_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user