IReferable.h

Go to the documentation of this file.
00001 /*========================================================== */ 
00002 // header file automatically generated by PIDGEN - DO NOT MODIFY
00003 /*========================================================== */ 
00004 
00005 #ifndef STORAGE_IREFERABLE_H
00006 #define STORAGE_IREFERABLE_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 storage {
00035 using namespace palmos::support;
00036 #endif /* _SUPPORTS_NAMESPACE */
00037 
00039 
00066 class IReferable : public IInterface
00067 {
00068 public:
00069     B_DECLARE_META_INTERFACE(Referable)
00070     
00071     
00072     /* ------- Properties --------------------- */
00073     
00074     
00075 
00084     virtual SString                 Reference() const = 0;
00085     
00086     /* ------- inline helpers ------------------------- */
00087     status_t LinkReferable(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00088     {
00089         return AsBinder()->Link(to, mappings, flags);
00090     }
00091     status_t UnlinkReferable(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00092     {
00093         return AsBinder()->Unlink(to, mappings, flags);
00094     }
00095 
00096 protected:
00097                                     IReferable() { }
00098     virtual                         ~IReferable();
00099 
00100 private:
00101     /* ------- copy/assignment protection ------------------ */
00102                                     IReferable(const IReferable& o);
00103             IReferable&             operator=(const IReferable& o);
00104 };
00105 
00106 
00107 /* ============= Local Class Declarations =============================== */
00108 
00109 class BnReferable : public IReferable, public BBinder
00110 {
00111 public:
00112     virtual SValue                  Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00113     virtual sptr<IInterface>        InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00114     
00115     /* ------- Push Properties ---------------- */
00116 public:
00117             void                    PushReference(const SString& value);
00118 
00119 protected:
00120                                     BnReferable();
00121                                     BnReferable(const SContext& context);
00122     virtual                         ~BnReferable();
00123     
00124     virtual sptr<IBinder>           AsBinderImpl();
00125     virtual sptr<const IBinder>     AsBinderImpl() const;
00126     
00127     /* ------- Marshalling Details ------------ */
00128     virtual status_t                HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00129     virtual status_t                Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00130 
00131 private:
00132                                     BnReferable(const BnReferable& o);
00133             BnReferable&            operator=(const BnReferable& o);
00134 };
00135 
00136 
00137 #if _SUPPORTS_NAMESPACE
00138 } } // namespace palmos::storage
00139 #endif /* _SUPPORTS_NAMESPACE */
00140 
00141 
00142 // namespace palmos::storage
00143 
00144 #endif // STORAGE_IREFERABLE_H
00145