82 lines
2.5 KiB
C++
82 lines
2.5 KiB
C++
/*
|
|
* Copyright Onix Solutions Limited [OnixS]. All rights reserved.
|
|
*
|
|
* This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
|
|
* and international copyright treaties.
|
|
*
|
|
* Access to and use of the software is governed by the terms of the applicable OnixS Software
|
|
* Services Agreement (the Agreement) and Customer end user license agreements granting
|
|
* a non-assignable, non-transferable and non-exclusive license to use the software
|
|
* for it's own data processing purposes under the terms defined in the Agreement.
|
|
*
|
|
* Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
|
|
* of this source code or associated reference material to any other location for further reproduction
|
|
* or redistribution, and any amendments to this copyright notice, are expressly prohibited.
|
|
*
|
|
* Any reproduction or redistribution for sale or hiring of the Software not in accordance with
|
|
* the terms of the Agreement is a violation of copyright law.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <OnixS/ICE/iMpact/MarketData/ABI.h>
|
|
#include <OnixS/ICE/iMpact/MarketData/HandlerState.h>
|
|
#include <OnixS/ICE/iMpact/MarketData/Types.h>
|
|
|
|
namespace OnixS { namespace ICE { namespace iMpact { namespace MarketData {
|
|
|
|
/// \brief Defines the interface through which the Handler
|
|
/// notifies subscribers about Handler state change events.
|
|
class ONIXS_ICE_IMPACT_MD_API HandlerStateChange
|
|
{
|
|
public:
|
|
/// Initialize intance.
|
|
HandlerStateChange(HandlerState newState, HandlerState oldState);
|
|
|
|
/// New State.
|
|
HandlerState newState() const;
|
|
|
|
/// Old state.
|
|
HandlerState oldState() const;
|
|
|
|
/// String representation.
|
|
std::string toString() const;
|
|
|
|
/// Appends string representation.
|
|
void toString(std::string&) const;
|
|
|
|
private:
|
|
HandlerState newState_;
|
|
HandlerState oldState_;
|
|
|
|
HandlerStateChange(const HandlerStateChange&);
|
|
|
|
HandlerStateChange& operator=(const HandlerStateChange&);
|
|
};
|
|
|
|
inline HandlerState HandlerStateChange::newState() const
|
|
{
|
|
return newState_;
|
|
}
|
|
|
|
inline HandlerState HandlerStateChange::oldState() const
|
|
{
|
|
return oldState_;
|
|
}
|
|
|
|
inline std::string HandlerStateChange::toString() const
|
|
{
|
|
std::string str;
|
|
|
|
toString(str);
|
|
|
|
return str;
|
|
}
|
|
|
|
/// Make it printable to formatted C++ I/O streams.
|
|
ONIXS_ICE_IMPACT_MD_API std::ostream& operator<<(std::ostream&, const HandlerStateChange&);
|
|
|
|
}}}} // namespace MarketData, iMpact, ICE, OnixS
|