Skip to content

Commit

Permalink
Renamed "MsgMgr" class to be "ToolsMsgMgr".
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Nov 5, 2024
1 parent 12826dc commit e500f37
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 77 deletions.
2 changes: 1 addition & 1 deletion app/cc_view/src/GuiAppMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class GuiAppMgr : public QObject
RecvListMode_ApplyFilter = 1U << 3
};

using MsgType = MsgMgr::MsgType ;
using MsgType = ToolsMsgMgr::MsgType;
using ActionPtr = std::shared_ptr<QAction>;
using ListOfPluginInfos = PluginMgr::ListOfPluginInfos;
using MessagesList = ToolsProtocol::MessagesList;
Expand Down
2 changes: 1 addition & 1 deletion app/cc_view/src/MsgMgrG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@

#include "MsgMgrG.h"

template class cc_tools_qt::ToolsStaticSingleton<cc_tools_qt::MsgMgr>;
template class cc_tools_qt::ToolsStaticSingleton<cc_tools_qt::ToolsMsgMgr>;

6 changes: 3 additions & 3 deletions app/cc_view/src/MsgMgrG.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
#pragma once

#include "cc_tools_qt/ToolsStaticSingleton.h"
#include "cc_tools_qt/MsgMgr.h"
#include "cc_tools_qt/ToolsMsgMgr.h"

namespace cc_tools_qt
{

using MsgMgrG = ToolsStaticSingleton<MsgMgr>;
using MsgMgrG = ToolsStaticSingleton<ToolsMsgMgr>;

} // namespace cc_tools_qt

extern template class cc_tools_qt::ToolsStaticSingleton<cc_tools_qt::MsgMgr>;
extern template class cc_tools_qt::ToolsStaticSingleton<cc_tools_qt::ToolsMsgMgr>;



Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@
namespace cc_tools_qt
{

class MsgMgrImpl;
class CC_TOOLS_API MsgMgr
class ToolsMsgMgrImpl;
class CC_TOOLS_API ToolsMsgMgr
{
public:
typedef std::list<ToolsMessagePtr> AllMessages;
typedef ToolsProtocol::MessagesList MessagesList;
using MessagesList = ToolsProtocol::MessagesList;
using MsgType = ToolsMessage::Type;

typedef ToolsMessage::Type MsgType;

MsgMgr();
~MsgMgr() noexcept;
ToolsMsgMgr();
~ToolsMsgMgr() noexcept;

void start();
void stop();
Expand All @@ -58,23 +56,23 @@ class CC_TOOLS_API MsgMgr

void sendMsgs(MessagesList&& msgs);

const AllMessages& getAllMsgs() const;
const MessagesList& getAllMsgs() const;
void addMsgs(const MessagesList& msgs, bool reportAdded = true);

void setSocket(ToolsSocketPtr socket);
void setProtocol(ToolsProtocolPtr protocol);
void addFilter(ToolsFilterPtr filter);

typedef std::function<void (ToolsMessagePtr msg)> MsgAddedCallbackFunc;
typedef std::function<void (const QString& error)> ErrorReportCallbackFunc;
typedef std::function<void (bool connected)> SocketConnectionStatusReportCallbackFunc;
using MsgAddedCallbackFunc = std::function<void (ToolsMessagePtr msg)>;
using ErrorReportCallbackFunc = std::function<void (const QString& error)>;
using SocketConnectionStatusReportCallbackFunc = std::function<void (bool connected)>;

void setMsgAddedCallbackFunc(MsgAddedCallbackFunc&& func);
void setErrorReportCallbackFunc(ErrorReportCallbackFunc&& func);
void setSocketConnectionStatusReportCallbackFunc(SocketConnectionStatusReportCallbackFunc&& func);

private:
std::unique_ptr<MsgMgrImpl> m_impl;
std::unique_ptr<ToolsMsgMgrImpl> m_impl;
};

} // namespace cc_tools_qt
4 changes: 2 additions & 2 deletions lib/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ function (lib_tools)
MsgFileMgr.cpp
MsgSendMgr.cpp
MsgSendMgrImpl.cpp
MsgMgr.cpp
MsgMgrImpl.cpp
ToolsDataInfo.cpp
ToolsField.cpp
ToolsFieldHandler.cpp
ToolsFilter.cpp
ToolsFrame.cpp
ToolsMessage.cpp
ToolsMsgFactory.cpp
ToolsMsgMgr.cpp
ToolsMsgMgrImpl.cpp
ToolsPlugin.cpp
ToolsProtocol.cpp
ToolsSocket.cpp
Expand Down
46 changes: 23 additions & 23 deletions lib/src/MsgMgr.cpp → lib/src/ToolsMsgMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,106 +16,106 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.


