Skip to content

Commit

Permalink
Traktor: Cleanup in database remote classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed May 31, 2024
1 parent 35454a4 commit 23a21f4
Show file tree
Hide file tree
Showing 51 changed files with 165 additions and 329 deletions.
7 changes: 2 additions & 5 deletions code/Database/Remote/IMessage.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#include "Database/Remote/IMessage.h"

namespace traktor
namespace traktor::db
{
namespace db
{

T_IMPLEMENT_RTTI_CLASS(L"traktor.db.IMessage", IMessage, ISerializable)

}
}
8 changes: 2 additions & 6 deletions code/Database/Remote/IMessage.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -18,10 +18,8 @@
# define T_DLLCLASS T_DLLIMPORT
#endif

namespace traktor
namespace traktor::db
{
namespace db
{

/*! Network message interface.
* \ingroup Database
Expand All @@ -31,6 +29,4 @@ class T_DLLCLASS IMessage : public ISerializable
T_RTTI_CLASS;
};

}
}

4 changes: 2 additions & 2 deletions code/Database/Remote/Messages/DbmCreateInstance.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -15,7 +15,7 @@ namespace traktor::db

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.db.DbmCreateInstance", 0, DbmCreateInstance, IMessage)

DbmCreateInstance::DbmCreateInstance(uint32_t handle, const std::wstring& name, const Guid& guid)
DbmCreateInstance::DbmCreateInstance(uint32_t handle, const std::wstring_view& name, const Guid& guid)
: m_handle(handle)
, m_name(name)
, m_guid(guid)
Expand Down
4 changes: 2 additions & 2 deletions code/Database/Remote/Messages/DbmCreateInstance.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -30,7 +30,7 @@ class T_DLLCLASS DbmCreateInstance : public IMessage
T_RTTI_CLASS;

public:
explicit DbmCreateInstance(uint32_t handle = 0, const std::wstring& name = L"", const Guid& guid = Guid());
explicit DbmCreateInstance(uint32_t handle = 0, const std::wstring_view& name = L"", const Guid& guid = Guid());

uint32_t getHandle() const { return m_handle; }

Expand Down
4 changes: 2 additions & 2 deletions code/Database/Remote/Messages/DbmOpen.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -15,7 +15,7 @@ namespace traktor::db

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.db.DbmOpen", 0, DbmOpen, IMessage)

DbmOpen::DbmOpen(const std::wstring& name)
DbmOpen::DbmOpen(const std::wstring_view& name)
: m_name(name)
{
}
Expand Down
4 changes: 2 additions & 2 deletions code/Database/Remote/Messages/DbmOpen.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -30,7 +30,7 @@ class T_DLLCLASS DbmOpen : public IMessage
T_RTTI_CLASS;

public:
explicit DbmOpen(const std::wstring& name = L"");
explicit DbmOpen(const std::wstring_view& name = L"");

const std::wstring& getName() const { return m_name; }

Expand Down
9 changes: 3 additions & 6 deletions code/Database/Remote/Messages/DbmOpenTransaction.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#include "Database/Remote/Messages/DbmOpenTransaction.h"
#include "Core/Serialization/ISerializer.h"
#include "Core/Serialization/Member.h"
#include "Database/Remote/Messages/DbmOpenTransaction.h"

namespace traktor
namespace traktor::db
{
namespace db
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.db.DbmOpenTransaction", 0, DbmOpenTransaction, IMessage)

Expand All @@ -27,5 +25,4 @@ void DbmOpenTransaction::serialize(ISerializer& s)
s >> Member< uint32_t >(L"handle", m_handle);
}

}
}
10 changes: 3 additions & 7 deletions code/Database/Remote/Messages/DbmOpenTransaction.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -18,10 +18,8 @@
# define T_DLLCLASS T_DLLIMPORT
#endif

namespace traktor
namespace traktor::db
{
namespace db
{

/*! Open instance transaction.
* \ingroup Database
Expand All @@ -31,7 +29,7 @@ class T_DLLCLASS DbmOpenTransaction : public IMessage
T_RTTI_CLASS;

public:
DbmOpenTransaction(uint32_t handle = 0);
explicit DbmOpenTransaction(uint32_t handle = 0);

uint32_t getHandle() const { return m_handle; }

Expand All @@ -41,6 +39,4 @@ class T_DLLCLASS DbmOpenTransaction : public IMessage
uint32_t m_handle;
};

}
}

7 changes: 2 additions & 5 deletions code/Database/Remote/Messages/DbmPutEvent.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -12,10 +12,8 @@
#include "Database/IEvent.h"
#include "Database/Remote/Messages/DbmPutEvent.h"

namespace traktor
namespace traktor::db
{
namespace db
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.db.DbmPutEvent", 0, DbmPutEvent, IMessage)

Expand All @@ -31,5 +29,4 @@ void DbmPutEvent::serialize(ISerializer& s)
s >> MemberRef< const IEvent >(L"event", m_event);
}

}
}
10 changes: 3 additions & 7 deletions code/Database/Remote/Messages/DbmPutEvent.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -19,10 +19,8 @@
# define T_DLLCLASS T_DLLIMPORT
#endif

namespace traktor
namespace traktor::db
{
namespace db
{

class IEvent;

Expand All @@ -34,7 +32,7 @@ class T_DLLCLASS DbmPutEvent : public IMessage
T_RTTI_CLASS;

public:
DbmPutEvent(uint32_t handle = 0, const IEvent* event = 0);
explicit DbmPutEvent(uint32_t handle = 0, const IEvent* event = 0);

uint32_t getHandle() const { return m_handle; }

Expand All @@ -47,6 +45,4 @@ class T_DLLCLASS DbmPutEvent : public IMessage
Ref< const IEvent > m_event;
};

}
}

11 changes: 4 additions & 7 deletions code/Database/Remote/Messages/DbmReadData.cpp
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#include "Database/Remote/Messages/DbmReadData.h"
#include "Core/Serialization/ISerializer.h"
#include "Core/Serialization/Member.h"
#include "Database/Remote/Messages/DbmReadData.h"

namespace traktor
namespace traktor::db
{
namespace db
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.db.DbmReadData", 0, DbmReadData, IMessage)

DbmReadData::DbmReadData(uint32_t handle, const std::wstring& name)
DbmReadData::DbmReadData(uint32_t handle, const std::wstring_view& name)
: m_handle(handle)
, m_name(name)
{
Expand All @@ -29,5 +27,4 @@ void DbmReadData::serialize(ISerializer& s)
s >> Member< std::wstring >(L"name", m_name);
}

}
}
10 changes: 3 additions & 7 deletions code/Database/Remote/Messages/DbmReadData.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -19,10 +19,8 @@
# define T_DLLCLASS T_DLLIMPORT
#endif

namespace traktor
namespace traktor::db
{
namespace db
{

/*! Read instance data.
* \ingroup Database
Expand All @@ -32,7 +30,7 @@ class T_DLLCLASS DbmReadData : public IMessage
T_RTTI_CLASS;

public:
DbmReadData(uint32_t handle = 0, const std::wstring& name = L"");
explicit DbmReadData(uint32_t handle = 0, const std::wstring_view& name = L"");

uint32_t getHandle() const { return m_handle; }

Expand All @@ -45,6 +43,4 @@ class T_DLLCLASS DbmReadData : public IMessage
std::wstring m_name;
};

}
}

9 changes: 3 additions & 6 deletions code/Database/Remote/Messages/DbmReadObject.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#include "Database/Remote/Messages/DbmReadObject.h"
#include "Core/Serialization/ISerializer.h"
#include "Core/Serialization/Member.h"
#include "Database/Remote/Messages/DbmReadObject.h"

namespace traktor
namespace traktor::db
{
namespace db
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.db.DbmReadObject", 0, DbmReadObject, IMessage)

Expand All @@ -27,5 +25,4 @@ void DbmReadObject::serialize(ISerializer& s)
s >> Member< uint32_t >(L"handle", m_handle);
}

}
}
10 changes: 3 additions & 7 deletions code/Database/Remote/Messages/DbmReadObject.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* TRAKTOR
* Copyright (c) 2022 Anders Pistol.
* Copyright (c) 2022-2024 Anders Pistol.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -18,10 +18,8 @@
# define T_DLLCLASS T_DLLIMPORT
#endif

namespace traktor
namespace traktor::db
{
namespace db
{

/*! Read instance object.
* \ingroup Database
Expand All @@ -31,7 +29,7 @@ class T_DLLCLASS DbmReadObject : public IMessage
T_RTTI_CLASS;

public:
DbmReadObject(uint32_t handle = 0);
explicit DbmReadObject(uint32_t handle = 0);

uint32_t getHandle() const { return m_handle; }

Expand All @@ -41,6 +39,4 @@ class T_DLLCLASS DbmReadObject : public IMessage
uint32_t m_handle;
};

}
}

Loading

0 comments on commit 23a21f4

Please sign in to comment.