feat: variable socket counts

This commit is contained in:
parker
2025-07-30 14:03:38 +01:00
parent 1c57b7a9e6
commit 83e0977d5d
13 changed files with 101 additions and 61 deletions

View File

@@ -3,8 +3,12 @@
#include "Engine/Operator/Context.h"
#include "Engine/Types.h"
#include <boost/config.hpp>
#include "Engine/Operator/OpInfo.h"
// forward declaration
namespace enzo::nt {class NetworkManager;}
namespace enzo::nt
{
class NetworkManager;
@@ -12,24 +16,25 @@ class NetworkManager;
class BOOST_SYMBOL_EXPORT GeometryOpDef
{
public:
GeometryOpDef(enzo::nt::OpId opId);
GeometryOpDef(nt::NetworkManager* network, op::OpInfo opInfo);
virtual void cookOp(op::Context context) = 0;
geo::Geometry& getOutputGeo(unsigned outputIndex);
unsigned int getMinInputs() const;
unsigned int getMaxInputs() const;
unsigned int getMaxOutputs() const;
private:
std::vector<enzo::geo::Geometry> outputGeometry_;
unsigned int minInputs_;
unsigned int maxInputs_;
unsigned int maxOutputs_;
protected:
enzo::nt::OpId opId_;
const enzo::geo::Geometry& getInputGeoView(unsigned int inputIndex);
const op::OpInfo opInfo_;
nt::NetworkManager* network_;
bool outputRequested(unsigned int outputIndex);
// TODO: std::move geometry instead of copying
void setOutputGeometry(unsigned int outputIndex, enzo::geo::Geometry geometry);
};
using opConstructor = GeometryOpDef* (*)(enzo::nt::OpId);
using opConstructor = GeometryOpDef* (*)(enzo::nt::NetworkManager* network, enzo::op::OpInfo opInfo);
}