~ubuntu-branches/ubuntu/wily/afnix/wily

« back to all changes in this revision

Viewing changes to src/lib/std/shl/obj/Iterable.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Anibal Monsalve Salazar
  • Date: 2011-03-16 21:31:18 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110316213118-gk4k3ez3e5d2huna
Tags: 2.0.0-1
* QA upload.
* New upstream release
* Debian source format is 3.0 (quilt)
* Fix debhelper-but-no-misc-depends
* Fix ancient-standards-version
* Fix package-contains-linda-override
* debhelper compatibility is 7
* Fix dh-clean-k-is-deprecated

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// ---------------------------------------------------------------------------
2
 
// - Iterable.hpp                                                            -
3
 
// - standard object library - iterable abstract class definition            -
4
 
// ---------------------------------------------------------------------------
5
 
// - This program is free software;  you can redistribute it  and/or  modify -
6
 
// - it provided that this copyright notice is kept intact.                  -
7
 
// -                                                                         -
8
 
// - This program  is  distributed in  the hope  that it will be useful, but -
9
 
// - without  any  warranty;  without  even   the   implied    warranty   of -
10
 
// - merchantability or fitness for a particular purpose.  In no event shall -
11
 
// - the copyright holder be liable for any  direct, indirect, incidental or -
12
 
// - special damages arising in any way out of the use of this software.     -
13
 
// ---------------------------------------------------------------------------
14
 
// - copyright (c) 1999-2007 amaury darsch                                   -
15
 
// ---------------------------------------------------------------------------
16
 
 
17
 
#ifndef  AFNIX_ITERABLE_HPP
18
 
#define  AFNIX_ITERABLE_HPP
19
 
 
20
 
#ifndef  AFNIX_ITERATOR_HPP
21
 
#include "Iterator.hpp"
22
 
#endif
23
 
 
24
 
namespace afnix {
25
 
 
26
 
  /// The Iterable class is an abstract class which define the virtual method
27
 
  /// "makeit" for a class which is iterable. If an object is iterable, 
28
 
  /// an iterator can be constructed for that object. Once the
29
 
  /// iterator is constructed, it is possible to iterate in this object.
30
 
  /// When an iterator is constructed, the container is marked locked and
31
 
  /// and a read lock is taken by the iterator. This means that nothing can
32
 
  /// be written in the container.
33
 
  /// @author amaury darsch
34
 
 
35
 
  class Iterable : public virtual Object {
36
 
  public:
37
 
    /// @return a new iterator for this object
38
 
    virtual Iterator* makeit (void) =0;
39
 
 
40
 
    /// @return true if the given quark is defined
41
 
    bool isquark (const long quark, const bool hflg) const;
42
 
 
43
 
    /// apply this object with a set of arguments and a quark
44
 
    /// @param robj  the current runnable
45
 
    /// @param nset  the current nameset    
46
 
    /// @param quark the quark to apply these arguments
47
 
    /// @param argv  the arguments to apply
48
 
    Object* apply (Runnable* robj, Nameset* nset, const long quark,
49
 
                   Vector* argv);
50
 
  };
51
 
}
52
 
 
53
 
#endif