Skip to content

Commit

Permalink
Hide Private headers and deprecate LocalCache.hh (#109)
Browse files Browse the repository at this point in the history
Signed-off-by: ahcorde <[email protected]>
  • Loading branch information
ahcorde authored Sep 1, 2020
1 parent 4e6f2f1 commit d892487
Show file tree
Hide file tree
Showing 14 changed files with 80 additions and 19 deletions.
5 changes: 1 addition & 4 deletions include/ignition/fuel_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
ign_install_all_headers(
EXCLUDE_FILES
WorldIterPrivate.hh
)
ign_install_all_headers()
3 changes: 2 additions & 1 deletion include/ignition/fuel_tools/LocalCache.hh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ namespace ignition
{
/// \brief Constructor
/// \param[in] _config The configuration for the client
public: explicit LocalCache(const ClientConfig *_config);
public:
explicit IGN_DEPRECATED(5) LocalCache(const ClientConfig *_config);

/// \brief destructor
public: virtual ~LocalCache();
Expand Down
15 changes: 13 additions & 2 deletions src/FuelClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
#include "ignition/fuel_tools/JSONParser.hh"
#include "ignition/fuel_tools/LocalCache.hh"
#include "ignition/fuel_tools/ModelIdentifier.hh"
#include "ignition/fuel_tools/ModelIterPrivate.hh"
#include "ModelIterPrivate.hh"
#include "ignition/fuel_tools/RestClient.hh"
#include "ignition/fuel_tools/WorldIdentifier.hh"
#include "ignition/fuel_tools/WorldIterPrivate.hh"
#include "WorldIterPrivate.hh"

using namespace ignition;
using namespace fuel_tools;
Expand Down Expand Up @@ -208,9 +208,20 @@ FuelClient::FuelClient(const ClientConfig &_config, const Rest &_rest,
this->dataPtr->rest.SetUserAgent(this->dataPtr->config.UserAgent());

if (nullptr == _cache)
{
#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
this->dataPtr->cache.reset(new LocalCache(&(this->dataPtr->config)));
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif
}
else
{
this->dataPtr->cache.reset(_cache);
}

this->dataPtr->urlModelRegex.reset(new std::regex(
this->dataPtr->kModelUrlRegexStr));
Expand Down
4 changes: 2 additions & 2 deletions src/JSONParser_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include "ignition/fuel_tools/ClientConfig.hh"
#include "ignition/fuel_tools/JSONParser.hh"
#include "ignition/fuel_tools/ModelIter.hh"
#include "ignition/fuel_tools/ModelIterPrivate.hh"
#include "ignition/fuel_tools/WorldIter.hh"
#include "ignition/fuel_tools/WorldIterPrivate.hh"
#include "ModelIterPrivate.hh"
#include "WorldIterPrivate.hh"

using namespace ignition;
using namespace fuel_tools;
Expand Down
7 changes: 4 additions & 3 deletions src/LocalCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@

#include "ignition/fuel_tools/ClientConfig.hh"
#include "ignition/fuel_tools/LocalCache.hh"
#include "ignition/fuel_tools/ModelIterPrivate.hh"
#include "ignition/fuel_tools/ModelPrivate.hh"
#include "ignition/fuel_tools/Zip.hh"
#include "ignition/fuel_tools/WorldIterPrivate.hh"

#include "ModelPrivate.hh"
#include "ModelIterPrivate.hh"
#include "WorldIterPrivate.hh"

using namespace ignition;
using namespace fuel_tools;
Expand Down
46 changes: 46 additions & 0 deletions src/LocalCache_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,14 @@ TEST_F(LocalCacheTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(AllModels))
createLocal6Models(conf);
createLocal3Models(conf);

#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
ignition::fuel_tools::LocalCache cache(&conf);
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif

auto iter = cache.AllModels();
std::set<std::string> uniqueNames;
Expand Down Expand Up @@ -267,7 +274,14 @@ TEST_F(LocalCacheTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(MatchingModels))
createLocal6Models(conf);
createLocal3Models(conf);

#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
ignition::fuel_tools::LocalCache cache(&conf);
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif

ModelIdentifier am1;
am1.SetServer(conf.Servers().front());
Expand Down Expand Up @@ -313,7 +327,15 @@ TEST_F(LocalCacheTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(MatchingModel))
conf.SetCacheLocation(common::joinPaths(common::cwd(), "test_cache"));
createLocal6Models(conf);

#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
ignition::fuel_tools::LocalCache cache(&conf);
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif


ignition::fuel_tools::ServerConfig srv1;
srv1.SetUrl(common::URI("http://localhost:8001/"));
Expand Down Expand Up @@ -372,7 +394,15 @@ TEST_F(LocalCacheTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(AllWorlds))
createLocal6Worlds(conf);
createLocal3Worlds(conf);

#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
ignition::fuel_tools::LocalCache cache(&conf);
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif


auto iter = cache.AllWorlds();
std::set<std::string> uniqueNames;
Expand Down Expand Up @@ -403,7 +433,15 @@ TEST_F(LocalCacheTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(MatchingWorlds))
createLocal6Worlds(conf);
createLocal3Worlds(conf);

#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
ignition::fuel_tools::LocalCache cache(&conf);
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif


WorldIdentifier am1;
am1.SetServer(conf.Servers().front());
Expand Down Expand Up @@ -437,7 +475,15 @@ TEST_F(LocalCacheTest, IGN_UTILS_TEST_DISABLED_ON_WIN32(MatchingWorld))
conf.SetCacheLocation(common::joinPaths(common::cwd(), "test_cache"));
createLocal6Worlds(conf);

#ifndef _WIN32
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
ignition::fuel_tools::LocalCache cache(&conf);
#ifndef _WIN32
# pragma GCC diagnostic pop
#endif


ignition::fuel_tools::ServerConfig srv1;
srv1.SetUrl(ignition::common::URI("http://localhost:8001/"));
Expand Down
3 changes: 2 additions & 1 deletion src/Model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@

#include "ignition/fuel_tools/Model.hh"
#include "ignition/fuel_tools/ModelIdentifier.hh"
#include "ignition/fuel_tools/ModelPrivate.hh"
#include "ignition/fuel_tools/Result.hh"

#include "ModelPrivate.hh"

namespace ignft = ignition::fuel_tools;
using namespace ignition;
using namespace ignft;
Expand Down
5 changes: 3 additions & 2 deletions src/ModelIter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@
#include "ignition/fuel_tools/Model.hh"
#include "ignition/fuel_tools/ModelIdentifier.hh"
#include "ignition/fuel_tools/ModelIter.hh"
#include "ignition/fuel_tools/ModelIterPrivate.hh"
#include "ignition/fuel_tools/ModelPrivate.hh"
#include "ignition/fuel_tools/RestClient.hh"

#include "ModelIterPrivate.hh"
#include "ModelPrivate.hh"

using namespace ignition;
using namespace fuel_tools;

Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions src/ModelIter_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

#include "ignition/fuel_tools/ClientConfig.hh"
#include "ignition/fuel_tools/ModelIter.hh"
#include "ignition/fuel_tools/ModelIterPrivate.hh"
#include "ignition/fuel_tools/ModelPrivate.hh"

#include "ModelIterPrivate.hh"
#include "ModelPrivate.hh"

using namespace ignition;
using namespace fuel_tools;
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion src/WorldIter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
#include "ignition/fuel_tools/JSONParser.hh"
#include "ignition/fuel_tools/WorldIdentifier.hh"
#include "ignition/fuel_tools/WorldIter.hh"
#include "ignition/fuel_tools/WorldIterPrivate.hh"
#include "ignition/fuel_tools/RestClient.hh"

#include "WorldIterPrivate.hh"

using namespace ignition;
using namespace fuel_tools;

Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion src/WorldIter_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

#include "ignition/fuel_tools/ClientConfig.hh"
#include "ignition/fuel_tools/WorldIter.hh"
#include "ignition/fuel_tools/WorldIterPrivate.hh"

#include "WorldIterPrivate.hh"

using namespace ignition;
using namespace fuel_tools;
Expand Down

0 comments on commit d892487

Please sign in to comment.