Files

85 lines
2.6 KiB
C++

/**
* @file include/ActivOneApi/Messages/UpdateMessage.h
*
* @brief Header for the UpdateMessage class.
*/
#if (!defined ACTIV_ONE_API_MESSAGES_UPDATE_MESSAGE_H)
#define ACTIV_ONE_API_MESSAGES_UPDATE_MESSAGE_H
#include "ActivOneApi/External.h"
#include "ActivOneApi/MapKey.h"
#include "ActivOneApi/TypeDefinitions.h"
#include "ActivMiddleware/Misc/CrtHelper.h"
//! Activ namespace.
namespace Activ
{
//! OneApi namespace.
namespace OneApi
{
class MessagePrivate;
//! UpdateMessage class.
class UpdateMessage : Boost::noncopyable
{
public:
/**
* @brief Constructor.
*
* @param dataSourceId
* @param symbologyId
* @param symbol
*/
UpdateMessage(const DataSourceId dataSourceId, const SymbologyId symbologyId, const String &symbol);
/**
* @brief Convert to a string.
*
* @return A long form string representation of the message contents.
*/
ACTIV_ONE_API String ToString() const;
const DataSourceId m_dataSourceId; ///< The DataSourceId of this message.
const SymbologyId m_symbologyId; ///< The SymbologyId of @a m_symbol.
const String & m_symbol; ///< The symbol.
TopicType m_topicType; ///< The topic type.
PermissionId m_permissionId; ///< The permission id.
UpdateId m_updateId; ///< The update id.
EventType m_eventType; ///< The event type.
UpdateType m_updateType; ///< The update type.
MapKey m_mapKey; ///< The map key.
TopicSubscriptionState m_topicSubscriptionState; ///< The topic subscription state.
const uint32_t * m_pSourceId; ///< The optional source id.
const uint64_t * m_pSequenceNumber; ///< The optional sequence number.
const timespec * m_pExchangeTransactionTimestamp; ///< The optional exchange transaction timestamp.
const timespec * m_pSourceTimestamp; ///< The optional source timestamp.
const timespec * m_pGatewayTimestamp; ///< The optional gateway timestamp.
const MessagePrivate * m_pPrivate; ///< @private
};
// ---------------------------------------------------------------------------------------------------------------------------------
inline UpdateMessage::UpdateMessage(const DataSourceId dataSourceId, const SymbologyId symbologyId, const String &symbol) :
m_dataSourceId(dataSourceId),
m_symbologyId(symbologyId),
m_symbol(symbol),
m_pSourceId(ACTIV_NULLPTR),
m_pSequenceNumber(ACTIV_NULLPTR),
m_pExchangeTransactionTimestamp(ACTIV_NULLPTR),
m_pSourceTimestamp(ACTIV_NULLPTR),
m_pGatewayTimestamp(ACTIV_NULLPTR)
{
}
} // namespace OneApi
} // namespace Activ
#endif // (!defined ACTIV_ONE_API_MESSAGES_UPDATE_MESSAGE_H)