00001
00002
00003
00004
00005 #ifndef SUPPORT_IPROCESSMANAGER_H
00006 #define SUPPORT_IPROCESSMANAGER_H
00007
00008 #include <support/IInterface.h>
00009 #include <support/Binder.h>
00010 #include <support/Context.h>
00011 #include <support/String.h>
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <support/IProcess.h>
00025
00026
00027
00028 #if _SUPPORTS_NAMESPACE
00029 namespace palmos {
00030 namespace support {
00031 #endif
00032
00033 class INode;
00034
00035
00036
00038
00051 class IProcessManager : public IInterface
00052 {
00053 public:
00054 B_DECLARE_META_INTERFACE(ProcessManager)
00055
00056
00057
00058
00059
00060
00091 virtual sptr<IBinder> NewIfRemote(const sptr<INode>& context, const SString& component, const SValue& args, uint32_t flags, const sptr<IProcess>& caller, SValue* componentInfo, status_t* status = NULL) = 0;
00092
00093
00094 status_t LinkProcessManager(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00095 {
00096 return AsBinder()->Link(to, mappings, flags);
00097 }
00098 status_t UnlinkProcessManager(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00099 {
00100 return AsBinder()->Unlink(to, mappings, flags);
00101 }
00102
00103 protected:
00104 IProcessManager() { }
00105 virtual ~IProcessManager();
00106
00107 private:
00108
00109 IProcessManager(const IProcessManager& o);
00110 IProcessManager& operator=(const IProcessManager& o);
00111 };
00112
00113
00114
00115
00116 class BnProcessManager : public IProcessManager, public BBinder
00117 {
00118 public:
00119 virtual SValue Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00120 virtual sptr<IInterface> InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00121
00122 protected:
00123 BnProcessManager();
00124 BnProcessManager(const SContext& context);
00125 virtual ~BnProcessManager();
00126
00127 virtual sptr<IBinder> AsBinderImpl();
00128 virtual sptr<const IBinder> AsBinderImpl() const;
00129
00130
00131 virtual status_t HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00132 virtual status_t Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00133
00134 private:
00135 BnProcessManager(const BnProcessManager& o);
00136 BnProcessManager& operator=(const BnProcessManager& o);
00137 };
00138
00139
00140 #if _SUPPORTS_NAMESPACE
00141 } }
00142 #endif
00143
00144
00145
00146
00147 #endif // SUPPORT_IPROCESSMANAGER_H
00148