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/PortableTypeSerializer.hpp"
00024 #include "coherence/io/pof/SimplePofContext.hpp"
00025 #include "coherence/io/pof/TypedSerializer.hpp"
00026
00027 COH_OPEN_NAMESPACE3(coherence,io,pof)
00028
00029
00030
00031
00032
00033
00034
00035
00036 class COH_EXPORT SystemPofContext
00037 : public cloneable_spec<SystemPofContext,
00038 extends<SimplePofContext> >
00039 {
00040 friend class factory<SystemPofContext>;
00041
00042
00043
00044 public:
00045
00046
00047
00048 using this_spec::create;
00049
00050 private:
00051
00052
00053
00054 SystemPofContext();
00055
00056
00057
00058
00059 SystemPofContext(const SystemPofContext& that);
00060
00061
00062 public:
00063
00064
00065
00066
00067
00068 static Handle getInstance();
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 static void main(ObjectArray::View vasArg);
00079 };
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 #define COH_REGISTER_POF_SERIALIZER(POF_TYPE_ID, CLASS, POF_SERIALIZER) \
00093 COH_STATIC_INIT(coherence::io::pof::SystemPofContext::getInstance()-> \
00094 registerUserType(POF_TYPE_ID, \
00095 coherence::lang::SystemClassLoader::getInstance()-> \
00096 registerClass(CLASS), POF_SERIALIZER))
00097
00098
00099
00100
00101
00102
00103
00104
00105 #define COH_REGISTER_ONLY_PORTABLE_CLASS(POF_TYPE_ID, TYPE) \
00106 COH_STATIC_INIT_EX(1, \
00107 coherence::io::pof::SystemPofContext::getInstance()-> \
00108 registerUserType(POF_TYPE_ID, s_coh_static_class_##TYPE, \
00109 coherence::io::pof::PortableObjectSerializer::create(POF_TYPE_ID)))
00110
00111
00112
00113
00114
00115
00116
00117
00118 #define COH_REGISTER_PORTABLE_CLASS(POF_TYPE_ID, TYPE) \
00119 COH_REGISTER_TYPED_CLASS(TYPE); \
00120 COH_REGISTER_ONLY_PORTABLE_CLASS(POF_TYPE_ID, TYPE)
00121
00122
00123
00124
00125
00126
00127
00128
00129 #define COH_REGISTER_MANAGED_CLASS(POF_TYPE_ID, TYPE) \
00130 COH_REGISTER_NAMED_CLASS(TYPE, \
00131 coherence::lang::TypedClass<coherence::lang::Managed<TYPE > >::create()); \
00132 COH_STATIC_INIT_EX(1, coherence::io::pof::SystemPofContext::getInstance()-> \
00133 registerUserType(POF_TYPE_ID, s_coh_static_class_##TYPE, \
00134 coherence::io::pof::TypedSerializer<coherence::lang::Managed<TYPE > >::create()))
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144 #define COH_REGISTER_ONLY_PORTABLE_TYPE_CLASS(POF_TYPE_ID, TYPE) \
00145 COH_STATIC_INIT_EX(1, \
00146 coherence::io::pof::SystemPofContext::getInstance()-> \
00147 registerUserType(POF_TYPE_ID, s_coh_static_class_##TYPE, \
00148 coherence::io::pof::PortableTypeSerializer::create(POF_TYPE_ID)))
00149
00150
00151
00152
00153
00154
00155
00156
00157 #define COH_REGISTER_PORTABLE_TYPE_CLASS(POF_TYPE_ID, TYPE) \
00158 COH_REGISTER_TYPED_CLASS(TYPE); \
00159 COH_REGISTER_ONLY_PORTABLE_TYPE_CLASS(POF_TYPE_ID, TYPE)
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170 #define COH_REGISTER_POF_ANNOTATED_CLASS(POF_TYPE_ID, TYPE) \
00171 COH_STATIC_INIT(coherence::io::pof::SystemPofContext::getInstance()-> \
00172 registerUserType(POF_TYPE_ID, \
00173 coherence::lang::SystemClassLoader::getInstance()-> \
00174 loadByType(typeid(TYPE)), \
00175 coherence::io::pof::PofAnnotationSerializer::create(POF_TYPE_ID,\
00176 coherence::lang::SystemClassLoader::getInstance()-> \
00177 loadByType(typeid(TYPE)))))
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189 #define COH_REGISTER_POF_ANNOTATED_CLASS_AI(POF_TYPE_ID, TYPE) \
00190 COH_STATIC_INIT(coherence::io::pof::SystemPofContext::getInstance()-> \
00191 registerUserType(POF_TYPE_ID, \
00192 coherence::lang::SystemClassLoader::getInstance()-> \
00193 loadByType(typeid(TYPE)), \
00194 coherence::io::pof::PofAnnotationSerializer::create(POF_TYPE_ID,\
00195 coherence::lang::SystemClassLoader::getInstance()-> \
00196 loadByType(typeid(TYPE)), true)))
00197
00198 COH_CLOSE_NAMESPACE3
00199
00200 #endif // COH_SYSTEM_POF_CONTEXT_HPP