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__
Pair
A generic couple structure.
Definition: IcePairs.h:16
i
png_uint_32 i
Definition: png.h:2732
Pair::id0
udword id0
First index of the pair.
Definition: IcePairs.h:21
Container
Definition: IceContainer.h:25
udword
unsigned int udword
sizeof(udword) must be 4
Definition: IceTypes.h:65
Pairs::Pairs
Pairs()
Definition: IcePairs.h:29
BOOL
int BOOL
Another boolean type.
Definition: IceTypes.h:102
Pair::id1
udword id1
Second index of the pair.
Definition: IcePairs.h:22
Pair::Pair
inline_ Pair()
Definition: IcePairs.h:18
Pairs::AddPair
inline_ void AddPair(const Pair &p)
Definition: IcePairs.h:41
Pair::Pair
inline_ Pair(udword i0, udword i1)
Definition: IcePairs.h:19
Container::Add
inline_ Container & Add(udword entry)
Definition: IceContainer.h:47
Pairs::GetNbPairs
inline_ udword GetNbPairs() const
Definition: IcePairs.h:32
ICECORE_API
#define ICECORE_API
Definition: IcePreprocessor.h:73
Pairs::HasPairs
inline_ BOOL HasPairs() const
Definition: IcePairs.h:36
Pairs
Definition: IcePairs.h:25
Pairs::GetPairs
const inline_ Pair * GetPairs() const
Definition: IcePairs.h:33
Pairs::~Pairs
~Pairs()
Definition: IcePairs.h:30
Pairs::ResetPairs
inline_ void ResetPairs()
Definition: IcePairs.h:38
Pairs::GetPair
const inline_ Pair * GetPair(udword i) const
Definition: IcePairs.h:34
Pairs::AddPair
inline_ void AddPair(udword id0, udword id1)
Definition: IcePairs.h:42
inline_
#define inline_
Definition: IcePreprocessor.h:103
Pairs::DeleteLastPair
inline_ void DeleteLastPair()
Definition: IcePairs.h:39
Container::Reset
inline_ void Reset()
Definition: IceContainer.h:125
Container::DeleteLastEntry
inline_ void DeleteLastEntry()
Deletes the very last entry.
Definition: IceContainer.h:162


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Wed Sep 7 2022 02:51:03