summaryrefslogtreecommitdiff
path: root/include/countable.h
blob: 12d87d5a612d42d8d06bc3d92ef0025ca406511f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
 *  Countable.h
 * 
 *  "Interface" that can be "implemented" by your class. If you do, you
 *  create your class like this:
 * 
 *  class MyClass : public Php::Base, public Php::Countable { ... }
 * 
 *  You will have to implement the count() method, which should return the
 *  number of elements in the class
 *
 *  @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
 *  @copyright 2014 Copernica BV
 */

/**
 *  Set up namespace
 */
namespace Php {
    
/**
 *  Class definition
 */
class Countable
{
public:
    /**
     *  Implementation of the countable interface
     *  @return zend_class_entry*
     *  @internal
     */
    static struct _zend_class_entry *implementation();

    /**
     *  Retrieve the number of items in the class
     *  @return Value
     */
    virtual Value count() = 0;
};
    
/**
 *  End namespace
 */
}