Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "RawColumnDefaultValueV9.g.h"
#include "RawViewDefV9.g.h"
#include "RawProcedureDefV9.g.h"
#include "RawViewDefV9.g.h"

namespace SpacetimeDB::Internal {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <memory>
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "RawModuleDefV8.g.h"
#include "RawModuleDefV10.g.h"
#include "RawModuleDefV8.g.h"
#include "RawModuleDefV9.g.h"

namespace SpacetimeDB::Internal {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,18 @@ SPACETIMEDB_INTERNAL_PRODUCT_TYPE(RawModuleDefV10) {
}
SPACETIMEDB_PRODUCT_TYPE_EQUALITY(sections)
};

inline void RawSubmoduleV10::bsatn_serialize(::SpacetimeDB::bsatn::Writer& writer) const {
::SpacetimeDB::bsatn::serialize(writer, namespace_);
::SpacetimeDB::bsatn::serialize(writer, *module);
}

inline bool RawSubmoduleV10::operator==(const RawSubmoduleV10& other) const {
return namespace_ == other.namespace_
&& (module == other.module || (module && other.module && *module == *other.module));
}

inline bool RawSubmoduleV10::operator!=(const RawSubmoduleV10& other) const {
return !(*this == other);
}
} // namespace SpacetimeDB::Internal
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,23 @@
#include <memory>
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "RawViewPrimaryKeyDefV10.g.h"
#include "RawTableDefV10.g.h"
#include "RawViewDefV10.g.h"
#include "RawScheduleDefV10.g.h"
#include "CaseConversionPolicy.g.h"
#include "RawRowLevelSecurityDefV9.g.h"
#include "RawHttpRouteDefV10.g.h"
#include "RawReducerDefV10.g.h"
#include "Typespace.g.h"
#include "RawLifeCycleReducerDefV10.g.h"
#include "ExplicitNames.g.h"
#include "RawHttpHandlerDefV10.g.h"
#include "RawTypeDefV10.g.h"
#include "RawHttpRouteDefV10.g.h"
#include "RawLifeCycleReducerDefV10.g.h"
#include "RawProcedureDefV10.g.h"
#include "RawReducerDefV10.g.h"
#include "RawRowLevelSecurityDefV9.g.h"
#include "RawScheduleDefV10.g.h"
#include "RawSubmoduleV10.g.h"
#include "RawTableDefV10.g.h"
#include "RawTypeDefV10.g.h"
#include "RawViewDefV10.g.h"
#include "RawViewPrimaryKeyDefV10.g.h"
#include "Typespace.g.h"

namespace SpacetimeDB::Internal {

SPACETIMEDB_INTERNAL_TAGGED_ENUM(RawModuleDefV10Section, SpacetimeDB::Internal::Typespace, std::vector<SpacetimeDB::Internal::RawTypeDefV10>, std::vector<SpacetimeDB::Internal::RawTableDefV10>, std::vector<SpacetimeDB::Internal::RawReducerDefV10>, std::vector<SpacetimeDB::Internal::RawProcedureDefV10>, std::vector<SpacetimeDB::Internal::RawViewDefV10>, std::vector<SpacetimeDB::Internal::RawScheduleDefV10>, std::vector<SpacetimeDB::Internal::RawLifeCycleReducerDefV10>, std::vector<SpacetimeDB::Internal::RawRowLevelSecurityDefV9>, SpacetimeDB::Internal::CaseConversionPolicy, SpacetimeDB::Internal::ExplicitNames, std::vector<SpacetimeDB::Internal::RawHttpHandlerDefV10>, std::vector<SpacetimeDB::Internal::RawHttpRouteDefV10>, std::vector<SpacetimeDB::Internal::RawViewPrimaryKeyDefV10>)
SPACETIMEDB_INTERNAL_TAGGED_ENUM(RawModuleDefV10Section, SpacetimeDB::Internal::Typespace, std::vector<SpacetimeDB::Internal::RawTypeDefV10>, std::vector<SpacetimeDB::Internal::RawTableDefV10>, std::vector<SpacetimeDB::Internal::RawReducerDefV10>, std::vector<SpacetimeDB::Internal::RawProcedureDefV10>, std::vector<SpacetimeDB::Internal::RawViewDefV10>, std::vector<SpacetimeDB::Internal::RawScheduleDefV10>, std::vector<SpacetimeDB::Internal::RawLifeCycleReducerDefV10>, std::vector<SpacetimeDB::Internal::RawRowLevelSecurityDefV9>, SpacetimeDB::Internal::CaseConversionPolicy, SpacetimeDB::Internal::ExplicitNames, std::vector<SpacetimeDB::Internal::RawHttpHandlerDefV10>, std::vector<SpacetimeDB::Internal::RawHttpRouteDefV10>, std::vector<SpacetimeDB::Internal::RawViewPrimaryKeyDefV10>, std::vector<SpacetimeDB::Internal::RawSubmoduleV10>)
} // namespace SpacetimeDB::Internal
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "MiscModuleExport.g.h"
#include "Typespace.g.h"
#include "TableDesc.g.h"
#include "ReducerDef.g.h"
#include "TableDesc.g.h"
#include "Typespace.g.h"

