00001
00002
00003
00004
00005 #ifndef SUPPORT_IPROCESS_H
00006 #define SUPPORT_IPROCESS_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
00030
00031
00032 #if _SUPPORTS_NAMESPACE
00033 namespace palmos {
00034 namespace support {
00035 #endif
00036
00037 class INode;
00038
00039
00040
00042
00049 class IProcess : public IInterface
00050 {
00051 public:
00052 B_DECLARE_META_INTERFACE(Process)
00053
00054
00055
00056
00057
00059
00070 virtual sptr<IBinder> InstantiateComponent(const sptr<INode>& ctx, const SValue& componentInfo, const SString& component, const SValue& args, status_t* outError = NULL) = 0;
00071
00073
00075 virtual int32_t AtomMarkLeakReport() = 0;
00076
00077 virtual void AtomLeakReport(int32_t mark, int32_t last, uint32_t flags) = 0;
00078
00080 virtual void PrintBinderReferences() = 0;
00081
00083
00084 virtual void RestartMallocProfiling() = 0;
00085
00086 virtual void SetMallocProfiling(bool enabled, int32_t dumpPeriod, int32_t maxItems, int32_t stackDepth) = 0;
00087
00089 virtual void RestartVectorProfiling() = 0;
00090
00091 virtual void SetVectorProfiling(bool enabled, int32_t dumpPeriod, int32_t maxItems, int32_t stackDepth) = 0;
00092
00094 virtual void RestartMessageIPCProfiling() = 0;
00095
00096 virtual void SetMessageIPCProfiling(bool enabled, int32_t dumpPeriod, int32_t maxItems, int32_t stackDepth) = 0;
00097
00099 virtual void RestartBinderIPCProfiling() = 0;
00100
00101 virtual void SetBinderIPCProfiling(bool enabled, int32_t dumpPeriod, int32_t maxItems, int32_t stackDepth) = 0;
00102
00103 virtual void PrintBinderIPCProfiling() = 0;
00104
00105
00106 status_t LinkProcess(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00107 {
00108 return AsBinder()->Link(to, mappings, flags);
00109 }
00110 status_t UnlinkProcess(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00111 {
00112 return AsBinder()->Unlink(to, mappings, flags);
00113 }
00114
00115 protected:
00116 IProcess() { }
00117 virtual ~IProcess();
00118
00119 private:
00120
00121 IProcess(const IProcess& o);
00122 IProcess& operator=(const IProcess& o);
00123 };
00124
00125
00126
00127
00128 class BnProcess : public IProcess, public BBinder
00129 {
00130 public:
00131 virtual SValue Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00132 virtual sptr<IInterface> InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00133
00134 protected:
00135 BnProcess();
00136 BnProcess(const SContext& context);
00137 virtual ~BnProcess();
00138
00139 virtual sptr<IBinder> AsBinderImpl();
00140 virtual sptr<const IBinder> AsBinderImpl() const;
00141
00142
00143 virtual status_t HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00144 virtual status_t Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00145
00146 private:
00147 BnProcess(const BnProcess& o);
00148 BnProcess& operator=(const BnProcess& o);
00149 };
00150
00151
00152 #if _SUPPORTS_NAMESPACE
00153 } }
00154 #endif
00155
00156
00157
00158
00159 #endif // SUPPORT_IPROCESS_H
00160