Skip to content

Commit

Permalink
Export transient flag.
Browse files Browse the repository at this point in the history
(these should all really be custom flags to prevent changing tools)
  • Loading branch information
dwilliamson committed Jun 30, 2021
1 parent 84e45bf commit 985978c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
16 changes: 10 additions & 6 deletions inc/clcpp/clcpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ inline void operator delete(void*, const clcpp::internal::PtrWrapper&)
#define attrNoReflect clcpp_attr(noreflect)
#define attrDiskTransient clcpp_attr(disk_transient)
#define attrNetworkTransient clcpp_attr(network_transient)
#define attrExportTransient clcpp_attr(export_transient)
#define attrTransient clcpp_attr(transient)
#define attrCustomFlagInherit clcpp_attr(custom_flag_inherit)
#define attrReplicate clcpp_attr(replicate)
Expand All @@ -338,22 +339,25 @@ inline void operator delete(void*, const clcpp::internal::PtrWrapper&)
// "network_transient" - These primitives are ignored during serialisation to the network
#define attrFlag_NetworkTransient 0x00000002

// "export_transient" - These primitives are ignored during serialisation for export
#define attrFlag_ExportTransient 0x00000004

// "transient" - These primitives are ignored during serialisation to disk and the network
#define attrFlag_Transient (attrFlag_DiskTransient | attrFlag_NetworkTransient)
#define attrFlag_Transient (attrFlag_DiskTransient | attrFlag_NetworkTransient | attrFlag_ExportTransient)

// If an attribute starts with "load_" or "save_" then these flags are set to indicate there
// are custom loading functions assigned
#define attrFlag_CustomLoad 0x00000004
#define attrFlag_CustomSave 0x00000008
#define attrFlag_CustomLoad 0x00000008
#define attrFlag_CustomSave 0x00000010

// Function to call before saving an object, specified with "pre_save" attribute
#define attrFlag_PreSave 0x00000010
#define attrFlag_PreSave 0x00000020

// Function to call after loading an object, specified with "post_load" attribute
#define attrFlag_PostLoad 0x00000020
#define attrFlag_PostLoad 0x00000040

// Mark classes or fields to be network-replicated
#define attrFlag_Replicate 0x00000040
#define attrFlag_Replicate 0x00000080

// ===============================================================================
// Core Functionality Required by the Runtime C++ API
Expand Down
3 changes: 3 additions & 0 deletions src/clReflectExport/CppExport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@ namespace
// Cache attribute names
static unsigned int disk_transient_hash = clcpp::internal::HashNameString("disk_transient");
static unsigned int network_transient_hash = clcpp::internal::HashNameString("network_transient");
static unsigned int export_transient_hash = clcpp::internal::HashNameString("export_transient");
static unsigned int transient_hash = clcpp::internal::HashNameString("transient");
static unsigned int pre_save_hash = clcpp::internal::HashNameString("pre_save");
static unsigned int post_load_hash = clcpp::internal::HashNameString("post_load");
Expand All @@ -759,6 +760,8 @@ namespace
bits |= attrFlag_DiskTransient;
else if (attribute.name.hash == network_transient_hash)
bits |= attrFlag_NetworkTransient;
else if (attribute.name.hash == export_transient_hash)
bits |= attrFlag_ExportTransient;
else if (attribute.name.hash == transient_hash)
bits |= attrFlag_Transient;
else if (attribute.name.hash == pre_save_hash)
Expand Down

0 comments on commit 985978c

Please sign in to comment.