Tesseract
Motion Planning Environment
|
Resource implementation for a local file. More...
#include <resource_locator.h>
Public Types | |
using | Ptr = std::shared_ptr< SimpleLocatedResource > |
using | ConstPtr = std::shared_ptr< const SimpleLocatedResource > |
Public Types inherited from tesseract_common::Resource | |
using | Ptr = std::shared_ptr< Resource > |
using | ConstPtr = std::shared_ptr< const Resource > |
Public Types inherited from tesseract_common::ResourceLocator | |
using | Ptr = std::shared_ptr< ResourceLocator > |
using | ConstPtr = std::shared_ptr< const ResourceLocator > |
Public Member Functions | |
SimpleLocatedResource ()=default | |
This is for boost serialization do not use directly. More... | |
SimpleLocatedResource (std::string url, std::string filename, ResourceLocator::ConstPtr parent=nullptr) | |
A generic resource. More... | |
~SimpleLocatedResource () override=default | |
SimpleLocatedResource (const SimpleLocatedResource &)=default | |
SimpleLocatedResource & | operator= (const SimpleLocatedResource &)=default |
SimpleLocatedResource (SimpleLocatedResource &&)=default | |
SimpleLocatedResource & | operator= (SimpleLocatedResource &&)=default |
bool | isFile () const override final |
Returns true if the located resource is a local file. More... | |
std::string | getUrl () const override final |
Get the original URL used to locate the file. More... | |
std::string | getFilePath () const override final |
Get the file path of the resource. Only valid if isFile() is true. More... | |
std::vector< uint8_t > | getResourceContents () const override final |
Get the resource as bytes. This function may block. More... | |
std::shared_ptr< std::istream > | getResourceContentStream () const override final |
Get the resource as a std::istream. This function and the returned stream may block. More... | |
Resource::Ptr | locateResource (const std::string &url) const override final |
Locate a resource based on a URL. More... | |
bool | operator== (const SimpleLocatedResource &rhs) const |
bool | operator!= (const SimpleLocatedResource &rhs) const |
Public Member Functions inherited from tesseract_common::Resource | |
virtual bool | isFile () const =0 |
Returns true if the located resource is a local file. More... | |
virtual std::string | getUrl () const =0 |
Get the original URL used to locate the file. More... | |
virtual std::string | getFilePath () const =0 |
Get the file path of the resource. Only valid if isFile() is true. More... | |
virtual std::vector< uint8_t > | getResourceContents () const =0 |
Get the resource as bytes. This function may block. More... | |
virtual std::shared_ptr< std::istream > | getResourceContentStream () const =0 |
Get the resource as a std::istream. This function and the returned stream may block. More... | |
bool | operator== (const Resource &rhs) const |
bool | operator!= (const Resource &rhs) const |
Public Member Functions inherited from tesseract_common::ResourceLocator | |
virtual | ~ResourceLocator ()=default |
virtual std::shared_ptr< Resource > | locateResource (const std::string &url) const =0 |
Locate a resource based on a URL. More... | |
bool | operator== (const ResourceLocator &rhs) const |
bool | operator!= (const ResourceLocator &rhs) const |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
std::string | url_ |
std::string | filename_ |
ResourceLocator::ConstPtr | parent_ |
Friends | |
class | boost::serialization::access |
Resource implementation for a local file.
using tesseract_common::SimpleLocatedResource::ConstPtr = std::shared_ptr<const SimpleLocatedResource> |
using tesseract_common::SimpleLocatedResource::Ptr = std::shared_ptr<SimpleLocatedResource> |
|
default |
This is for boost serialization do not use directly.
tesseract_common::SimpleLocatedResource::SimpleLocatedResource | ( | std::string | url, |
std::string | filename, | ||
ResourceLocator::ConstPtr | parent = nullptr |
||
) |
A generic resource.
url | The url to the resource |
filename | The file path to the resource |
parent | The locator used to locate the resource |
|
overridedefault |
|
default |
|
default |
|
finaloverridevirtual |
Get the file path of the resource. Only valid if isFile() is true.
Implements tesseract_common::Resource.
|
finaloverridevirtual |
Get the resource as bytes. This function may block.
Implements tesseract_common::Resource.
|
finaloverridevirtual |
Get the resource as a std::istream. This function and the returned stream may block.
Implements tesseract_common::Resource.
|
finaloverridevirtual |
Get the original URL used to locate the file.
Implements tesseract_common::Resource.
|
finaloverridevirtual |
Returns true if the located resource is a local file.
Implements tesseract_common::Resource.
|
finaloverridevirtual |
Locate a resource based on a URL.
url | The URL of the resource |
Implements tesseract_common::ResourceLocator.
bool tesseract_common::SimpleLocatedResource::operator!= | ( | const SimpleLocatedResource & | rhs | ) | const |
|
default |
|
default |
bool tesseract_common::SimpleLocatedResource::operator== | ( | const SimpleLocatedResource & | rhs | ) | const |
|
private |
|
friend |
|
private |
|
private |
|
private |