IcePairs.h
Go to the documentation of this file.
00001 
00002 
00008 
00009 
00011 // Include Guard
00012 #ifndef __ICEPAIRS_H__
00013 #define __ICEPAIRS_H__
00014 
00016         struct ICECORE_API Pair
00017         {
00018                 inline_ Pair()  {}
00019                 inline_ Pair(udword i0, udword i1) : id0(i0), id1(i1)   {}
00020 
00021                 udword  id0;    
00022                 udword  id1;    
00023         };
00024 
00025         class ICECORE_API Pairs : private Container
00026         {
00027                 public:
00028                 // Constructor / Destructor
00029                                                                 Pairs()                                                 {}
00030                                                                 ~Pairs()                                                {}
00031 
00032                 inline_ udword                  GetNbPairs()            const           { return GetNbEntries()>>1;                                     }
00033                 inline_ const Pair*             GetPairs()                      const           { return (const Pair*)GetEntries();                     }
00034                 inline_ const Pair*             GetPair(udword i)       const           { return (const Pair*)&GetEntries()[i+i];       }
00035 
00036                 inline_ BOOL                    HasPairs()                      const           { return IsNotEmpty();                                          }
00037 
00038                 inline_ void                    ResetPairs()                                    { Reset();                                                                      }
00039                 inline_ void                    DeleteLastPair()                                { DeleteLastEntry();    DeleteLastEntry();      }
00040 
00041                 inline_ void                    AddPair(const Pair& p)                  { Add(p.id0).Add(p.id1);                                        }
00042                 inline_ void                    AddPair(udword id0, udword id1) { Add(id0).Add(id1);                                            }
00043         };
00044 
00045 #endif // __ICEPAIRS_H__


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sun Apr 2 2017 03:43:54