diff options
author | dan miller | 2007-10-19 05:15:33 +0000 |
---|---|---|
committer | dan miller | 2007-10-19 05:15:33 +0000 |
commit | 79eca25c945a535a7a0325999034bae17da92412 (patch) | |
tree | 40ff433d94859d629aac933d5ec73b382f62ba1a /libraries/ode-0.9/OPCODE/Ice/IcePairs.h | |
parent | adding ode source to /libraries (diff) | |
download | opensim-SC-79eca25c945a535a7a0325999034bae17da92412.zip opensim-SC-79eca25c945a535a7a0325999034bae17da92412.tar.gz opensim-SC-79eca25c945a535a7a0325999034bae17da92412.tar.bz2 opensim-SC-79eca25c945a535a7a0325999034bae17da92412.tar.xz |
resubmitting ode
Diffstat (limited to '')
-rw-r--r-- | libraries/ode-0.9/OPCODE/Ice/IcePairs.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/libraries/ode-0.9/OPCODE/Ice/IcePairs.h b/libraries/ode-0.9/OPCODE/Ice/IcePairs.h new file mode 100644 index 0000000..2c09b92 --- /dev/null +++ b/libraries/ode-0.9/OPCODE/Ice/IcePairs.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
2 | /** | ||
3 | * Contains a simple pair class. | ||
4 | * \file IcePairs.h | ||
5 | * \author Pierre Terdiman | ||
6 | * \date January, 13, 2003 | ||
7 | */ | ||
8 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
9 | |||
10 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
11 | // Include Guard | ||
12 | #ifndef __ICEPAIRS_H__ | ||
13 | #define __ICEPAIRS_H__ | ||
14 | |||
15 | //! A generic couple structure | ||
16 | struct ICECORE_API Pair | ||
17 | { | ||
18 | inline_ Pair() {} | ||
19 | inline_ Pair(udword i0, udword i1) : id0(i0), id1(i1) {} | ||
20 | |||
21 | udword id0; //!< First index of the pair | ||
22 | udword id1; //!< Second index of the pair | ||
23 | }; | ||
24 | |||
25 | class ICECORE_API Pairs : private Container | ||
26 | { | ||
27 | public: | ||
28 | // Constructor / Destructor | ||
29 | Pairs() {} | ||
30 | ~Pairs() {} | ||
31 | |||
32 | inline_ udword GetNbPairs() const { return GetNbEntries()>>1; } | ||
33 | inline_ const Pair* GetPairs() const { return (const Pair*)GetEntries(); } | ||
34 | inline_ const Pair* GetPair(udword i) const { return (const Pair*)&GetEntries()[i+i]; } | ||
35 | |||
36 | inline_ BOOL HasPairs() const { return IsNotEmpty(); } | ||
37 | |||
38 | inline_ void ResetPairs() { Reset(); } | ||
39 | inline_ void DeleteLastPair() { DeleteLastEntry(); DeleteLastEntry(); } | ||
40 | |||
41 | inline_ void AddPair(const Pair& p) { Add(p.id0).Add(p.id1); } | ||
42 | inline_ void AddPair(udword id0, udword id1) { Add(id0).Add(id1); } | ||
43 | }; | ||
44 | |||
45 | #endif // __ICEPAIRS_H__ | ||