IVirtualMachine.h

Go to the documentation of this file.
00001 /*========================================================== */ 
00002 // header file automatically generated by PIDGEN - DO NOT MODIFY
00003 /*========================================================== */ 
00004 
00005 #ifndef SUPPORT_IVIRTUALMACHINE_H
00006 #define SUPPORT_IVIRTUALMACHINE_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  * Copyright (c) 2005 Palmsource, Inc.
00015  * 
00016  * This software is licensed as described in the file LICENSE, which
00017  * you should have received as part of this distribution. The terms
00018  * are also available at http://www.openbinder.org/license.html.
00019  * 
00020  * This software consists of voluntary contributions made by many
00021  * individuals. For the exact contribution history, see the revision
00022  * history and logs, available at http://www.openbinder.org
00023  */
00030 /* ============= Interface Class Declarations =========================== */
00031 
00032 #if _SUPPORTS_NAMESPACE
00033 namespace palmos {
00034 namespace support {
00035 #endif /* _SUPPORTS_NAMESPACE */
00036 
00038 
00039 class IVirtualMachine : public IInterface
00040 {
00041 public:
00042     B_DECLARE_META_INTERFACE(VirtualMachine)
00043     
00044     
00045     /* ------- Methods ------------------------ */
00046     
00047     virtual void                    Init() = 0;
00048     
00049     virtual sptr<IBinder>           InstantiateComponent(const SValue& componentInfo, const SString& component, const SValue& args, status_t* outError = NULL) = 0;
00050     
00051     /* ------- inline helpers ------------------------- */
00052     status_t LinkVirtualMachine(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00053     {
00054         return AsBinder()->Link(to, mappings, flags);
00055     }
00056     status_t UnlinkVirtualMachine(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00057     {
00058         return AsBinder()->Unlink(to, mappings, flags);
00059     }
00060 
00061 protected:
00062                                     IVirtualMachine() { }
00063     virtual                         ~IVirtualMachine();
00064 
00065 private:
00066     /* ------- copy/assignment protection ------------------ */
00067                                     IVirtualMachine(const IVirtualMachine& o);
00068             IVirtualMachine&        operator=(const IVirtualMachine& o);
00069 };
00070 
00071 
00072 /* ============= Local Class Declarations =============================== */
00073 
00074 class BnVirtualMachine : public IVirtualMachine, public BBinder
00075 {
00076 public:
00077     virtual SValue                  Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00078     virtual sptr<IInterface>        InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00079 
00080 protected:
00081                                     BnVirtualMachine();
00082                                     BnVirtualMachine(const SContext& context);
00083     virtual                         ~BnVirtualMachine();
00084     
00085     virtual sptr<IBinder>           AsBinderImpl();
00086     virtual sptr<const IBinder>     AsBinderImpl() const;
00087     
00088     /* ------- Marshalling Details ------------ */
00089     virtual status_t                HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00090     virtual status_t                Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00091 
00092 private:
00093                                     BnVirtualMachine(const BnVirtualMachine& o);
00094             BnVirtualMachine&       operator=(const BnVirtualMachine& o);
00095 };
00096 
00097 
00098 #if _SUPPORTS_NAMESPACE
00099 } } // namespace palmos::support
00100 #endif /* _SUPPORTS_NAMESPACE */
00101 
00102 
00103 // namespace palmos::support
00104 
00105 #endif // SUPPORT_IVIRTUALMACHINE_H
00106