Skip to content

cortex: support for newer boost #1460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: RB-10.5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/IECorePython/VectorTypedDataBinding.inl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#define IECOREPYTHON_VECTORTYPEDDATABINDING_INL

#include "boost/python.hpp"
#include "boost/numeric/conversion/cast.hpp"

#include "IECorePython/IECoreBinding.h"
#include "IECorePython/RunTimeTypedBinding.h"
Expand Down
2 changes: 1 addition & 1 deletion src/IECore/DirNameParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#include "boost/algorithm/string/classification.hpp"
#include "boost/algorithm/string/split.hpp"
#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/filesystem/operations.hpp"

#include <algorithm>
Expand Down
4 changes: 2 additions & 2 deletions src/IECore/FileNameParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

#include "boost/algorithm/string/classification.hpp"
#include "boost/algorithm/string/split.hpp"
#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/filesystem/operations.hpp"
#include "boost/format.hpp"

Expand Down Expand Up @@ -87,7 +87,7 @@ bool FileNameParameter::valueValid( const Object *value, std::string *reason ) c
// extensions check
if( extensions().size() )
{
string ext = boost::filesystem::extension(boost::filesystem::path( s->readable()));
string ext = boost::filesystem::path( s->readable()).extension().string();

const vector<string> &exts = extensions();
bool found = false;
Expand Down
4 changes: 2 additions & 2 deletions src/IECore/FileSequenceFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
#include "IECore/ReversedFrameList.h"

#include "boost/algorithm/string.hpp"
#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/filesystem/directory.hpp"
#include "boost/filesystem/operations.hpp"
#include "boost/format.hpp"
#include "boost/lexical_cast.hpp"
#include "boost/regex.hpp"
Expand Down
5 changes: 3 additions & 2 deletions src/IECore/FileSequenceParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@

#include "boost/algorithm/string/classification.hpp"
#include "boost/algorithm/string/split.hpp"
#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/filesystem/operations.hpp"

#include <algorithm>
#include <cassert>
Expand Down Expand Up @@ -130,7 +131,7 @@ bool FileSequenceParameter::valueValid( const Object *value, std::string *reason

if ( m_extensions.size() )
{
std::string ext = boost::filesystem::extension( boost::filesystem::path( fileSequence->getFileName() ) );
std::string ext = boost::filesystem::path(fileSequence->getFileName()).extension().string();
if ( ext.size() && ext[0] == '.' )
{
ext = ext.substr( 1, ext.size() - 1 );
Expand Down
5 changes: 3 additions & 2 deletions src/IECore/FileSequenceVectorParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@

#include "boost/algorithm/string/classification.hpp"
#include "boost/algorithm/string/split.hpp"
#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/path.hpp"

#include <algorithm>
#include <cassert>
Expand Down Expand Up @@ -131,7 +132,7 @@ bool FileSequenceVectorParameter::valueValid( const Object *value, std::string *

if ( m_extensions.size() )
{
std::string ext = boost::filesystem::extension( boost::filesystem::path( fileSequence->getFileName() ) );
std::string ext = boost::filesystem::path(fileSequence->getFileName()).extension().string();
if ( ext.size() && ext[0] == '.' )
{
ext = ext.substr( 1, ext.size() - 1 );
Expand Down
4 changes: 2 additions & 2 deletions src/IECore/IndexedIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

#include "IECore/Exception.h"

#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/algorithm/string.hpp"

#include <iostream>
Expand Down Expand Up @@ -76,7 +76,7 @@ IndexedIOPtr IndexedIO::create( const std::string &path, const IndexedIO::EntryI
{
IndexedIOPtr result = nullptr;

std::string extension = fs::extension(path);
std::string extension = fs::path(path).extension().string();
boost::to_lower( extension );

const CreatorMap &createFns = creators();
Expand Down
2 changes: 1 addition & 1 deletion src/IECore/PathParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#include "boost/algorithm/string/classification.hpp"
#include "boost/algorithm/string/split.hpp"
#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/filesystem/operations.hpp"

#include <algorithm>
Expand Down
2 changes: 1 addition & 1 deletion src/IECore/PathVectorParameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#include "boost/algorithm/string/classification.hpp"
#include "boost/algorithm/string/split.hpp"
#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/filesystem/operations.hpp"

#include <algorithm>
Expand Down
4 changes: 2 additions & 2 deletions src/IECore/Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

#include "boost/algorithm/string/classification.hpp"
#include "boost/algorithm/string/split.hpp"
#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/path.hpp"

using namespace std;
using namespace IECore;
Expand Down Expand Up @@ -84,7 +84,7 @@ ReaderPtr Reader::create( const std::string &fileName )
bool knownExtension = false;
ExtensionsToFnsMap *m = extensionsToFns();
assert( m );
string ext = extension(boost::filesystem::path(fileName));
string ext = boost::filesystem::path(fileName).extension().string();
if( ext!="" )
{
ExtensionsToFnsMap::const_iterator it = m->find( ext );
Expand Down
2 changes: 1 addition & 1 deletion src/IECore/SearchPath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ std::string SearchPath::getPaths( const std::string &separator ) const
boost::filesystem::path SearchPath::find( const boost::filesystem::path &file ) const
{
// if it's a full path then there's no need to do any searching
if( file.is_complete() )
if( file.is_absolute() )
{
if( exists( file ) )
{
Expand Down
6 changes: 3 additions & 3 deletions src/IECore/Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

#include "boost/algorithm/string/classification.hpp"
#include "boost/algorithm/string/split.hpp"
#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/path.hpp"

#include <cassert>

Expand Down Expand Up @@ -116,7 +116,7 @@ void Writer::registerWriter( const std::string &extensions, CanWriteFn canWrite,

WriterPtr Writer::create( ObjectPtr object, const std::string &fileName )
{
string ext = extension(boost::filesystem::path(fileName));
string ext = boost::filesystem::path(fileName).extension().string();

ExtensionsToFnsMap *m = extensionsToFns();
assert( m );
Expand Down Expand Up @@ -146,7 +146,7 @@ WriterPtr Writer::create( ObjectPtr object, const std::string &fileName )

WriterPtr Writer::create( const std::string &fileName )
{
string ext = extension(boost::filesystem::path(fileName));
string ext = boost::filesystem::path(fileName).extension().string();

ExtensionsToFnsMap *m = extensionsToFns();
ExtensionsToFnsMap::const_iterator it = m->find( ext );
Expand Down
1 change: 0 additions & 1 deletion src/IECoreGL/Selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
#include "IECore/MessageHandler.h"

#include "boost/format.hpp"
#include "boost/timer.hpp"

using namespace IECoreGL;

Expand Down
33 changes: 19 additions & 14 deletions src/IECoreImage/ClientDisplayDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ClientDisplayDriver::PrivateData : public RefCounted
m_socket.close();
}

boost::asio::io_service m_service;
boost::asio::io_context m_service;
std::string m_host;
std::string m_port;
bool m_scanLineOrderOnly;
Expand All @@ -97,23 +97,28 @@ ClientDisplayDriver::ClientDisplayDriver( const Imath::Box2i &displayWindow, con
m_data->m_port = displayPortData->readable();

tcp::resolver resolver(m_data->m_service);
tcp::resolver::query query(m_data->m_host, m_data->m_port);

boost::system::error_code error;
tcp::resolver::iterator iterator = resolver.resolve( query, error );
if( !error )
boost::system::error_code error;
auto endpoints = resolver.resolve(m_data->m_host, m_data->m_port, error);
if ( error )
{
error = boost::asio::error::host_not_found;
while( error && iterator != tcp::resolver::iterator() )
{
m_data->m_socket.close();
m_data->m_socket.connect( *iterator++, error );
}
throw Exception("Could not resolve host: " + error.message());
}
if( error )

error = boost::asio::error::host_not_found;
for (const auto& endpoint : endpoints)
{
m_data->m_socket.close();
m_data->m_socket.connect(endpoint, error);
if ( !error )
{
break;
}
}

if ( error )
{
throw Exception( std::string( "Could not connect to remote display driver server : " ) + error.message() );
}
}

MemoryIndexedIOPtr io;
ConstCharVectorDataPtr buf;
Expand Down
6 changes: 3 additions & 3 deletions src/IECoreImage/DisplayDriverServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class DisplayDriverServer::Session : public RefCounted
{
public:

Session( boost::asio::io_service& io_service, MergeMap& mergeMap );
Session( boost::asio::io_context& io_service, MergeMap& mergeMap );
~Session() override;

boost::asio::ip::tcp::socket& socket();
Expand Down Expand Up @@ -135,7 +135,7 @@ class DisplayDriverServer::PrivateData : public RefCounted
public :

boost::asio::ip::tcp::endpoint m_endpoint;
boost::asio::io_service m_service;
boost::asio::io_context m_service;
boost::asio::ip::tcp::acceptor m_acceptor;
std::thread m_thread;
MergeMap m_mergeMap;
Expand Down Expand Up @@ -306,7 +306,7 @@ void DisplayDriverServer::handleAccept( DisplayDriverServer::SessionPtr session,
* DisplayDriverServer::Session functions
*/

DisplayDriverServer::Session::Session( boost::asio::io_service& io_service, MergeMap& mergeMap ) :
DisplayDriverServer::Session::Session( boost::asio::io_context& io_service, MergeMap& mergeMap ) :
m_socket( io_service ), m_displayDriver(nullptr), m_buffer( new CharVectorData( ) ), m_mergeMap( mergeMap )
{
}
Expand Down
4 changes: 2 additions & 2 deletions src/IECoreScene/SceneInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include "IECoreScene/SceneInterface.h"

#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/tokenizer.hpp"
#include "boost/algorithm/string.hpp"

Expand Down Expand Up @@ -104,7 +104,7 @@ SceneInterfacePtr SceneInterface::create( const std::string &path, IndexedIO::Op
{
SceneInterfacePtr result = nullptr;

std::string extension = boost::filesystem::extension(path);
std::string extension = boost::filesystem::path(path).extension().string();
boost::algorithm::to_lower( extension );
IndexedIO::OpenModeFlags openMode = IndexedIO::OpenModeFlags( mode & (IndexedIO::Read|IndexedIO::Write|IndexedIO::Append) );
std::pair< std::string, IndexedIO::OpenModeFlags > key( extension, openMode );
Expand Down
Loading