From d6634fcd2433e18eea1a9bf31da6d7e531817d77 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 22 Oct 2012 19:54:10 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system sanitized param block code to accept isValid and isProvided at any point added predicates to control serialization --- indra/llcommon/llpredicate.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 indra/llcommon/llpredicate.cpp (limited to 'indra/llcommon/llpredicate.cpp') diff --git a/indra/llcommon/llpredicate.cpp b/indra/llcommon/llpredicate.cpp new file mode 100644 index 0000000000..8dcd9247b7 --- /dev/null +++ b/indra/llcommon/llpredicate.cpp @@ -0,0 +1,33 @@ +/** + * @file llpredicate.cpp + * @brief abstraction for filtering objects by predicates, with arbitrary boolean expressions + * + * $LicenseInfo:firstyear=2008&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ +#include "linden_common.h" + +#include "llpredicate.h" + +namespace LLPredicate +{ + EmptyRule make_rule() { return EmptyRule(); } +} -- cgit v1.2.3 From 28179ab0070a1c13193808bc1493761a8fed167f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 23 Oct 2012 23:12:33 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system cleaned up predicate system, made unknown work with remove --- indra/llcommon/llpredicate.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/llcommon/llpredicate.cpp') diff --git a/indra/llcommon/llpredicate.cpp b/indra/llcommon/llpredicate.cpp index 8dcd9247b7..1ab1ab08f1 100644 --- a/indra/llcommon/llpredicate.cpp +++ b/indra/llcommon/llpredicate.cpp @@ -30,4 +30,18 @@ namespace LLPredicate { EmptyRule make_rule() { return EmptyRule(); } + + int predicateFlagsFromValue(int value) + { + llassert(value < 5); + static const int predicates[5] = + { + 0xAAAAaaaa, // 10101010101010101010101010101010 + 0xCCCCcccc, // 11001100110011001100110011001100 + 0xF0F0F0F0, // 11110000111100001111000011110000 + 0xFF00FF00, // 11111111000000001111111100000000 + 0xFFFF0000 // 11111111111111110000000000000000 + }; + return predicates[value]; + } } -- cgit v1.2.3 From 1de6ecb23851e0784016a2c4c9f691c976c6bda7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 23 Oct 2012 23:35:15 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system converted "int" to "S32" --- indra/llcommon/llpredicate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/llpredicate.cpp') diff --git a/indra/llcommon/llpredicate.cpp b/indra/llcommon/llpredicate.cpp index 1ab1ab08f1..e3410ef3f6 100644 --- a/indra/llcommon/llpredicate.cpp +++ b/indra/llcommon/llpredicate.cpp @@ -31,10 +31,10 @@ namespace LLPredicate { EmptyRule make_rule() { return EmptyRule(); } - int predicateFlagsFromValue(int value) + S32 predicateFlagsFromValue(S32 value) { llassert(value < 5); - static const int predicates[5] = + static const S32 predicates[5] = { 0xAAAAaaaa, // 10101010101010101010101010101010 0xCCCCcccc, // 11001100110011001100110011001100 -- cgit v1.2.3 From 3ffd0be53af0c5338e6fdc77d240e976aeb10451 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 26 Oct 2012 20:03:33 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system fixed llpredicate so that values and rules work uniformly with predicate logic and/or/negate works in parallel with set/clear --- indra/llcommon/llpredicate.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'indra/llcommon/llpredicate.cpp') diff --git a/indra/llcommon/llpredicate.cpp b/indra/llcommon/llpredicate.cpp index e3410ef3f6..1278948e24 100644 --- a/indra/llcommon/llpredicate.cpp +++ b/indra/llcommon/llpredicate.cpp @@ -29,19 +29,13 @@ namespace LLPredicate { - EmptyRule make_rule() { return EmptyRule(); } - - S32 predicateFlagsFromValue(S32 value) + const U32 cPredicateFlagsFromEnum[5] = { - llassert(value < 5); - static const S32 predicates[5] = - { - 0xAAAAaaaa, // 10101010101010101010101010101010 - 0xCCCCcccc, // 11001100110011001100110011001100 - 0xF0F0F0F0, // 11110000111100001111000011110000 - 0xFF00FF00, // 11111111000000001111111100000000 - 0xFFFF0000 // 11111111111111110000000000000000 - }; - return predicates[value]; - } + 0xAAAAaaaa, // 10101010101010101010101010101010 + 0xCCCCcccc, // 11001100110011001100110011001100 + 0xF0F0F0F0, // 11110000111100001111000011110000 + 0xFF00FF00, // 11111111000000001111111100000000 + 0xFFFF0000 // 11111111111111110000000000000000 + }; } + -- cgit v1.2.3