#include "Utilities\commondefs.hpp" #define __INPUT_RAWCSAMEVENT_CPP_ #include "RawCSAMEvent.hpp" using namespace Input; RAW_CSAM_EVENT_DECL RawCSAMEvent::RawCSAMEvent(void): ctrlKey(false), shiftKey(false), altKey(false), metaKey(false) { BOOST_LOG_TRIVIAL(trace) << CLASS_METHOD << " called"; parameter_strings parms; initialize(parms); // pick up the defaults } RAW_CSAM_EVENT_DECL RawCSAMEvent::RawCSAMEvent(const parameter_strings & parms): RawUIEvent(parms) { BOOST_LOG_TRIVIAL(trace) << CLASS_METHOD << " parameter_strings called"; initialize(parms); } RAW_CSAM_EVENT_DECL void RawCSAMEvent::initialize(const parameter_strings & parms) { ctrlKey = SET_PARM_OR_DFLT(parms, "ctrl", bool,false) ; shiftKey = SET_PARM_OR_DFLT(parms, "shift", bool,false) ; altKey = SET_PARM_OR_DFLT(parms, "alt", bool,false) ; metaKey = SET_PARM_OR_DFLT(parms, "meta", bool,false) ; } RAW_CSAM_EVENT_DECL bool RawCSAMEvent::operator==(RawCSAMEvent const& cmp) const { // does a fast compare if possible, then does value compares if that doesn't work return (this == &cmp) || ( RawUIEvent::operator==(cmp) && (ctrlKey == cmp.ctrlKey) && (altKey == cmp.altKey) && (shiftKey == cmp.shiftKey) && (metaKey == cmp.metaKey) ); } RAW_CSAM_EVENT_DECL RawCSAMEvent::~RawCSAMEvent(void) { BOOST_LOG_TRIVIAL(trace) << CLASS_METHOD << " called"; } template RAW_CSAM_EVENT_DECL void RawCSAMEvent::serialize(Archive &ar, const unsigned int version) { ar & boost::serialization::base_object(*this); //boost::serialization::void_cast_register( static_cast(nullptr) // , static_cast(nullptr)); //RawUIEvent::serialize(ar,version); ar & ctrlKey; ar & altKey; ar & shiftKey; ar & metaKey; } #ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable : 4244) #endif #include #include #include #include BOOST_CLASS_EXPORT_IMPLEMENT(Input::RawCSAMEvent); BOOST_CLASS_IMPLEMENTATION(Input::RawCSAMEvent,boost::serialization::object_serializable); BOOST_CLASS_TRACKING(Input::RawCSAMEvent,boost::serialization::track_never); // without the explicit instantiations below, the program will // fail to link for lack of instantiantiation of the above function // note: the following failed to fix link errors for vc 7.0 ! template RAW_CSAM_EVENT_DECL void RawCSAMEvent::serialize( boost::archive::text_iarchive & ar, const unsigned int file_version ); template RAW_CSAM_EVENT_DECL void RawCSAMEvent::serialize( boost::archive::text_oarchive & ar, const unsigned int file_version ); template RAW_CSAM_EVENT_DECL void RawCSAMEvent::serialize( boost::archive::binary_iarchive & ar, const unsigned int file_version ); template RAW_CSAM_EVENT_DECL void RawCSAMEvent::serialize( boost::archive::binary_oarchive & ar, const unsigned int file_version ); #ifdef BOOST_MSVC # pragma warning(pop) #endif