PageRenderTime 26ms CodeModel.GetById 17ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llstylemap.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 51 lines | 15 code | 8 blank | 28 comment | 0 complexity | 1bac7b2ea04503da27821ed95e74f72b MD5 | raw file
 1/** 
 2 * @file LLStyleMap.h
 3 * @brief LLStyleMap class definition
 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
28#ifndef LL_LLSTYLE_MAP_H
29#define LL_LLSTYLE_MAP_H
30
31#include "llstyle.h"
32#include "lluuid.h"
33#include "llsingleton.h"
34
35// Lightweight class for holding and managing mappings between UUIDs and links.
36// Used (for example) to create clickable name links off of IM chat.
37
38typedef std::map<LLUUID, LLStyle::Params> style_map_t;
39
40class LLStyleMap : public LLSingleton<LLStyleMap>
41{
42public:
43	// Just like the [] accessor but it will add the entry in if it doesn't exist.
44	const LLStyle::Params &lookupAgent(const LLUUID &source); 
45	const LLStyle::Params &lookup(const LLUUID &source, const std::string& link); 
46
47private:
48	style_map_t mMap;
49};
50
51#endif  // LL_LLSTYLE_MAP_H