1 #ifndef HECLRUNTIME_HPP
2 #define HECLRUNTIME_HPP
27 const std::string& m_path;
28 bool m_loaded =
false;
32 Entity(Type type,
const std::string& path)
33 : m_type(type), m_path(path) {}
40 inline Type
getType()
const {
return m_type;}
46 inline const std::string&
getPath()
const {
return m_path;}
52 inline bool isLoaded()
const {
return m_loaded;}
71 typedef std::vector<std::weak_ptr<const class RuntimeObjectBase>> GroupObjectsVector;
73 friend class HECLRuntime;
74 GroupObjectsVector m_objects;
75 Group(
const std::string& path)
76 :
Entity(ENTITY_GROUP, path) {}
78 inline const GroupObjectsVector& getObjects()
const {
return m_objects;}
92 std::shared_ptr<const Group> m_parent;
102 {(void)data;(void)len;
return true;}
111 :
Entity(ENTITY_OBJECT, path), m_parent(group) {}
135 Runtime(
const SystemString& hlpkDirectory);
143 std::atomic_bool done;
144 std::atomic_size_t completedObjects;
145 std::atomic_size_t totalObjects;
175 #endif // HECLRUNTIME_HPP
std::shared_ptr< Entity > loadSync(const Hash &pathHash)
Begin a synchronous group-load transaction.
virtual bool _objectFinishedLoading(const void *data, size_t len)
Optional subclass method called on background thread or in response to interrupt when data is ready...
Definition: HECLRuntime.hpp:101
HLPK Runtime data-management root.
Definition: HECLRuntime.hpp:128
Base object to subclass for integrating with key runtime operations.
Definition: HECLRuntime.hpp:90
const Group * getParentGroup()
Get parent group of object.
Definition: HECLRuntime.hpp:117
std::shared_ptr< Entity > loadAsync(const Hash &pathHash, SGroupLoadStatus *statusOut=NULL)
Begin an asynchronous group-load transaction.
Type getType() const
Get type of runtime object.
Definition: HECLRuntime.hpp:40
Runtime(const SystemString &hlpkDirectory)
Constructs the HECL runtime root.
virtual void _objectWillUnload()
Optional subclass method called in response to reference-count dropping to 0.
Definition: HECLRuntime.hpp:107
Definition: HECLRuntime.hpp:15
Structure indicating the load status of an object group.
Definition: HECLRuntime.hpp:141
const std::string & getPath() const
Get database entity path.
Definition: HECLRuntime.hpp:46
bool isLoaded() const
Determine if object is fully loaded and constructed.
Definition: HECLRuntime.hpp:52
Interface representing a load-ordered group of runtime objects.
Definition: HECLRuntime.hpp:68
Hash representation used for all storable and comparable objects.
Definition: HECL.hpp:257