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 cloneable_spec<SystemPofContext,
00037 extends<SimplePofContext> >
00038 {
00039 friend class factory<SystemPofContext>;
00040
00041
00042
00043 public:
00044
00045
00046
00047 using this_spec::create;
00048
00049 private:
00050
00051
00052
00053 SystemPofContext();
00054
00055
00056
00057
00058 SystemPofContext(const SystemPofContext& that);
00059
00060
00061 public:
00062
00063
00064
00065
00066
00067 static Handle getInstance();
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 static void main(ObjectArray::View vasArg);
00078 };
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 #define COH_REGISTER_POF_SERIALIZER(POF_TYPE_ID, CLASS, POF_SERIALIZER) \
00092 COH_STATIC_INIT(coherence::io::pof::SystemPofContext::getInstance()-> \
00093 registerUserType(POF_TYPE_ID, \
00094 coherence::lang::SystemClassLoader::getInstance()-> \
00095 registerClass(CLASS), POF_SERIALIZER))
00096
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, coherence::io::pof::SystemPofContext::getInstance()-> \
00107 registerUserType(POF_TYPE_ID, s_coh_static_class_##TYPE, \
00108 coherence::io::pof::PortableObjectSerializer::create(POF_TYPE_ID)))
00109
00110
00111
00112
00113
00114
00115
00116
00117 #define COH_REGISTER_PORTABLE_CLASS(POF_TYPE_ID, TYPE) \
00118 COH_REGISTER_TYPED_CLASS(TYPE); \
00119 COH_REGISTER_ONLY_PORTABLE_CLASS(POF_TYPE_ID, TYPE)
00120
00121
00122
00123
00124
00125
00126
00127
00128 #define COH_REGISTER_MANAGED_CLASS(POF_TYPE_ID, TYPE) \
00129 COH_REGISTER_NAMED_CLASS(TYPE, \
00130 coherence::lang::TypedClass<coherence::lang::Managed<TYPE > >::create()); \
00131 COH_STATIC_INIT_EX(1, coherence::io::pof::SystemPofContext::getInstance()-> \
00132 registerUserType(POF_TYPE_ID, s_coh_static_class_##TYPE, \
00133 coherence::io::pof::TypedSerializer<coherence::lang::Managed<TYPE > >::create()))
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145 #define COH_REGISTER_POF_ANNOTATED_CLASS(POF_TYPE_ID, TYPE) \
00146 COH_STATIC_INIT(coherence::io::pof::SystemPofContext::getInstance()-> \
00147 registerUserType(POF_TYPE_ID, \
00148 coherence::lang::SystemClassLoader::getInstance()-> \
00149 loadByType(typeid(TYPE)), \
00150 coherence::io::pof::PofAnnotationSerializer::create(POF_TYPE_ID,\
00151 coherence::lang::SystemClassLoader::getInstance()-> \
00152 loadByType(typeid(TYPE))))) \
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 #define COH_REGISTER_POF_ANNOTATED_CLASS_AI(POF_TYPE_ID, TYPE) \
00165 COH_STATIC_INIT(coherence::io::pof::SystemPofContext::getInstance()-> \
00166 registerUserType(POF_TYPE_ID, \
00167 coherence::lang::SystemClassLoader::getInstance()-> \
00168 loadByType(typeid(TYPE)), \
00169 coherence::io::pof::PofAnnotationSerializer::create(POF_TYPE_ID,\
00170 coherence::lang::SystemClassLoader::getInstance()-> \
00171 loadByType(typeid(TYPE)), true))) \
00172
00173 COH_CLOSE_NAMESPACE3
00174
00175 #endif // COH_SYSTEM_POF_CONTEXT_HPP