Skip to content

Commit

Permalink
Traktor: Cleanup in runtime target event classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
apistol78 committed May 31, 2024
1 parent 186ce0b commit 41f1107
Show file tree
Hide file tree
Showing 30 changed files with 94 additions and 198 deletions.
11 changes: 4 additions & 7 deletions code/Runtime/Target/CommandEvent.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 "Runtime/Target/CommandEvent.h"
#include "Core/Serialization/ISerializer.h"
#include "Core/Serialization/Member.h"
#include "Runtime/Target/CommandEvent.h"

namespace traktor
namespace traktor::runtime
{
namespace runtime
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.runtime.CommandEvent", 0, CommandEvent, IRemoteEvent)

CommandEvent::CommandEvent(const std::wstring& function)
CommandEvent::CommandEvent(const std::wstring_view& function)
: m_function(function)
{
}
Expand All @@ -32,5 +30,4 @@ void CommandEvent::serialize(ISerializer& s)
s >> Member< std::wstring >(L"function", m_function);
}

}
}
9 changes: 3 additions & 6 deletions code/Runtime/Target/CommandEvent.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::runtime
{
namespace runtime
{

/*! Application generic command events.
* \ingroup Runtime
Expand All @@ -37,7 +35,7 @@ class T_DLLCLASS CommandEvent : public IRemoteEvent
public:
CommandEvent() = default;

explicit CommandEvent(const std::wstring& function);
explicit CommandEvent(const std::wstring_view& function);

const std::wstring& getFunction() const;

Expand All @@ -47,5 +45,4 @@ class T_DLLCLASS CommandEvent : public IRemoteEvent
std::wstring m_function;
};

}
}
7 changes: 2 additions & 5 deletions code/Runtime/Target/IRemoteEvent.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 "Runtime/Target/IRemoteEvent.h"

namespace traktor
namespace traktor::runtime
{
namespace runtime
{

T_IMPLEMENT_RTTI_CLASS(L"traktor.runtime.IRemoteEvent", IRemoteEvent, ISerializable)

}
}
10 changes: 3 additions & 7 deletions code/Runtime/Target/IRemoteEvent.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,19 +18,15 @@
# define T_DLLCLASS T_DLLIMPORT
#endif

namespace traktor
namespace traktor::runtime
{
namespace runtime
{

/*! \brief
/*!
* \ingroup Runtime
*/
class T_DLLCLASS IRemoteEvent : public ISerializable
{
T_RTTI_CLASS;
};

}
}

9 changes: 3 additions & 6 deletions code/Runtime/Target/ScriptDebuggerBreadcrumbs.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 "Runtime/Target/ScriptDebuggerBreadcrumbs.h"
#include "Core/Serialization/ISerializer.h"
#include "Core/Serialization/MemberAlignedVector.h"
#include "Runtime/Target/ScriptDebuggerBreadcrumbs.h"

namespace traktor
namespace traktor::runtime
{
namespace runtime
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.runtime.ScriptDebuggerBreadcrumbs", 0, ScriptDebuggerBreadcrumbs, ISerializable)

Expand All @@ -27,5 +25,4 @@ void ScriptDebuggerBreadcrumbs::serialize(ISerializer& s)
s >> MemberAlignedVector< uint32_t >(L"breadcrumbs", m_breadcrumbs);
}

}
}
14 changes: 5 additions & 9 deletions code/Runtime/Target/ScriptDebuggerBreadcrumbs.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,17 +19,15 @@
# define T_DLLCLASS T_DLLIMPORT
#endif

namespace traktor
namespace traktor::script
{
namespace script
{

class Variable;

}
}

