![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2010 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: $ $Revision: 104239 $ $State: $ 00007 *******************************************************************************/ 00008 00012 00013 #pragma once 00014 00015 #include <vrvCore/vrvCore.h> 00016 #include <vrvControl/vrvControlToolkitDataTypes.h> 00017 00018 #include <vrvCore/DtUniqueID.h> 00019 #include <boost/function.hpp> 00020 00021 namespace makVrv 00022 { 00023 class DtDe; 00024 00027 class DT_DLL_VRVCORE DtVrvCommand 00028 { 00029 public: 00030 DtVrvCommand(); 00031 virtual ~DtVrvCommand(); 00032 00033 virtual vrvControlToolkit::DtVrvControlTypeEnum commandType(); 00034 00035 virtual void execute(DtDe& de)=0; 00036 00037 protected: 00038 vrvControlToolkit::DtVrvControlTypeEnum myCommandType; 00039 }; 00040 00043 typedef boost::function<DtUniqueID (const std::string&)> GlobalIdConvertFunc; 00044 00047 class DT_DLL_VRVCORE DtVrvCommandCreator 00048 { 00049 public: 00050 DtVrvCommandCreator(GlobalIdConvertFunc func); 00051 virtual ~DtVrvCommandCreator() {} 00052 00053 virtual DtVrvCommand* create(vrvControlToolkit::DtVrvControl_v1* control)=0; 00054 00055 protected: 00056 GlobalIdConvertFunc myConvertGlobablIdFunc; 00057 }; 00058 00061 class DT_DLL_VRVCORE DtVrvBaseCommandCreatorSeed 00062 { 00063 public: 00064 DtVrvBaseCommandCreatorSeed() {} 00065 virtual ~DtVrvBaseCommandCreatorSeed() {} 00066 00067 virtual DtVrvCommandCreator* create(GlobalIdConvertFunc func)=0; 00068 }; 00069 00072 template <class CommandCreatorType> 00073 class DtVrvCommandCreatorSeed : public DtVrvBaseCommandCreatorSeed 00074 { 00075 public: 00076 DtVrvCommandCreatorSeed() {} 00077 virtual ~DtVrvCommandCreatorSeed() {} 00078 00079 virtual DtVrvCommandCreator* create(GlobalIdConvertFunc func); 00080 }; 00081 00082 template <class CommandCreatorType> 00083 DtVrvCommandCreator* DtVrvCommandCreatorSeed<CommandCreatorType>::create(GlobalIdConvertFunc func) 00084 { 00085 return new CommandCreatorType(func); 00086 } 00087 00088 } //makVrv::