00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef COH_TYPED_EXECUTABLE_CLASS_HPP
00017 #define COH_TYPED_EXECUTABLE_CLASS_HPP
00018
00019 #include "coherence/lang/compatibility.hpp"
00020
00021 #include "coherence/lang/ExecutableClass.hpp"
00022 #include "coherence/lang/String.hpp"
00023 #include "coherence/lang/TypedClass.hpp"
00024
00025
00026
00027 COH_OPEN_NAMESPACE2(coherence,lang)
00028
00029
00030
00031
00032
00033
00034
00035 template<class T, class C> class TypedExecutableClass
00036 : public class_spec<TypedExecutableClass<T, C>,
00037 extends<C>,
00038 implements<ExecutableClass> >
00039 {
00040 friend class factory<TypedExecutableClass<T, C> >;
00041
00042
00043
00044 public:
00045
00046
00047
00048 typedef T Type;
00049
00050
00051
00052
00053 protected:
00054
00055
00056
00057
00058
00059 TypedExecutableClass<T, C>()
00060 {
00061 }
00062
00063 private:
00064
00065
00066
00067 TypedExecutableClass<T, C>(const TypedExecutableClass<T, C>&);
00068
00069
00070
00071
00072 public:
00073
00074
00075
00076 virtual void execute(ObjectArray::View vasArg) const
00077 {
00078 T::main(vasArg);
00079 }
00080
00081
00082
00083
00084 public:
00085
00086
00087
00088 virtual TypedHandle<const String> toString() const
00089 {
00090 return COH_TO_STRING("TypedExecutableClass<" << Class::getName() << ">");
00091 }
00092 };
00093
00094 COH_CLOSE_NAMESPACE2
00095
00096 #endif // COH_TYPED_EXECUTABLE_CLASS_HPP