Annotation of parser3/src/types/pa_vresponse.h, revision 1.10
1.3 paf 1: /** @file
2: Parser: response class.
3:
1.1 paf 4: Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com)
1.3 paf 5:
1.1 paf 6: Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
7:
1.10 ! paf 8: $Id: pa_vresponse.h,v 1.9 2001/04/28 08:44:16 paf Exp $
1.1 paf 9: */
10:
11: #ifndef PA_VRESPONSE_H
12: #define PA_VRESPONSE_H
13:
1.3 paf 14: #include "pa_vstateless_object.h"
1.1 paf 15: #include "pa_string.h"
1.9 paf 16:
17: extern Methoded *response_class;
1.1 paf 18:
19: class Response;
20:
1.5 paf 21: /// value of type 'response'
1.3 paf 22: class VResponse : public VStateless_object {
1.1 paf 23: public: // Value
24:
25: const char *type() const { return "response"; }
1.2 paf 26:
1.5 paf 27: /// Response: ffields
1.2 paf 28: Hash *get_hash() { return &ffields; }
1.1 paf 29:
1.8 paf 30: /// Response: method,fields
1.1 paf 31: Value *get_element(const String& name) {
1.8 paf 32: // $method
1.3 paf 33: if(Value *result=VStateless_object::get_element(name))
1.1 paf 34: return result;
35:
36: // $field
37: return static_cast<Value *>(ffields.get(name));
38: }
39:
1.5 paf 40: /// Response: (attribute)=value
1.1 paf 41: void put_element(const String& name, Value *value) {
42: ffields.put(name, value);
43: }
1.4 paf 44:
45: protected: // VAliased
46:
1.6 paf 47: /// disable .CLASS element. @see VAliased::get_element
1.7 paf 48: bool hide_class() { return true; }
1.1 paf 49:
50: public: // usage
51:
1.3 paf 52: VResponse(Pool& apool) : VStateless_object(apool, *response_class),
1.1 paf 53: ffields(apool) {
54: }
55:
56: Hash& fields() { return ffields; }
57:
58: private:
59:
60: Hash ffields;
61:
62: };
63:
64: #endif
E-mail: