PageRenderTime 344ms CodeModel.GetById 181ms app.highlight 6ms RepoModel.GetById 155ms app.codeStats 0ms

/indra/llprimitive/llvolumemessage.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 92 lines | 46 code | 10 blank | 36 comment | 0 complexity | 90c0e058c2b885645ffee21e7f7cba85 MD5 | raw file
 1/** 
 2 * @file llvolumemessage.h
 3 * @brief LLVolumeMessage base class
 4 *
 5 * $LicenseInfo:firstyear=2001&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_LLVOLUMEMESSAGE_H
28#define LL_LLVOLUMEMESSAGE_H
29
30#include "llvolume.h"
31
32class LLMessageSystem;
33class LLDataPacker;
34
35// wrapper class for some volume/message functions
36class LLVolumeMessage
37{
38protected:
39	// The profile and path params are protected since they do not do
40	// any kind of parameter validation or clamping. Use the public
41	// pack and unpack volume param methods below
42
43	static bool packProfileParams(
44		const LLProfileParams* params,
45		LLMessageSystem* mesgsys);
46	static bool packProfileParams(
47		const LLProfileParams* params,
48		LLDataPacker& dp);
49	static bool unpackProfileParams(
50		LLProfileParams* params,
51		LLMessageSystem* mesgsys,
52		char const* block_name,
53		S32 block_num = 0);
54	static bool unpackProfileParams(LLProfileParams* params, LLDataPacker& dp);
55
56	static bool packPathParams(
57		const LLPathParams* params,
58		LLMessageSystem* mesgsys);
59	static bool packPathParams(const LLPathParams* params, LLDataPacker& dp);
60	static bool unpackPathParams(
61		LLPathParams* params,
62		LLMessageSystem* mesgsys,
63		char const* block_name,
64		S32 block_num = 0);
65	static bool unpackPathParams(LLPathParams* params, LLDataPacker& dp);
66
67public:
68	/**
69	 * @brief This method constrains any volume params to make them valid.
70	 *
71	 * @param[in,out] Possibly invalid params in, always valid out.
72	 * @return Returns true if the in params were valid, and therefore
73	 * unchanged.
74	 */
75	static bool constrainVolumeParams(LLVolumeParams& params);
76
77	static bool packVolumeParams(
78		const LLVolumeParams* params,
79		LLMessageSystem* mesgsys);
80	static bool packVolumeParams(
81		const LLVolumeParams* params,
82		LLDataPacker& dp);
83	static bool unpackVolumeParams(
84		LLVolumeParams* params,
85		LLMessageSystem* mesgsys,
86		char const* block_name,
87		S32 block_num = 0);
88	static bool unpackVolumeParams(LLVolumeParams* params, LLDataPacker &dp);
89};
90
91#endif // LL_LLVOLUMEMESSAGE_H
92