mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-17 12:12:10 -04:00
add compareTo
This commit is contained in:
parent
fca4e4ebfb
commit
eb05821d40
@ -12,8 +12,10 @@
|
||||
bamReaderParam.h bamWriter.I bamWriter.h bitMask.I \
|
||||
bitMask.h buttonEvent.I buttonEvent.h buttonHandle.I \
|
||||
buttonHandle.h buttonRegistry.I buttonRegistry.h \
|
||||
collideMask.h config_util.N config_util.h \
|
||||
configurable.h factoryBase.I factoryBase.h \
|
||||
collideMask.h \
|
||||
compareTo.I compareTo.h \
|
||||
config_util.N config_util.h configurable.h \
|
||||
factoryBase.I factoryBase.h \
|
||||
factoryParam.I factoryParam.h factoryParams.I \
|
||||
factoryParams.h \
|
||||
firstOfPairCompare.I firstOfPairCompare.h \
|
||||
@ -65,6 +67,7 @@
|
||||
bamWriter.I bamWriter.h bitMask.I bitMask.h buttonEvent.I \
|
||||
buttonEvent.h buttonHandle.I buttonHandle.h buttonRegistry.I \
|
||||
buttonRegistry.h collideMask.h \
|
||||
compareTo.I compareTo.h \
|
||||
config_util.h configurable.h factory.I factory.h \
|
||||
factoryBase.I factoryBase.h factoryParam.I factoryParam.h \
|
||||
factoryParams.I factoryParams.h \
|
||||
|
29
panda/src/putil/compareTo.I
Normal file
29
panda/src/putil/compareTo.I
Normal file
@ -0,0 +1,29 @@
|
||||
// Filename: compareTo.I
|
||||
// Created by: drose (22Feb02)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://www.panda3d.org/license.txt .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d@yahoogroups.com .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: CompareTo::operator ()
|
||||
// Access: Public
|
||||
// Description: Returns true if a sorts before b, false otherwise.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class ObjectType>
|
||||
INLINE bool CompareTo<ObjectType>::
|
||||
operator () (const ObjectType &a, const ObjectType &b) const {
|
||||
return (a.compare_to(b) < 0);
|
||||
}
|
40
panda/src/putil/compareTo.h
Normal file
40
panda/src/putil/compareTo.h
Normal file
@ -0,0 +1,40 @@
|
||||
// Filename: compareTo.h
|
||||
// Created by: drose (22Feb02)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PANDA 3D SOFTWARE
|
||||
// Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved
|
||||
//
|
||||
// All use of this software is subject to the terms of the Panda 3d
|
||||
// Software license. You should have received a copy of this license
|
||||
// along with this source code; you will also find a current copy of
|
||||
// the license at http://www.panda3d.org/license.txt .
|
||||
//
|
||||
// To contact the maintainers of this program write to
|
||||
// panda3d@yahoogroups.com .
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef COMPARETO_H
|
||||
#define COMPARETO_H
|
||||
|
||||
#include <pandabase.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Class : CompareTo
|
||||
// Description : An STL function object class, this is intended to be
|
||||
// used on any ordered collection of classes that
|
||||
// contain a compare_to() method. It defines the order
|
||||
// of the pointers via compare_to().
|
||||
////////////////////////////////////////////////////////////////////
|
||||
template<class ObjectType>
|
||||
class CompareTo {
|
||||
public:
|
||||
INLINE bool operator () (const ObjectType &a, const ObjectType &b) const;
|
||||
};
|
||||
|
||||
#include "compareTo.I"
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user