JD2022-TU1/main/extern/UbiServices/custom/testsIntegration/notificationHelper.h

58 lines
2.3 KiB
C++

////////////////////////////////////////////////////////////////////////////////
// (c) Copyright, Ubisoft Entertainment Inc. || Created by Harbour //
////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "tests/config.h"
#if defined(US_SDK_LIGHT_MOBILE)
#error This file shall not be part of the solution
#endif
#include <ubiservices/core/configs/config.h>
#include <ubiservices/core/types/string.h>
#include <ubiservices/core/tasks/asyncResult.h>
#include <ubiservices/core/tasks/asyncResultBatch.h>
#include <ubiservices/services/notification/connectionInfo.h>
#include <ubiservices/services/notification/notificationCustom.h>
namespace US_NS {;
class Facade;
class ProfileId;
namespace NotificationHelper // TODO: Remove this namespace
{
class MultiConnection
{
public:
MultiConnection(Vector<Facade*>& facades, const Vector<String> types, const String& json);
void checkConnection(const bool canCheckSelf = false);
void filterConnectionInfo(const Map<ProfileId, Vector<ConnectionInfo> >& connectionMappings);
const AsyncResult<Map<ProfileId, Vector<ConnectionInfo> > > checkConnectionsNoResultCheck(uint32 facadeIndex, const bool canCheckSelf = false);
enum class SendType
{
UsingProfileId,
UsingConnectionInfo
};
void sendMessage(uint32 sourceId, const Vector<uint32>& targets, SendType type, String* out = NULL);
const AsyncResultBatch<ConnectionInfo, Empty> sendMessageNoResultCheckConnectionId(uint32 sourceId, const bool canSendSelf = false);
const AsyncResultBatch<ProfileId, Empty> sendMessageNoResultCheckProfileId(uint32 sourceId, const bool canSendSelf = false);
void sendUnsupportedMessage(uint32 sourceId, SendType useConnectionInfo, const bool canSendSelf = false);
void validatePopMsgData(const String& msgData);
void waitForMessageAndPop(uint32 sourceId, uint32 expectedMessageCount, String* out = NULL);
Vector<Facade*>& m_facades;
Vector<NotificationSource<NotificationCustom>::ListenerHandler> m_handlers;
Vector<ProfileId> m_profiles;
const Vector<String> m_testConnetionTypes;
const String m_jsonData;
Vector<ConnectionInfo> m_connectionInfos;
private:
US_CLASS_COPY_NOT_ALLOWED(MultiConnection);
};
}
};