#include "cc_tools_qt/MsgMgr.h"
#include "cc_tools_qt/ToolsMsgMgr.h"

#include "MsgMgrImpl.h"
#include "ToolsMsgMgrImpl.h"

namespace cc_tools_qt
{

MsgMgr::MsgMgr()
: m_impl(new MsgMgrImpl())
ToolsMsgMgr::ToolsMsgMgr()
: m_impl(new ToolsMsgMgrImpl())
{
}

MsgMgr::~MsgMgr() noexcept = default;
ToolsMsgMgr::~ToolsMsgMgr() noexcept = default;

void MsgMgr::start()
void ToolsMsgMgr::start()
{
m_impl->start();
}

void MsgMgr::stop()
void ToolsMsgMgr::stop()
{
m_impl->stop();
}

void MsgMgr::clear()
void ToolsMsgMgr::clear()
{
m_impl->clear();
}

ToolsSocketPtr MsgMgr::getSocket() const
ToolsSocketPtr ToolsMsgMgr::getSocket() const
{
return m_impl->getSocket();
}

ToolsProtocolPtr MsgMgr::getProtocol() const
ToolsProtocolPtr ToolsMsgMgr::getProtocol() const
{
return m_impl->getProtocol();
}

void MsgMgr::setRecvEnabled(bool enabled)
void ToolsMsgMgr::setRecvEnabled(bool enabled)
{
m_impl->setRecvEnabled(enabled);
}

void MsgMgr::deleteMsg(ToolsMessagePtr msg)
void ToolsMsgMgr::deleteMsg(ToolsMessagePtr msg)
{
m_impl->deleteMsg(std::move(msg));
}

void MsgMgr::deleteMsgs(const MessagesList& msgs)
void ToolsMsgMgr::deleteMsgs(const MessagesList& msgs)
{
m_impl->deleteMsgs(msgs);
}

void MsgMgr::deleteAllMsgs()
void ToolsMsgMgr::deleteAllMsgs()
{
m_impl->deleteAllMsgs();
}

void MsgMgr::sendMsgs(MessagesList&& msgs)
void ToolsMsgMgr::sendMsgs(MessagesList&& msgs)
{
m_impl->sendMsgs(std::move(msgs));
}

const MsgMgr::AllMessages& MsgMgr::getAllMsgs() const
const ToolsMsgMgr::MessagesList& ToolsMsgMgr::getAllMsgs() const
{
return m_impl->getAllMsgs();
}

void MsgMgr::addMsgs(const MessagesList& msgs, bool reportAdded)
void ToolsMsgMgr::addMsgs(const MessagesList& msgs, bool reportAdded)
{
m_impl->addMsgs(msgs, reportAdded);
}

void MsgMgr::setSocket(ToolsSocketPtr socket)
void ToolsMsgMgr::setSocket(ToolsSocketPtr socket)
{
m_impl->setSocket(std::move(socket));
}

void MsgMgr::setProtocol(ToolsProtocolPtr protocol)
void ToolsMsgMgr::setProtocol(ToolsProtocolPtr protocol)
{
m_impl->setProtocol(std::move(protocol));
}

void MsgMgr::addFilter(ToolsFilterPtr filter)
void ToolsMsgMgr::addFilter(ToolsFilterPtr filter)
{
m_impl->addFilter(std::move(filter));
}

void MsgMgr::setMsgAddedCallbackFunc(MsgAddedCallbackFunc&& func)
void ToolsMsgMgr::setMsgAddedCallbackFunc(MsgAddedCallbackFunc&& func)
{
m_impl->setMsgAddedCallbackFunc(std::move(func));
}

void MsgMgr::setErrorReportCallbackFunc(ErrorReportCallbackFunc&& func)
void ToolsMsgMgr::setErrorReportCallbackFunc(ErrorReportCallbackFunc&& func)
{
m_impl->setErrorReportCallbackFunc(std::move(func));
}

void MsgMgr::setSocketConnectionStatusReportCallbackFunc(
void ToolsMsgMgr::setSocketConnectionStatusReportCallbackFunc(
SocketConnectionStatusReportCallbackFunc&& func)
{
m_impl->setSocketConnectionStatusReportCallbackFunc(std::move(func));
Expand Down
Loading

0 comments on commit e500f37

Please sign in to comment.