##

FuelModelDatabase.hh
Go to the documentation of this file.
/*
* Copyright (C) 2017 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_COMMON_FUELMODELDATABASE_HH_
#define GAZEBO_COMMON_FUELMODELDATABASE_HH_
#include <functional>
#include <memory>
#include <string>
#include <vector>
#include <ignition/fuel_tools/ClientConfig.hh>
#include <ignition/fuel_tools/ModelIdentifier.hh>
#include "gazebo/common/SingletonT.hh"
#include "gazebo/util/system.hh"
#define GZ_MODEL_MANIFEST_FILENAME "model.config"
#define GZ_MODEL_DB_MANIFEST_FILENAME "database.config"
GZ_SINGLETON_DECLARE(GZ_COMMON_VISIBLE, gazebo, common, FuelModelDatabase)
namespace gazebo
{
namespace common
{
class FuelModelDatabasePrivate;
class GZ_COMMON_VISIBLE FuelModelDatabase
: public SingletonT<FuelModelDatabase>
{
private: FuelModelDatabase();
private: virtual ~FuelModelDatabase();
public: std::vector<ignition::fuel_tools::ServerConfig> Servers() const;
public: virtual void Models(
const ignition::fuel_tools::ServerConfig &_server,
std::function <void (
const std::vector<ignition::fuel_tools::ModelIdentifier> &)>
&_func);
public: virtual std::vector<ignition::fuel_tools::ModelIdentifier>
Models(const ignition::fuel_tools::ServerConfig &_server) const;
public: std::string ModelFile(const std::string &_uri);
public: std::string ModelPath(const std::string &_uri,
const bool _forceDownload = false);
public: std::string CachedFilePath(const std::string &_uri);
private: std::unique_ptr<FuelModelDatabasePrivate> dataPtr;
private: friend class SingletonT<FuelModelDatabase>;
private: static FuelModelDatabase *myself;
};
}
}
#endif
gazebo
gazebo
Definition: FuelModelDatabase.hh:37
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
SingletonT
Singleton template class.
Definition: SingletonT.hh:33
common
common
Definition: FuelModelDatabase.hh:37
gazebo::common::FuelModelDatabase
Connects to an Igniiton Fuel model database, and has utility functions to find models.
Definition: FuelModelDatabase.hh:52
system.hh
GZ_SINGLETON_DECLARE
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition: SingletonT.hh:61
SingletonT.hh