summaryrefslogtreecommitdiff
path: root/indra/llcommon/llstrider.h
diff options
context:
space:
mode:
authorKelly Washington <kelly@lindenlab.com>2012-06-27 14:43:10 -0700
committerKelly Washington <kelly@lindenlab.com>2012-06-27 14:43:10 -0700
commita68c7c27f9980a130af5eaf65c6731271a27b060 (patch)
treefa2d9a9444cfe742d1db3166079fd6631a26ddbd /indra/llcommon/llstrider.h
parent14ebeffe8776562c0ac9711a44b7ebe3dec49c47 (diff)
parent8a7fa77f23b94f9ba2cb6da1942e4f86da314b5a (diff)
Merge pulled in lindenlab/viewer-beta to kelly_linden/maint-1078
Diffstat (limited to 'indra/llcommon/llstrider.h')
-rw-r--r--indra/llcommon/llstrider.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/llcommon/llstrider.h b/indra/llcommon/llstrider.h
index f4c43bac61..ed9284d2c5 100644
--- a/indra/llcommon/llstrider.h
+++ b/indra/llcommon/llstrider.h
@@ -44,6 +44,15 @@ public:
const LLStrider<Object>& operator = (Object *first) { mObjectp = first; return *this;}
void setStride (S32 skipBytes) { mSkip = (skipBytes ? skipBytes : sizeof(Object));}
+ LLStrider<Object> operator+(const S32& index)
+ {
+ LLStrider<Object> ret;
+ ret.mBytep = mBytep + mSkip*index;
+ ret.mSkip = mSkip;
+
+ return ret;
+ }
+
void skip(const U32 index) { mBytep += mSkip*index;}
U32 getSkip() const { return mSkip; }
Object* get() { return mObjectp; }
@@ -51,6 +60,7 @@ public:
Object& operator *() { return *mObjectp; }
Object* operator ++(int) { Object* old = mObjectp; mBytep += mSkip; return old; }
Object* operator +=(int i) { mBytep += mSkip*i; return mObjectp; }
+
Object& operator[](U32 index) { return *(Object*)(mBytep + (mSkip * index)); }
};