66 lines
1.7 KiB
C++
66 lines
1.7 KiB
C++
/**
|
|
* @file include/ActivOneApi/SubscriptionCapture.h
|
|
*
|
|
* @brief Header for subscription capture functions.
|
|
*/
|
|
|
|
#if (!defined ACTIV_ONE_API_SUBSCRIPTION_CAPTURE_H)
|
|
#define ACTIV_ONE_API_SUBSCRIPTION_CAPTURE_H
|
|
|
|
#include "ActivOneApi/External.h"
|
|
|
|
#include "ActivMiddleware/ActivBase/MessageBuilder.h"
|
|
|
|
//! Activ namespace.
|
|
namespace Activ
|
|
{
|
|
|
|
//! OneApi namespace.
|
|
namespace OneApi
|
|
{
|
|
|
|
class ISubscriptionHandler;
|
|
class Session;
|
|
|
|
/**
|
|
* @brief Serializes messages and information from a given Session required for replay.
|
|
*
|
|
* @tparam T Some message type.
|
|
*
|
|
* @param message The message to be serialized.
|
|
* @param messageBuilder A reference to a MessageBuilder to assist with serialization.
|
|
*
|
|
* @return False if the static buffer in @messageBuilder was too small.
|
|
*
|
|
* @throw StatusCodeException
|
|
*/
|
|
template <typename T>
|
|
ACTIV_TEMPLATE_API(ACTIV_ONE_API) bool Record(const T &message, MessageBuilder &messageBuilder);
|
|
|
|
/**
|
|
* @brief Replays a serialized Session.
|
|
*
|
|
* @param session The Session through which the Session is to be replayed.
|
|
* @param pBuffer A pointer to a buffer containing Session and message data.
|
|
* @param bufferLength The length in bytes of the buffer.
|
|
* @param subscriptionHandler A reference to an ISubscriptionHandler intended to invoke
|
|
* callbacks upon processing of replayed messages.
|
|
*
|
|
* @throw StatusCodeException
|
|
*/
|
|
ACTIV_ONE_API void Replay(Session &session, const void *pBuffer, const uint32_t bufferLength,
|
|
ISubscriptionHandler &subscriptionHandler);
|
|
|
|
/**
|
|
* @brief Resets the given Session's replay environment.
|
|
*
|
|
* @param session The Session whose replay environment is to be reset.
|
|
*/
|
|
ACTIV_ONE_API void ResetReplay(Session &session);
|
|
|
|
} // namespace OneApi
|
|
|
|
} // namespace Activ
|
|
|
|
#endif // ACTIV_ONE_API_SUBSCRIPTION_CAPTURE_H
|