00001 // Filename: firstOfPairCompare.h 00002 // Created by: drose (27Jun01) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef FIRSTOFPAIRCOMPARE_H 00016 #define FIRSTOFPAIRCOMPARE_H 00017 00018 #include "pandabase.h" 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Class : FirstOfPairCompare 00022 // Description : An STL function object class, this is intended to be 00023 // used on any ordered collection of pairs of objects. 00024 // It invokes the indicated comparison function object 00025 // on the first object of its pair. 00026 //////////////////////////////////////////////////////////////////// 00027 template<class ObjectType, class Compare> 00028 class FirstOfPairCompare { 00029 public: 00030 INLINE FirstOfPairCompare(Compare compare = Compare()); 00031 INLINE bool operator () (const ObjectType &a, const ObjectType &b) const; 00032 Compare _compare; 00033 }; 00034 00035 #include "firstOfPairCompare.I" 00036 00037 #endif 00038