IcePairs.h
Go to the documentation of this file.
1 
8 
11 // Include Guard
12 #ifndef __ICEPAIRS_H__
13 #define __ICEPAIRS_H__
14 
17  {
19  inline_ Pair(udword i0, udword i1) : id0(i0), id1(i1) {}
20 
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(); }
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__
~Pairs()
Definition: IcePairs.h:30
udword id0
First index of the pair.
Definition: IcePairs.h:21
inline_ void DeleteLastPair()
Definition: IcePairs.h:39
udword id1
Second index of the pair.
Definition: IcePairs.h:22
inline_ const Pair * GetPairs() const
Definition: IcePairs.h:33
#define inline_
inline_ BOOL IsNotEmpty() const
Checks the container is empty.
Definition: IceContainer.h:181
png_uint_32 i
Definition: png.h:2735
Definition: IcePairs.h:25
inline_ void DeleteLastEntry()
Deletes the very last entry.
Definition: IceContainer.h:162
inline_ Pair()
Definition: IcePairs.h:18
#define ICECORE_API
inline_ udword GetNbPairs() const
Definition: IcePairs.h:32
Pairs()
Definition: IcePairs.h:29
int BOOL
Another boolean type.
Definition: IceTypes.h:102
inline_ void AddPair(const Pair &p)
Definition: IcePairs.h:41
unsigned int udword
sizeof(udword) must be 4
Definition: IceTypes.h:65
inline_ Container & Add(udword entry)
Definition: IceContainer.h:47
inline_ const Pair * GetPair(udword i) const
Definition: IcePairs.h:34
inline_ void Reset()
Definition: IceContainer.h:125
inline_ Pair(udword i0, udword i1)
Definition: IcePairs.h:19
inline_ udword GetNbEntries() const
Returns the current number of entries.
Definition: IceContainer.h:170
inline_ udword * GetEntries() const
Returns the list of entries.
Definition: IceContainer.h:172
inline_ BOOL HasPairs() const
Definition: IcePairs.h:36
inline_ void ResetPairs()
Definition: IcePairs.h:38
inline_ void AddPair(udword id0, udword id1)
Definition: IcePairs.h:42
A generic couple structure.
Definition: IcePairs.h:16


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat May 8 2021 02:42:38