PageRenderTime 344ms CodeModel.GetById 181ms app.highlight 5ms RepoModel.GetById 156ms app.codeStats 0ms

/indra/newview/lllandmarklist.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 88 lines | 40 code | 16 blank | 32 comment | 0 complexity | b6f1aaa2317cc70eb786ddad83041967 MD5 | raw file
 1/** 
 2 * @file lllandmarklist.h
 3 * @brief Landmark asset list class
 4 *
 5 * $LicenseInfo:firstyear=2002&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLLANDMARKLIST_H
28#define LL_LLLANDMARKLIST_H
29
30#include <boost/function.hpp>
31#include <map>
32#include "lllandmark.h"
33#include "lluuid.h"
34#include "llassetstorage.h"
35
36class LLMessageSystem;
37class LLLineEditor;
38class LLInventoryItem;
39
40class LLLandmarkList
41{
42public:
43	typedef boost::function<void(LLLandmark*)> loaded_callback_t;
44
45	LLLandmarkList() {}
46	~LLLandmarkList();
47
48	//S32					getLength() { return mList.getLength(); }
49	//const LLLandmark*	getFirst()	{ return mList.getFirstData(); }
50	//const LLLandmark*	getNext()	{ return mList.getNextData(); }
51
52	BOOL assetExists(const LLUUID& asset_uuid);
53	LLLandmark* getAsset(const LLUUID& asset_uuid, loaded_callback_t cb = NULL);
54	static void processGetAssetReply(
55		LLVFS *vfs,
56		const LLUUID& uuid,
57		LLAssetType::EType type,
58		void* user_data,
59		S32 status,
60		LLExtStat ext_status );
61
62	// Returns TRUE if loading the landmark with given asset_uuid has been requested
63	// but is not complete yet.
64	BOOL isAssetInLoadedCallbackMap(const LLUUID& asset_uuid);
65
66protected:
67	void onRegionHandle(const LLUUID& landmark_id);
68	void makeCallbacks(const LLUUID& landmark_id);
69
70	typedef std::map<LLUUID, LLLandmark*> landmark_list_t;
71	landmark_list_t mList;
72
73	typedef std::set<LLUUID> landmark_bad_list_t;
74	landmark_bad_list_t mBadList;
75	
76	typedef std::map<LLUUID,F32> landmark_requested_list_t;
77	landmark_requested_list_t mRequestedList;
78	
79	// *TODO: make the callback multimap a template class and make use of it
80	// here and in LLLandmark.
81	typedef std::multimap<LLUUID, loaded_callback_t> loaded_callback_map_t;
82	loaded_callback_map_t mLoadedCallbackMap;
83};
84
85
86extern LLLandmarkList gLandmarkList;
87
88#endif  // LL_LLLANDMARKLIST_H