00001
00002 #ifndef IT_Bus_policy_xsdTypes_FACTORY_H_
00003 #define IT_Bus_policy_xsdTypes_FACTORY_H_
00004
00005 #if !defined(IT_AFC_API)
00006 #if defined(IT_AFC_API_EXPORT)
00007 #define IT_AFC_API IT_DECLSPEC_EXPORT
00008 #else
00009 #define IT_AFC_API IT_DECLSPEC_IMPORT
00010 #endif
00011 #endif
00012
00013
00014 #include <it_dsa/hash_map.h>
00015 #include <it_bus/qname.h>
00016 #include <it_bus/type_factory.h>
00017 #include <it_bus/any_type.h>
00018 #include <it_bus/user_fault_exception.h>
00019
00020 namespace IT_Policy
00021 {
00022 class IT_AFC_API policy_xsdTypesFactory : public IT_Bus::TypeFactory
00023 {
00024 public:
00025 policy_xsdTypesFactory();
00026
00027 virtual ~policy_xsdTypesFactory();
00028
00029 typedef IT_Bus::AnyType * (*create_type_ptr)();
00030
00031 typedef IT_Bus::UserFaultException * (*create_exception_ptr)();
00032
00033 typedef IT_Bus::AnyType * (*create_element_ptr)();
00034
00035 IT_Bus::AnyType *
00036 create_type(
00037 const IT_Bus::QName& type_name
00038 ) const ;
00039
00040 void destroy_type(
00041 IT_Bus::AnyType * any_type
00042 ) const;
00043
00044 IT_Bus::UserFaultException *
00045 create_exception(
00046 const IT_Bus::QName& type_name
00047 ) const ;
00048
00049 void destroy_exception(
00050 IT_Bus::UserFaultException * ex_type
00051 ) const;
00052
00053 IT_Bus::AnyType *
00054 create_type_for_element(
00055 const IT_Bus::QName& element_name
00056 ) const ;
00057
00058 void destroy_element(
00059 IT_Bus::AnyType * any_type
00060 ) const;
00061
00062 static IT_Bus::AnyType *
00063 smf_create_PolicyExpression();
00064
00065 static IT_Bus::AnyType *
00066 smf_create_PolicyDescriptor();
00067
00068 private:
00069 void populate_type_map();
00070
00071 void populate_ex_map();
00072
00073 void populate_element_map();
00074
00075 void populate_namespace_uri_map();
00076
00077 void insert_type_fn_ptr(const IT_Bus::QName & type_name, create_type_ptr op_ptr);
00078
00079 void insert_exception_fn_ptr(const IT_Bus::QName & ex_name, create_exception_ptr op_ptr);
00080
00081 void insert_element_type_map(const IT_Bus::QName& element_name, const IT_Bus::QName& type_name);
00082 void insert_element_fn_ptr(const IT_Bus::QName& element_name, create_element_ptr op_ptr);
00083
00084 static IT_HashMap<IT_Bus::QName, create_type_ptr, IT_Bus::QNameHash, IT_Bus::QNameEq> sm_type_map;
00085 static IT_HashMap<IT_Bus::QName, create_exception_ptr, IT_Bus::QNameHash, IT_Bus::QNameEq> sm_ex_map;
00086 static IT_HashMap<IT_Bus::QName, create_element_ptr, IT_Bus::QNameHash, IT_Bus::QNameEq> sm_element_map;
00087 static IT_Vector<IT_Bus::String> sm_uri_vector;
00088 };
00089 }
00090 #endif