namespace runtime
{
namespace traktor::runtime
{

/*! Response from running target when breadcrumbs has been captured.
* \ingroup Runtime
Expand All @@ -51,6 +49,4 @@ class T_DLLCLASS ScriptDebuggerBreadcrumbs : public ISerializable
AlignedVector< uint32_t > m_breadcrumbs;
};

}
}

9 changes: 3 additions & 6 deletions code/Runtime/Target/ScriptDebuggerBreakpoint.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 "Runtime/Target/ScriptDebuggerBreakpoint.h"
#include "Core/Serialization/ISerializer.h"
#include "Core/Serialization/Member.h"
#include "Runtime/Target/ScriptDebuggerBreakpoint.h"

namespace traktor
namespace traktor::runtime
{
namespace runtime
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.runtime.ScriptDebuggerBreakpoint", 0, ScriptDebuggerBreakpoint, ISerializable)

Expand All @@ -31,5 +29,4 @@ void ScriptDebuggerBreakpoint::serialize(ISerializer& s)
s >> Member< uint32_t >(L"lineNumber", m_lineNumber);
}

}
}
8 changes: 2 additions & 6 deletions code/Runtime/Target/ScriptDebuggerBreakpoint.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::runtime
{
namespace runtime
{

/*! Add or remove script breakpoint on running target.
* \ingroup Runtime
Expand Down Expand Up @@ -50,6 +48,4 @@ class T_DLLCLASS ScriptDebuggerBreakpoint : public ISerializable
uint32_t m_lineNumber = 0;
};

}
}

9 changes: 3 additions & 6 deletions code/Runtime/Target/ScriptDebuggerControl.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
/*
* 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 "Runtime/Target/ScriptDebuggerControl.h"
#include "Core/Serialization/ISerializer.h"
#include "Core/Serialization/Member.h"
#include "Core/Serialization/MemberEnum.h"
#include "Runtime/Target/ScriptDebuggerControl.h"

namespace traktor
namespace traktor::runtime
{
namespace runtime
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.runtime.ScriptDebuggerControl", 0, ScriptDebuggerControl, ISerializable)

Expand All @@ -36,5 +34,4 @@ void ScriptDebuggerControl::serialize(ISerializer& s)
s >> Member< uint32_t >(L"param", m_param);
}

}
}
8 changes: 2 additions & 6 deletions code/Runtime/Target/ScriptDebuggerControl.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::runtime
{
namespace runtime
{

/*! Control debugger on running target.
* \ingroup Runtime
Expand Down Expand Up @@ -61,6 +59,4 @@ class T_DLLCLASS ScriptDebuggerControl : public ISerializable
uint32_t m_param = 0;
};

}
}

9 changes: 3 additions & 6 deletions code/Runtime/Target/ScriptDebuggerLocals.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
/*
* 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 "Runtime/Target/ScriptDebuggerLocals.h"
#include "Core/Serialization/ISerializer.h"
#include "Core/Serialization/MemberRefArray.h"
#include "Runtime/Target/ScriptDebuggerLocals.h"
#include "Script/Variable.h"

namespace traktor
namespace traktor::runtime
{
namespace runtime
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.runtime.ScriptDebuggerLocals", 0, ScriptDebuggerLocals, ISerializable)

Expand All @@ -28,5 +26,4 @@ void ScriptDebuggerLocals::serialize(ISerializer& s)
s >> MemberRefArray< script::Variable >(L"locals", m_locals);
}

}
}
14 changes: 5 additions & 9 deletions code/Runtime/Target/ScriptDebuggerLocals.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,17 +19,15 @@
# define T_DLLCLASS T_DLLIMPORT
#endif

namespace traktor
namespace traktor::script
{
namespace script
{

class Variable;

}
}

namespace runtime
{
namespace traktor::runtime
{

/*! Response from running target when locals has been captured.
* \ingroup Runtime
Expand All @@ -51,6 +49,4 @@ class T_DLLCLASS ScriptDebuggerLocals : public ISerializable
RefArray< script::Variable > m_locals;
};

}
}

9 changes: 3 additions & 6 deletions code/Runtime/Target/ScriptDebuggerStackFrame.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
/*
* 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 "Runtime/Target/ScriptDebuggerStackFrame.h"
#include "Core/Serialization/ISerializer.h"
#include "Core/Serialization/MemberRef.h"
#include "Runtime/Target/ScriptDebuggerStackFrame.h"
#include "Script/StackFrame.h"

namespace traktor
namespace traktor::runtime
{
namespace runtime
{

T_IMPLEMENT_RTTI_FACTORY_CLASS(L"traktor.runtime.ScriptDebuggerStackFrame", 0, ScriptDebuggerStackFrame, ISerializable)

Expand All @@ -28,5 +26,4 @@ void ScriptDebuggerStackFrame::serialize(ISerializer& s)
s >> MemberRef< script::StackFrame >(L"frame", m_frame);
}

}
}
Loading

0 comments on commit 41f1107

Please sign in to comment.