#include "Utilities\commondefs.hpp" #define __INPUT_RAW_EVENT_FACTORY_CPP_ #include "RawEventFactory.hpp" #include "AllRawEvents.hpp" // pull in all event types #include "EMMA\AllRawEMMAEvents.hpp" // pull in all EMMA event types //#include "Input\EventSerialization.hpp" typedef std::stringstream calsim_istream; typedef std::stringstream calsim_ostream; typedef boost::archive::text_iarchive calsim_iarchive; typedef boost::archive::text_oarchive calsim_oarchive; #define REGISTER_FACTORY_TYPE(clzName) \ register_new_ptr(reFactory, #clzName) #define REGISTER_EMMA_FACTORY_TYPE(clzName) \ register_new_ptr(reFactory, #clzName) using namespace Input; RAW_EVENT_FACTORY_DECL RawEventFactory * RawEventFactory::theFactory() { static RawEventFactory *fact = new RawEventFactory(); return fact; } RAW_EVENT_FACTORY_DECL RawEventFactory::RawEventFactory(void) { // Setup instance as though brand new //register_new_ptr(evFactory,"RawEvent"); REGISTER_FACTORY_TYPE(RawEvent); REGISTER_FACTORY_TYPE(RawCompositionEvent); REGISTER_FACTORY_TYPE(RawCSAMEvent); REGISTER_FACTORY_TYPE(RawEMMAEvent); REGISTER_FACTORY_TYPE(RawFocusEvent); REGISTER_FACTORY_TYPE(RawKeyboardEvent); REGISTER_FACTORY_TYPE(RawMouseEvent); REGISTER_FACTORY_TYPE(RawPointerEvent); REGISTER_FACTORY_TYPE(RawTouchEvent); REGISTER_FACTORY_TYPE(RawUIEvent); REGISTER_FACTORY_TYPE(RawWheelEvent); //REGISTER_EMMA_FACTORY_TYPE(EMMA); //REGISTER_EMMA_FACTORY_TYPE(Annotation); //REGISTER_EMMA_FACTORY_TYPE(Container); //REGISTER_EMMA_FACTORY_TYPE(Derivation); //REGISTER_EMMA_FACTORY_TYPE(Endpoint); //REGISTER_EMMA_FACTORY_TYPE(Grammar); //REGISTER_EMMA_FACTORY_TYPE(Info); //REGISTER_EMMA_FACTORY_TYPE(Interpretation); //REGISTER_EMMA_FACTORY_TYPE(Lattice); //REGISTER_EMMA_FACTORY_TYPE(Location); //REGISTER_EMMA_FACTORY_TYPE(Model); //REGISTER_EMMA_FACTORY_TYPE(Parameter); //REGISTER_EMMA_FACTORY_TYPE(ProcessModel); } RAW_EVENT_FACTORY_DECL RawEventFactory::~RawEventFactory(void) { } RAW_EVENT_FACTORY_DECL Input::RawEventFactory::factory_return_type Input::RawEventFactory::create(const std::string & evType, const parameter_strings &parms) { return RawEventFactory::theFactory()->reFactory[evType](parms); } RAW_EVENT_FACTORY_DECL void Input::RawEventFactory::registerForSerialization() { calsim_ostream iostr; calsim_oarchive oa(iostr); // register all the derived event types to insure proper serialization through pointers // registering with any archive registers for all archives. So this registration will work // even though we don't use this archive oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); oa.register_type(); }