summaryrefslogtreecommitdiff
path: root/indra/newview/llmaterialmgr.h
diff options
context:
space:
mode:
authorKitty Barnett <develop@catznip.com>2012-12-03 15:20:11 +0100
committerKitty Barnett <develop@catznip.com>2012-12-03 15:20:11 +0100
commit25bffc3d43ec7696c0a9fab43514affbfe006fb9 (patch)
treefebaccaaaf6bf2ef1f0b90b300e024d3891966bb /indra/newview/llmaterialmgr.h
parent1e26dbdcd27a1f29fe249cc7e074e5ede284bac8 (diff)
Added LLMaterialMgr::get() to retrieve individual materials (with optional callback)
Diffstat (limited to 'indra/newview/llmaterialmgr.h')
-rw-r--r--indra/newview/llmaterialmgr.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h
index c4e1c01389..d801d40c36 100644
--- a/indra/newview/llmaterialmgr.h
+++ b/indra/newview/llmaterialmgr.h
@@ -28,6 +28,7 @@
#define LL_LLMATERIALMGR_H
#include "llmaterial.h"
+#include "llmaterialid.h"
#include "llsingleton.h"
class LLMaterialMgr : public LLSingleton<LLMaterialMgr>
@@ -38,16 +39,33 @@ protected:
virtual ~LLMaterialMgr();
public:
+ typedef boost::signals2::signal<void (const LLMaterialID&, const LLMaterialPtr)> get_callback_t;
+ const LLMaterialPtr get(const LLMaterialID& material_id);
+ boost::signals2::connection get(const LLMaterialID& material_id, get_callback_t::slot_type cb);
void put(const LLUUID& object_id, const U8 te, const LLMaterial& material);
+ void processGetQueue();
void processPutQueue();
protected:
+ bool isGetPending(const LLMaterialID& material_id);
+
+ void onGetResponse(bool success, const LLSD& content);
void onPutResponse(bool success, const LLSD& content, const LLUUID& object_id);
protected:
+ typedef std::set<LLMaterialID> get_queue_t;
+ get_queue_t mGetQueue;
+ typedef std::map<LLMaterialID, F64> get_pending_map_t;
+ get_pending_map_t mGetPending;
+ typedef std::map<LLMaterialID, get_callback_t*> get_callback_map_t;
+ get_callback_map_t mGetCallbacks;
+
typedef std::map<U8, LLMaterial> facematerial_map_t;
typedef std::map<LLUUID, facematerial_map_t> put_queue_t;
put_queue_t mPutQueue;
+
+ typedef std::map<LLMaterialID, LLMaterialPtr> material_map_t;
+ material_map_t mMaterials;
};
#endif // LL_LLMATERIALMGR_H