Skip to content

Commit

Permalink
Replace boost::function with std.
Browse files Browse the repository at this point in the history
This avoids a warning on later versions of gcc where std::bind is used with
boost::function.

(Internal change: 1971968)
  • Loading branch information
c64kernal authored and pixar-oss committed May 18, 2019
1 parent 6a67216 commit 5997ff0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
13 changes: 7 additions & 6 deletions pxr/usd/plugin/usdAbc/alembicReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#include <Alembic/AbcGeom/IXform.h>
#include <Alembic/AbcGeom/SchemaInfoDeclarations.h>
#include <Alembic/AbcGeom/Visibility.h>
#include <functional>
#include <memory>
#include <mutex>

Expand Down Expand Up @@ -576,7 +577,7 @@ AlembicProperty::GetHeader() const
/// previous via a \c _PrimReaderContext.
class _ReaderSchema {
public:
typedef boost::function<void (_PrimReaderContext*)> PrimReader;
typedef std::function<void (_PrimReaderContext*)> PrimReader;
typedef std::vector<PrimReader> PrimReaderVector;
typedef UsdAbc_AlembicDataConversion::ToUsdConverter Converter;

Expand Down Expand Up @@ -655,8 +656,8 @@ _ReaderSchema::GetPrimReaders(const std::string& schema) const
class _ReaderContext {
public:
/// Gets data from some property at a given sample.
typedef boost::function<bool (const UsdAbc_AlembicDataAny&,
const ISampleSelector&)> Converter;
typedef std::function<bool (const UsdAbc_AlembicDataAny&,
const ISampleSelector&)> Converter;

/// An optional ordering of name children or properties.
typedef boost::optional<TfTokenVector> Ordering;
Expand Down Expand Up @@ -1808,9 +1809,9 @@ class _PrimReaderContext {
typedef _IsValidTag IsValidTag;
typedef _MetaDataTag MetaDataTag;
typedef _SampleTimesTag SampleTimesTag;
typedef boost::function<bool (IsValidTag)> IsValid;
typedef boost::function<const MetaData& (MetaDataTag)> GetMetaData;
typedef boost::function<_AlembicTimeSamples(SampleTimesTag)> GetSampleTimes;
typedef std::function<bool (IsValidTag)> IsValid;
typedef std::function<const MetaData& (MetaDataTag)> GetMetaData;
typedef std::function<_AlembicTimeSamples(SampleTimesTag)> GetSampleTimes;

_PrimReaderContext(_ReaderContext&,
const IObject& prim,
Expand Down
13 changes: 7 additions & 6 deletions pxr/usd/plugin/usdAbc/alembicUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <Alembic/Abc/ICompoundProperty.h>
#include <Alembic/Abc/ISampleSelector.h>
#include <boost/call_traits.hpp>
#include <boost/function.hpp>
#include <boost/operators.hpp>
#include <boost/optional.hpp>
#include <boost/shared_array.hpp>
Expand All @@ -47,6 +46,8 @@
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/variant.hpp>

#include <functional>
#include <algorithm>
#include <iosfwd>
#include <map>
Expand Down Expand Up @@ -894,15 +895,15 @@ class UsdAbc_AlembicDataConversion {
/// value from the named property in the compound property at the given
/// sample selector to the \c UsdAbc_AlembicDataAny value. The converter
/// can assume the property has the type that the converter was keyed by.
typedef boost::function<bool (const ICompoundProperty&,
const std::string&,
const ISampleSelector&,
const UsdAbc_AlembicDataAny&)> ToUsdConverter;
typedef std::function<bool (const ICompoundProperty&,
const std::string&,
const ISampleSelector&,
const UsdAbc_AlembicDataAny&)> ToUsdConverter;

/// A reverse conversion function (Usd -> Alembic). Returns the value
/// as a \c _SampleForAlembic. The converter can assume the VtValue
/// is holding the expected type.
typedef boost::function<_SampleForAlembic(const VtValue&)> FromUsdConverter;
typedef std::function<_SampleForAlembic(const VtValue&)> FromUsdConverter;

UsdAbc_AlembicDataConversion();

Expand Down
8 changes: 4 additions & 4 deletions pxr/usd/plugin/usdAbc/alembicWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
#include <Alembic/AbcGeom/OXform.h>
#include <Alembic/AbcGeom/Visibility.h>
#include <Alembic/AbcCoreOgawa/All.h>
#include <boost/function.hpp>
#include <boost/functional/hash.hpp>
#include <algorithm>
#include <functional>
#include <memory>
#include <set>
#include <type_traits>
Expand Down Expand Up @@ -526,7 +526,7 @@ class _PrimWriterContext;
/// previous via a \c _PrimWriterContext.
class _WriterSchema {
public:
typedef boost::function<void (_PrimWriterContext*)> PrimWriter;
typedef std::function<void (_PrimWriterContext*)> PrimWriter;
typedef std::vector<PrimWriter> PrimWriterVector;
typedef UsdAbc_AlembicDataConversion::FromUsdConverter Converter;

Expand Down Expand Up @@ -614,7 +614,7 @@ _WriterSchema::GetPrimWriters(const TfToken& name) const
bool
_WriterSchema::IsValid(const UsdSamples& samples) const
{
return GetConverter(samples.GetTypeName());
return GetConverter(samples.GetTypeName()) ? true : false;
}

bool
Expand Down Expand Up @@ -2265,7 +2265,7 @@ void
_WriteNamespacedPropertyGroup(
_PrimWriterContext* context,
const TfToken& namespaceName,
const boost::function<OCompoundProperty()>& getParentProperty)
const std::function<OCompoundProperty()>& getParentProperty)
{
// First check if there are any properties to convert. We only ask
// for that property if so, because asking for it will create it on
Expand Down

0 comments on commit 5997ff0

Please sign in to comment.