IRandomIterator.h

Go to the documentation of this file.
00001 /*========================================================== */ 
00002 // header file automatically generated by PIDGEN - DO NOT MODIFY
00003 /*========================================================== */ 
00004 
00005 #ifndef SUPPORT_IRANDOMITERATOR_H
00006 #define SUPPORT_IRANDOMITERATOR_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  */
00029 #include <support/IIterator.h>
00030 
00031 /* ============= Interface Class Declarations =========================== */
00032 
00033 #if _SUPPORTS_NAMESPACE
00034 namespace palmos {
00035 namespace support {
00036 #endif /* _SUPPORTS_NAMESPACE */
00037 
00039 
00051 class IRandomIterator : public IIterator
00052 {
00053 public:
00054     B_DECLARE_META_INTERFACE(RandomIterator)
00055     
00056     
00057     /* ------- Properties --------------------- */
00058     
00059     
00060     virtual size_t                  Count() const = 0;
00061     
00063 
00076     virtual size_t                  Position() const = 0;
00078 
00091     virtual void                    SetPosition(size_t value) = 0;
00092     
00093     /* ------- Methods ------------------------ */
00094     
00096 
00102     virtual status_t                Remove() = 0;
00103     
00104     /* ------- Events ------------------------ */
00105     
00110     /* ------- inline helpers ------------------------- */
00111     status_t LinkRandomIterator(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00112     {
00113         return AsBinder()->Link(to, mappings, flags);
00114     }
00115     status_t UnlinkRandomIterator(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00116     {
00117         return AsBinder()->Unlink(to, mappings, flags);
00118     }
00119 
00120 protected:
00121                                     IRandomIterator() { }
00122     virtual                         ~IRandomIterator();
00123 
00124 private:
00125     /* ------- copy/assignment protection ------------------ */
00126                                     IRandomIterator(const IRandomIterator& o);
00127             IRandomIterator&        operator=(const IRandomIterator& o);
00128 };
00129 
00130 
00131 /* ============= Local Class Declarations =============================== */
00132 
00133 class BnRandomIterator : public IRandomIterator, public BBinder
00134 {
00135 public:
00136     virtual SValue                  Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00137     virtual sptr<IInterface>        InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00138     
00139     /* ------- Events ------------------------- */
00140 public:
00142 
00146             void                    PushIteratorChanged(const sptr<IIterator>& it);
00148 
00152             void                    PushIteratorDataChanged(const sptr<IIterator>& it, size_t position, const SValue& key, const SValue& value);
00153     
00154     /* ------- Push Properties ---------------- */
00155 public:
00156             void                    PushOptions(const SValue& value);
00157             void                    PushCount(size_t value);
00158             void                    PushPosition(size_t value);
00159 
00160 protected:
00161                                     BnRandomIterator();
00162                                     BnRandomIterator(const SContext& context);
00163     virtual                         ~BnRandomIterator();
00164     
00165     virtual sptr<IBinder>           AsBinderImpl();
00166     virtual sptr<const IBinder>     AsBinderImpl() const;
00167     
00168     /* ------- Marshalling Details ------------ */
00169     virtual status_t                HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00170     virtual status_t                Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00171 
00172 private:
00173                                     BnRandomIterator(const BnRandomIterator& o);
00174             BnRandomIterator&       operator=(const BnRandomIterator& o);
00175 };
00176 
00177 
00178 #if _SUPPORTS_NAMESPACE
00179 } } // namespace palmos::support
00180 #endif /* _SUPPORTS_NAMESPACE */
00181 
00182 
00183 // namespace palmos::support
00184 
00185 #endif // SUPPORT_IRANDOMITERATOR_H
00186