Annotation of parser3/src/types/pa_vmemcached.h, revision 1.8
1.1 moko 1: /** @file
2: Parser: memcached class decls.
3:
1.8 ! moko 4: Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com)
1.1 moko 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.8 ! moko 13: #define IDENT_PA_VMEMCACHED_H "$Id: pa_vmemcached.h,v 1.7 2013/12/02 21:44:47 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);
1.6 moko 33: override const VJunction* put_element(const String& aname, Value* avalue);
1.1 moko 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.7 moko 43: void open(const String& options_string, time_t attl, bool connect);
1.3 moko 44: void open_parse(const String& connect_string, time_t attl);
45:
1.4 moko 46: bool add(const String& aname, Value* avalue);
1.1 moko 47: void remove(const String& aname);
1.2 moko 48: void flush(time_t attl=0);
1.5 moko 49: void quit();
1.2 moko 50: Value &mget(ArrayString &akeys);
1.1 moko 51:
52: private:
53: memcached_st* fm;
1.2 moko 54: time_t fttl;
1.1 moko 55:
56: };
57:
58: #endif
59:
E-mail: