59 lines
1.2 KiB
C++
Executable File
59 lines
1.2 KiB
C++
Executable File
/**
|
|
* Asset object
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Iuliana Ojog, SLSE, 2017-09-20
|
|
*/
|
|
#pragma once
|
|
|
|
#include "dds_handler.h"
|
|
#include "logger.h"
|
|
|
|
#include <DDS/Core/function_reply_object.h>
|
|
|
|
// Generated
|
|
#include <AssetManagement/asm_db.h>
|
|
|
|
namespace NGL
|
|
{
|
|
class INGLLogger;
|
|
}
|
|
|
|
namespace AssetManagement
|
|
{
|
|
class MainHandler;
|
|
|
|
class ObjectAsset
|
|
{
|
|
public:
|
|
explicit ObjectAsset(MainHandler *mainHandler);
|
|
~ObjectAsset();
|
|
|
|
Core::FunctionReplyObject createObject(const Asset &data);
|
|
Core::FunctionReplyObject updateObject(const Asset &data);
|
|
Core::FunctionReplyObject removeObject();
|
|
|
|
qint32 getId() const { return m_data.id(); }
|
|
QString getName() const { return QString::fromStdString(m_data.name()); }
|
|
const Asset &getData() const { return m_data; }
|
|
|
|
bool isValid() const;
|
|
bool isUsed() const;
|
|
Core::FunctionReplyObject setUsed(bool isUsed);
|
|
|
|
// convert methods
|
|
static Database::AsmAsset toDbData(const Asset &ddsData); // dds -> db
|
|
static Asset toDdsData(const Database::AsmAsset &dbData); // db -> dds
|
|
|
|
protected:
|
|
void onPublishData();
|
|
|
|
private:
|
|
MainHandler *m_mainHandler;
|
|
Asset m_data;
|
|
NGL::INGLLogger &m_logger;
|
|
|
|
};
|
|
}
|