6 #include "PoolHandle.h"
10 #include "Resources.h"
18 class IResourceBuilder;
25 namespace PayloadState
27 enum PayloadStateValues
46 class IResourceStream;
48 class PayloadBuildManager;
49 class ResourceNodeCache;
56 uint lastVisibleUpdate;
64 PayloadState::PayloadStateValues m_state;
66 int m_earliestUpdateCountForLoad;
69 const std::vector<Byte>* m_resourceData;
70 bool m_successfulLoad;
75 int m_failedLoadAttemptCount;
76 bool m_shouldBuildPlaceholder;
79 long long m_timeOfLastStateChange;
80 long long m_timePerState[PayloadState::MAX];
82 void setState(PayloadState::PayloadStateValues newState);
83 bool stateIs(PayloadState::PayloadStateValues stateToCheckFor)
const;
84 void tryClearPlaceholder();
88 ResourceNode *resourceNode()
const {
return m_pResourceNode; }
91 bool shouldBuildPlaceholder()
const {
return m_shouldBuildPlaceholder; }
94 uint StreamPriority()
const;
95 std::string url(
bool relativeUrl =
false)
const;
96 const std::vector<Byte>* GetResourceData()
const {
return m_resourceData; }
97 bool SuccessfulLoad() {
return m_successfulLoad; }
99 float GetPriority()
const {
return m_priority; }
100 void SetPriority(
float priority) { m_priority = priority; }
101 void SetEarliestUpdateCountForLoad(
int updateCount) { m_earliestUpdateCountForLoad = updateCount; }
110 void setNeedsPlaceholder(
bool dontBuildOnTopOf);
111 void onReleaseToPool();
113 void SetToBeLoaded();
125 void addedToSceneGraph();
127 bool hasPlaceholder()
const;
128 bool isReadyForBuilding(
int updateCount)
const;
129 bool isReadyForLoading(
int updateCount)
const;
130 bool isReadyForSceneGraph(
int updateCount)
const;
131 bool isLate(
int updateCount)
const;
132 bool isInSceneGraph()
const;
133 bool isInSceneGraphOrHasPlaceholder()
const;
134 bool isBuilt()
const;
135 bool isLoadFailure()
const;
136 bool isBuildFailure()
const;
137 bool isPendingLoadCompletion(
int updateCount)
const;
138 bool isInVisibleSet(
int updateCount)
const;
139 bool shouldForwardErroredRequestsToBuilder()
const;
140 bool shouldBeLoaded()
const;
141 float timeInState(PayloadState::PayloadStateValues state)
const;
142 PayloadState::PayloadStateValues GetState()
const;
143 void SetLastVisibleUpdate(
int updateCount) { lastVisibleUpdate = updateCount; }
145 void LogFailedRequest();