feat(engine): basic attribute implementation

This commit is contained in:
parker
2025-06-28 21:50:26 +01:00
parent 348eb8301d
commit 9734e58897
8 changed files with 297 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
#include "Engine/Operator/Attribute.h"
#include "Engine/Types.h"
#include <memory>
#include <stdexcept>
#include <optional>
using namespace enzo;
ga::Attribute::Attribute(std::string name, ga::AttributeType type)
: name_{name}, type_{type}
{
// init store
switch(type_)
{
case(AttrType::intT):
intStore_=std::make_shared<std::vector<int>>();
break;
case(AttrType::floatT):
floatStore_=std::make_shared<std::vector<float>>();
break;
default:
throw std::runtime_error("Type " + std::to_string(static_cast<int>(type_)) + " was not accounted for");
}
}
ga::AttributeType ga::Attribute::getType()
{
return type_;
}