Tesseract
Motion Planning Environment
|
#include <resource_locator.h>
Public Member Functions | |
BytesResource ()=default | |
This is for boost serialization do not use directly. More... | |
BytesResource (std::string url, std::vector< uint8_t > bytes, ResourceLocator::ConstPtr parent=nullptr) | |
BytesResource (std::string url, const uint8_t *bytes, size_t bytes_len, ResourceLocator::ConstPtr parent=nullptr) | |
~BytesResource () override=default | |
BytesResource (const BytesResource &)=default | |
BytesResource & | operator= (const BytesResource &)=default |
BytesResource (BytesResource &&)=default | |
BytesResource & | operator= (BytesResource &&)=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 BytesResource &rhs) const |
bool | operator!= (const BytesResource &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::vector< uint8_t > | bytes_ |
ResourceLocator::ConstPtr | parent_ |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
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 > |
|
default |
This is for boost serialization do not use directly.
tesseract_common::BytesResource::BytesResource | ( | std::string | url, |
std::vector< uint8_t > | bytes, | ||
ResourceLocator::ConstPtr | parent = nullptr |
||
) |
tesseract_common::BytesResource::BytesResource | ( | std::string | url, |
const uint8_t * | bytes, | ||
size_t | bytes_len, | ||
ResourceLocator::ConstPtr | parent = nullptr |
||
) |
|
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::BytesResource::operator!= | ( | const BytesResource & | rhs | ) | const |
|
default |
|
default |
bool tesseract_common::BytesResource::operator== | ( | const BytesResource & | rhs | ) | const |
|
private |
|
friend |
|
private |
|
private |
|
private |