Public bug reported:

Item is currently defined in ProviderBase.h:

namespace unity
{
namespace storage
{
namespace provider
{

...

struct UNITY_STORAGE_EXPORT Item
{
    std::string item_id;
    std::vector<std::string> parent_ids;
    std::string name;
    std::string etag;
    unity::storage::ItemType type;
    std::map<std::string, MetadataValue> metadata;
};
...

And, in UploadJob.h, we have a forward declaration:

namespace unity
{
namespace storage
{
namespace provider
{

struct Item;
...

That's inconvenient if I want to implement an uploader in its own
compilation unit because I can't return a unique_ptr<Item> from finish()
without having the definition of Item available:

// LocalUploadJob.cpp

#include "LocalUploadJob.h"  // (which includes UploadJob.h)

using namespace unity::storage::provider;

boost::future<Item> LocalUploadJob::finish()  <=== Error here because
Item is not defined.

That's a bit inconvenient. I can fix it by including ProviderBase.h, but
I shouldn't have to drag that in just so the code will compile.

I think it would be better to have Item defined in its own header and to
include that header in both ProviderBase.h and UploadJob.h, so the
definition is always available.

** Affects: storage-framework (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1668872

Title:
  provider::Item should have its own header file

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/storage-framework/+bug/1668872/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to