00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef COH_SYSTEM_POF_CONTEXT_HPP
00017 #define COH_SYSTEM_POF_CONTEXT_HPP
00018
00019 #include "coherence/lang.ns"
00020
00021 #include "coherence/io/pof/PofAnnotationSerializer.hpp"
00022 #include "coherence/io/pof/PortableObjectSerializer.hpp"
00023 #include "coherence/io/pof/SimplePofContext.hpp"
00024 #include "coherence/io/pof/TypedSerializer.hpp"
00025
00026 COH_OPEN_NAMESPACE3(coherence,io,pof)
00027
00028
00029
00030
00031
00032
00033
00034
00035 class COH_EXPORT SystemPofContext
00036 : public class_spec<SystemPofContext,
00037 extends<SimplePofContext> >
00038 {
00039 friend class factory<SystemPofContext>;
00040
00041
00042
00043 protected:
00044
00045
00046
00047 using this_spec::create;
00048
00049 private:
00050
00051
00052
00053 SystemPofContext();
00054
00055
00056 public:
00057
00058
00059
00060
00061
00062 static Handle getInstance();
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072 static void main(ObjectArray::View vasArg);
00073 };
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086 #define COH_REGISTER_POF_SERIALIZER(POF_TYPE_ID, CLASS, POF_SERIALIZER) \
00087 COH_STATIC_INIT(coherence::io::pof::SystemPofContext::getInstance()-> \
00088 registerUserType(POF_TYPE_ID, \
00089 coherence::lang::SystemClassLoader::getInstance()-> \
00090 registerClass(CLASS), POF_SERIALIZER))
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100 #define COH_REGISTER_ONLY_PORTABLE_CLASS(POF_TYPE_ID, TYPE) \
00101 COH_STATIC_INIT_EX(1, coherence::io::pof::SystemPofContext::getInstance()-> \
00102 registerUserType(POF_TYPE_ID, s_coh_static_class_##TYPE, \
00103 coherence::io::pof::PortableObjectSerializer::create(POF_TYPE_ID)))
00104
00105
00106
00107
00108
00109
00110
00111
00112 #define COH_REGISTER_PORTABLE_CLASS(POF_TYPE_ID, TYPE) \
00113 COH_REGISTER_TYPED_CLASS(TYPE); \
00114 COH_REGISTER_ONLY_PORTABLE_CLASS(POF_TYPE_ID, TYPE)
00115
00116
00117
00118
00119
00120
00121
00122
00123 #define COH_REGISTER_MANAGED_CLASS(POF_TYPE_ID, TYPE) \
00124 COH_REGISTER_NAMED_CLASS(TYPE, \
00125 coherence::lang::TypedClass<coherence::lang::Managed<TYPE > >::create()); \
00126 COH_STATIC_INIT_EX(1, coherence::io::pof::SystemPofContext::getInstance()-> \
00127 registerUserType(POF_TYPE_ID, s_coh_static_class_##TYPE, \
00128 coherence::io::pof::TypedSerializer<coherence::lang::Managed<TYPE > >::create()))
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 #define COH_REGISTER_POF_ANNOTATED_CLASS(POF_TYPE_ID, TYPE) \
00141 COH_STATIC_INIT(coherence::io::pof::SystemPofContext::getInstance()-> \
00142 registerUserType(POF_TYPE_ID, \
00143 coherence::lang::SystemClassLoader::getInstance()-> \
00144 loadByType(typeid(TYPE)), \
00145 coherence::io::pof::PofAnnotationSerializer::create(POF_TYPE_ID,\
00146 coherence::lang::SystemClassLoader::getInstance()-> \
00147 loadByType(typeid(TYPE))))) \
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 #define COH_REGISTER_POF_ANNOTATED_CLASS_AI(POF_TYPE_ID, TYPE) \
00160 COH_STATIC_INIT(coherence::io::pof::SystemPofContext::getInstance()-> \
00161 registerUserType(POF_TYPE_ID, \
00162 coherence::lang::SystemClassLoader::getInstance()-> \
00163 loadByType(typeid(TYPE)), \
00164 coherence::io::pof::PofAnnotationSerializer::create(POF_TYPE_ID,\
00165 coherence::lang::SystemClassLoader::getInstance()-> \
00166 loadByType(typeid(TYPE)), true))) \
00167
00168 COH_CLOSE_NAMESPACE3
00169
00170 #endif // COH_SYSTEM_POF_CONTEXT_HPP