00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 #ifndef _task_factory_t_hh
00019 #define _task_factory_t_hh
00020 
00021 #include "BrokerC.h"
00022 #include "BrokerS.h"
00023 
00024 
00025 
00026 
00027 
00028 template <class T> class TaskFactoryTemplate :
00029     public POA_Broker::TaskFactory
00030 {
00031 
00032 public:
00033 
00034 
00035 
00036 
00037     TaskFactoryTemplate(const char *name)
00038     {
00039     };
00040 
00041 
00042 
00043 
00044     virtual ~TaskFactoryTemplate()
00045     {
00046     };
00047 
00048 
00049     Broker::Task_ptr CreateTask(const Broker::TaskParameters &tp)
00050         throw (CORBA::SystemException,
00051                Broker::DuplicateTaskParameter,
00052                Broker::InvalidTaskParameter,
00053                Broker::MissingTaskParameter)
00054     {
00055         T *retval;
00056         
00057         retval = new T(tp);
00058         return( retval->_this() );
00059     }
00060     
00061 };
00062 
00063 #endif