Tesseract
Motion Planning Environment
|
Represents resource data available from a file or url. More...
#include <resource_locator.h>
Public Types | |
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 | |
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) |
Friends | |
class | boost::serialization::access |
Represents resource data available from a file or url.
using tesseract_common::Resource::ConstPtr = std::shared_ptr<const Resource> |
using tesseract_common::Resource::Ptr = std::shared_ptr<Resource> |
|
pure virtual |
Get the file path of the resource. Only valid if isFile() is true.
Implemented in tesseract_common::SimpleLocatedResource, and tesseract_common::BytesResource.
|
pure virtual |
Get the resource as bytes. This function may block.
Implemented in tesseract_common::SimpleLocatedResource, and tesseract_common::BytesResource.
|
pure virtual |
Get the resource as a std::istream. This function and the returned stream may block.
Implemented in tesseract_common::SimpleLocatedResource, and tesseract_common::BytesResource.
|
pure virtual |
Get the original URL used to locate the file.
Implemented in tesseract_common::SimpleLocatedResource, and tesseract_common::BytesResource.
|
pure virtual |
Returns true if the located resource is a local file.
Implemented in tesseract_common::SimpleLocatedResource, and tesseract_common::BytesResource.
bool tesseract_common::Resource::operator!= | ( | const Resource & | rhs | ) | const |
bool tesseract_common::Resource::operator== | ( | const Resource & | rhs | ) | const |
|
private |
|
friend |