namespace SpacetimeDB::Internal {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#include <memory>
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "RawTableDefV9.g.h"
#include "RawMiscModuleExportV9.g.h"
#include "RawReducerDefV9.g.h"
#include "RawRowLevelSecurityDefV9.g.h"
#include "RawTableDefV9.g.h"
#include "RawTypeDefV9.g.h"
#include "Typespace.g.h"
#include "RawMiscModuleExportV9.g.h"
#include "RawRowLevelSecurityDefV9.g.h"

namespace SpacetimeDB::Internal {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#include <memory>
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "AlgebraicType.g.h"
#include "FunctionVisibility.g.h"
#include "ProductType.g.h"
#include "AlgebraicType.g.h"

namespace SpacetimeDB::Internal {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
#include <memory>
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "AlgebraicType.g.h"
#include "FunctionVisibility.g.h"
#include "ProductType.g.h"
#include "AlgebraicType.g.h"

namespace SpacetimeDB::Internal {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <memory>
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "ProductType.g.h"
#include "Lifecycle.g.h"
#include "ProductType.g.h"

namespace SpacetimeDB::Internal {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.

// This was generated using spacetimedb codegen.

#pragma once

#include <cstdint>
#include <string>
#include <vector>
#include <optional>
#include <memory>
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"

namespace SpacetimeDB::Internal {
struct RawModuleDefV10;
} // namespace SpacetimeDB::Internal

namespace SpacetimeDB::Internal {

SPACETIMEDB_INTERNAL_PRODUCT_TYPE(RawSubmoduleV10) {
std::string namespace_;
std::shared_ptr<SpacetimeDB::Internal::RawModuleDefV10> module;

void bsatn_serialize(::SpacetimeDB::bsatn::Writer& writer) const;
bool operator==(const RawSubmoduleV10& other) const;
bool operator!=(const RawSubmoduleV10& other) const;
};
} // namespace SpacetimeDB::Internal
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#include <memory>
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "TableType.g.h"
#include "TableAccess.g.h"
#include "RawIndexDefV10.g.h"
#include "RawColumnDefaultValueV10.g.h"
#include "RawConstraintDefV10.g.h"
#include "RawIndexDefV10.g.h"
#include "RawSequenceDefV10.g.h"
#include "RawColumnDefaultValueV10.g.h"
#include "TableAccess.g.h"
#include "TableType.g.h"

namespace SpacetimeDB::Internal {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#include <memory>
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "RawSequenceDefV8.g.h"
#include "RawIndexDefV8.g.h"
#include "RawConstraintDefV8.g.h"
#include "RawColumnDefV8.g.h"
#include "RawConstraintDefV8.g.h"
#include "RawIndexDefV8.g.h"
#include "RawSequenceDefV8.g.h"

namespace SpacetimeDB::Internal {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "RawConstraintDefV9.g.h"
#include "RawSequenceDefV9.g.h"
#include "RawIndexDefV9.g.h"
#include "RawScheduleDefV9.g.h"
#include "RawSequenceDefV9.g.h"
#include "TableAccess.g.h"
#include "TableType.g.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <memory>
#include "../autogen_base.h"
#include "spacetimedb/bsatn/bsatn.h"
#include "ProductType.g.h"
#include "AlgebraicType.g.h"
#include "ProductType.g.h"

namespace SpacetimeDB::Internal {

Expand Down
10 changes: 7 additions & 3 deletions crates/bindings-cpp/include/spacetimedb/internal/autogen_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TaggedEnumBase {
return std::get<Index>(data_);
}

// Get variant by index (mutable)
// Get variant by index (mutable)
template<size_t Index>
auto& get() {
return std::get<Index>(data_);
Expand Down Expand Up @@ -90,8 +90,12 @@ class TaggedEnumBase {
using Base::set; \
using Base::is; \
using Base::visit; \
using Base::operator==; \
using Base::operator!=; \
bool operator==(const TypeName& other) const noexcept { \
return static_cast<const Base&>(*this) == static_cast<const Base&>(other); \
} \
bool operator!=(const TypeName& other) const noexcept { \
return !(*this == other); \
} \
\
void bsatn_serialize(::SpacetimeDB::bsatn::Writer& writer) const { \
/* Write tag (variant index) */ \
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions crates/bindings-typescript/src/lib/autogen/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading