IIterator.h

Go to the documentation of this file.
00001 /*========================================================== */ 
00002 // header file automatically generated by PIDGEN - DO NOT MODIFY
00003 /*========================================================== */ 
00004 
00005 #ifndef SUPPORT_IITERATOR_H
00006 #define SUPPORT_IITERATOR_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 
00054 class IIterator : public IInterface
00055 {
00056 public:
00057     B_DECLARE_META_INTERFACE(Iterator)
00058     
00059     
00060     /* ------- Typedefs --------------------- */
00061     typedef SVector<SValue> ValueList;
00062     
00063     /* ------- enums/structs --------------------- */
00064     enum  {
00068         BINDER_IPC_LIMIT=0x05
00069     };
00070     
00072 
00080     enum  {
00082 
00086         REQUEST_DATA=0x1000,
00088 
00094         COLLAPSE_NODE=0x2000,
00095         COLLAPSE_CATALOG=0x2000,
00098 
00106         IGNORE_PROJECTION=0x4000
00107     };
00108     
00109     
00110     /* ------- Properties --------------------- */
00111     
00113 
00117     virtual SValue                  Options() const = 0;
00118     
00119     /* ------- Methods ------------------------ */
00120     
00122 
00148     virtual status_t                Next(ValueList* keys, ValueList* values, uint32_t flags, size_t count = 0) = 0;
00149     
00150     /* ------- Events ------------------------ */
00151     
00156     /* ------- inline helpers ------------------------- */
00157     status_t LinkIterator(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00158     {
00159         return AsBinder()->Link(to, mappings, flags);
00160     }
00161     status_t UnlinkIterator(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00162     {
00163         return AsBinder()->Unlink(to, mappings, flags);
00164     }
00165 
00166 protected:
00167                                     IIterator() { }
00168     virtual                         ~IIterator();
00169 
00170 private:
00171     /* ------- copy/assignment protection ------------------ */
00172                                     IIterator(const IIterator& o);
00173             IIterator&              operator=(const IIterator& o);
00174 };
00175 
00176 
00177 /* ============= Local Class Declarations =============================== */
00178 
00179 class BnIterator : public IIterator, public BBinder
00180 {
00181 public:
00182     virtual SValue                  Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00183     virtual sptr<IInterface>        InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00184     
00185     /* ------- Events ------------------------- */
00186 public:
00188 
00192             void                    PushIteratorChanged(const sptr<IIterator>& it);
00193     
00194     /* ------- Push Properties ---------------- */
00195 public:
00196             void                    PushOptions(const SValue& value);
00197 
00198 protected:
00199                                     BnIterator();
00200                                     BnIterator(const SContext& context);
00201     virtual                         ~BnIterator();
00202     
00203     virtual sptr<IBinder>           AsBinderImpl();
00204     virtual sptr<const IBinder>     AsBinderImpl() const;
00205     
00206     /* ------- Marshalling Details ------------ */
00207     virtual status_t                HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00208     virtual status_t                Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00209 
00210 private:
00211                                     BnIterator(const BnIterator& o);
00212             BnIterator&             operator=(const BnIterator& o);
00213 };
00214 
00215 
00216 #if _SUPPORTS_NAMESPACE
00217 } } // namespace palmos::support
00218 #endif /* _SUPPORTS_NAMESPACE */
00219 
00220 
00221 // namespace palmos::support
00222 
00223 #endif // SUPPORT_IITERATOR_H
00224