Annotation of parser3/src/types/pa_vmemcached.h, revision 1.3
1.1 moko 1: /** @file
2: Parser: memcached class decls.
3:
4: Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com)
5: Authors:
6: Ivan Poluyanov <ivan-poluyanov@yandex.ru>
7: Artem Stepanov <timofei1394@thesecure.in>
8: */
9:
10: #ifndef PA_VMEMCACHED_H
11: #define PA_VMEMCACHED_H
12:
1.3 ! moko 13: #define IDENT_PA_VMEMCACHED_H "$Id: pa_vmemcached.h,v 1.2 2012-03-23 22:33:23 moko Exp $"
1.1 moko 14:
15: #include "classes.h"
16: #include "pa_vstateless_object.h"
17:
18: #include "pa_memcached.h"
19:
20: // defines
21: #define VMEMCACHED_TYPE "memcached"
22:
23: // externs
24: extern Methoded *memcached_class;
25:
26: class VMemcached: public VStateless_object {
27: public:
28: override const char* type() const { return VMEMCACHED_TYPE; }
29: override VStateless_class *get_class() { return memcached_class; }
30: override bool as_bool() const { return true; }
31:
32: override Value* get_element(const String& aname);
33: override const VJunction* put_element(const String& aname, Value* avalue, bool /*replace*/);
34:
35: public: // usage
1.2 moko 36: VMemcached(): fm(0), fttl(0) {}
1.1 moko 37:
38: ~VMemcached(){
39: if(fm)
40: f_memcached_free(fm);
41: }
42:
1.3 ! moko 43: void open(const String& options_string, time_t attl);
! 44: void open_parse(const String& connect_string, time_t attl);
! 45:
1.1 moko 46: void remove(const String& aname);
1.2 moko 47: void flush(time_t attl=0);
48: Value &mget(ArrayString &akeys);
1.1 moko 49:
50: private:
51: memcached_st* fm;
1.2 moko 52: time_t fttl;
1.1 moko 53:
54: };
55:
56: #endif
57:
E-mail: