Permalink
Browse files

Removed reprecated C++ usage

  • Loading branch information...
robertosfield committed Nov 1, 2018
1 parent c934172 commit 7729d38b2b426eee106e63bb1824b31301aa3400
Showing with 4 additions and 53 deletions.
  1. +4 −2 include/osgWidget/WindowManager
  2. +0 −51 src/osgDB/DatabasePager.cpp
@@ -285,14 +285,16 @@ class OSGWIDGET_EXPORT WindowManager: public osg::Switch, public UIObjectParent<
private:
// A functor used to sort the Windows by their Z component in descending order.
struct WindowZCompare: public std::binary_function<ptr_type, ptr_type, bool> {
struct WindowZCompare
{
bool operator()(const ptr_type& x, const ptr_type& y) {
return x.get()->getZ() > y.get()->getZ();
}
};
// A functor used to sort the Windows by their BinNum component in descending order.
struct WindowBinNumberCompare: public std::binary_function<ptr_type, ptr_type, bool> {
struct WindowBinNumberCompare
{
bool operator()(const ptr_type& x, const ptr_type& y) {
return
x.get()->getOrCreateStateSet()->getBinNumber() >
@@ -49,57 +49,6 @@ static osg::ApplicationUsageProxy DatabasePager_e4(osg::ApplicationUsage::ENVIRO
static osg::ApplicationUsageProxy DatabasePager_e11(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_MAX_PAGEDLOD <num>","Set the target maximum number of PagedLOD to maintain.");
static osg::ApplicationUsageProxy DatabasePager_e12(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_ASSIGN_PBO_TO_IMAGES <ON/OFF>","Set whether PixelBufferObjects should be assigned to Images to aid download to the GPU.");
// Convert function objects that take pointer args into functions that a
// reference to an osg::ref_ptr. This is quite useful for doing STL
// operations on lists of ref_ptr. This code assumes that a function
// with an argument const Foo* should be composed into a function of
// argument type ref_ptr<Foo>&, not ref_ptr<const Foo>&. Some support
// for that should be added to make this more general.
namespace
{
template <typename U>
struct PointerTraits
{
typedef class NullType {} PointeeType;
};
template <typename U>
struct PointerTraits<U*>
{
typedef U PointeeType;
};
template <typename U>
struct PointerTraits<const U*>
{
typedef U PointeeType;
};
template <typename FuncObj>
class RefPtrAdapter
: public std::unary_function<const osg::ref_ptr<typename PointerTraits<typename FuncObj::argument_type>::PointeeType>,
typename FuncObj::result_type>
{
public:
typedef typename PointerTraits<typename FuncObj::argument_type>::PointeeType PointeeType;
typedef osg::ref_ptr<PointeeType> RefPtrType;
explicit RefPtrAdapter(const FuncObj& funcObj) : _func(funcObj) {}
typename FuncObj::result_type operator()(const RefPtrType& refPtr) const
{
return _func(refPtr.get());
}
protected:
FuncObj _func;
};
template <typename FuncObj>
RefPtrAdapter<FuncObj> refPtrAdapt(const FuncObj& func)
{
return RefPtrAdapter<FuncObj>(func);
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//

0 comments on commit 7729d38

Please sign in to comment.