92 static std::shared_ptr<CocoTable> mCocoTableInstance;
93 static std::mutex instanceProtectionLock;
95 std::vector<ResourceConfigInfo*> mResourceTable;
96 std::unordered_map<int32_t, int32_t> mFlatClusterMap;
102 std::vector<std::vector<std::pair<CocoNode*, CocoNode*>>>
mCocoTable;
111 void timerExpired(
Request* req);
112 void applyAction(CocoNode* currNode, int32_t index, int8_t priority);
113 void removeAction(int32_t index,
Resource* resource);
114 void processResourceCleanupAt(
Request* request, int32_t index);
116 int32_t getCocoTablePrimaryIndex(uint32_t resCode);
117 int32_t getCocoTableSecondaryIndex(
Resource* resource, int8_t priority);
119 void deleteNode(CocoNode* node,
120 int32_t primaryIndex,
121 int32_t secondaryIndex,
124 int8_t insertInCocoTable(CocoNode* currNode,
128 void insertInCocoTableHigherLower(CocoNode* newNode,
129 int32_t primaryIndex,
130 int32_t secondaryIndex,
134 void insertInCocoTableLazyApply(CocoNode* newNode,
135 int32_t primaryIndex,
136 int32_t secondaryIndex,
139 void insertInCocoTableInstantApply(CocoNode* newNode,
140 int32_t primaryIndex,
141 int32_t secondaryIndex,
186 static std::shared_ptr<CocoTable> getInstance() {
187 if(mCocoTableInstance ==
nullptr) {
188 instanceProtectionLock.lock();
189 if(mCocoTableInstance ==
nullptr) {
191 mCocoTableInstance = std::shared_ptr<CocoTable> (
new CocoTable());
192 }
catch(
const std::bad_alloc& e) {
193 instanceProtectionLock.unlock();
197 instanceProtectionLock.unlock();
199 return mCocoTableInstance;